Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle symlinks in ncls #2006

Closed
dankamongmen opened this issue Jul 31, 2021 · 4 comments · Fixed by #2490
Closed

handle symlinks in ncls #2006

dankamongmen opened this issue Jul 31, 2021 · 4 comments · Fixed by #2490
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dankamongmen
Copy link
Owner

in ncls, we have the following:

// handle a single inode of arbitrary type                                                                                              
int handle_inode(std::filesystem::path& dir, const char* p, const struct stat* st, const lsContext& ctx){                               
  (void)st; // FIXME handle symlink (dereflinks)                                                                                        
  (void)ctx; // FIXME handle symlink (dereflinks)                                                                                       
  pthread_mutex_lock(&mtx);                                                                                                             
  work.emplace(job{dir, p});                                                                                                            
  pthread_mutex_unlock(&mtx);                                                                                                           
  pthread_cond_signal(&cond);                                                                                                           
  return 0;                                                                                                                             
}

so yeah, we should resolve those FIXMEs, heh.

@dankamongmen dankamongmen added the enhancement New feature or request label Jul 31, 2021
@dankamongmen dankamongmen added this to the 3.0.0 milestone Jul 31, 2021
@dankamongmen dankamongmen self-assigned this Jul 31, 2021
@dankamongmen
Copy link
Owner Author

probably want to add an -a, too, idk

@dankamongmen dankamongmen removed this from the 3.0.0 milestone Oct 27, 2021
@dankamongmen
Copy link
Owner Author

symlinks seem to be handled just fine as it is?

@dankamongmen
Copy link
Owner Author

ahhhh, we're using fstatat() without AT_SYMLINK_NOFOLLOW, so it's resolving links for us. only on MINGW do we use regular ol' fstat(). sooooooo we want AT_SYMLINK_NOFOLLOW unless -L is provided, and we want to handle symlink resolution ourselves. and on the windows path we want lstat() when -L is provided. and i think that's all we need.

@dankamongmen dankamongmen added this to the 3.1.0 milestone Dec 19, 2021
@dankamongmen
Copy link
Owner Author

alright, got this resolved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant