Skip to content

use Lchown instead of Chown so that symbolic links are not followed#27

Merged
caleblloyd merged 1 commit into
boxboat:masterfrom
embray:lchown
Jun 12, 2020
Merged

use Lchown instead of Chown so that symbolic links are not followed#27
caleblloyd merged 1 commit into
boxboat:masterfrom
embray:lchown

Conversation

@embray

@embray embray commented Jun 12, 2020

Copy link
Copy Markdown
Contributor

Thank you for this very helpful tool--it solves exactly the problem I was having.

However, I noticed that symbolic links within the paths I configured were not being touched up. This is because while filepath.Walk does not follow links, syscall.Chown does. This is especially a problem if I have symlinks within my user path to files outside the user path that I might not want changed. Using Lchown ensures that symlinks are handled the same as normal files.

Signed-off-by: E. Madison Bray <erik.bray@lri.fr>
@caleblloyd

Copy link
Copy Markdown
Collaborator

Thank you for the contribution! Yes it does seem that Lchown is the proper call here, we don't want to follow symlinks outside of designated paths

@caleblloyd
caleblloyd merged commit 0e4bb16 into boxboat:master Jun 12, 2020
@caleblloyd

Copy link
Copy Markdown
Collaborator

Published in v0.5

@embray
embray deleted the lchown branch June 12, 2020 16:21
@embray

embray commented Jun 12, 2020

Copy link
Copy Markdown
Contributor Author

Great, thanks for the quick release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants