-
Notifications
You must be signed in to change notification settings - Fork 66
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
Do not delete files open and folder content when cleaning log #1523
Do not delete files open and folder content when cleaning log #1523
Conversation
21796d0
to
1ffe3ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good
1ffe3ad
to
72ed185
Compare
@patrickelectric I was thinking if this recursive implementation would be following soft links and if that is desirable or not. What do you think? |
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
72ed185
to
fd0c298
Compare
Are you talking about recursive symlinks ? If someone ends up doing that they deserve the cpu lock. |
Nope, both is_file and is_dir follow symbolic links, so we are deleting links to files and entering linked directories to remove everything there, which is unsound in some scenarios. Just take a moment to think if this is desired in every situation in which this function will be used. And the behavior was different before this patch - it was deleting using this other function, which, if I understood it correctly, wouldn't follow links to directories. |
Yes, I changed it to delete only files and not the folder structure. |
fd0c298
to
d0b1e61
Compare
Yes I know, this is what we want. But now instead of deleting a link to a directory, we would be entering the linked directory and deleting everything there. This is quite a change in its behavior, can we write a comment on this function saying something like |
Maybe bikeshedding, but I was thinking again here... We might don't actually want to follow symbolic links to directories - considering that this function will be used against directories to which the user has access, if he creates a symbolic link to any system file, say |
d0b1e61
to
85ca243
Compare
@joaoantoniocardoso changed to not follow subfolder symlinks of the desired bath. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
85ca243
to
73be494
Compare
No description provided.