-
Notifications
You must be signed in to change notification settings - Fork 35
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
Use *at functions for directory creation #124
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for the changes. Since the path sources come from trusted system data that seems good enough. I added two suggestions
fcbc5a7
to
98fbe3d
Compare
Perform path traversal manually and do not follow symlinks.
98fbe3d
to
dbb18ef
Compare
continue; | ||
} | ||
|
||
if (mkdirat(parentdirfd, node_basename, node->fmode) < 0) { |
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.
I wonder whether there is a bug lingering here with umask and the mode parameter.
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.
I don't see a problem with this. Why is this concerning to you?
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.
If the desired mode of the directory has bits set that are umasked away, they'd be missing.
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.
since this is running in a special context I assumed it has no umask set. But yes, if there's on this will be a problem. So setting the umask explicitly is probably a good idea
Should be functionally complete now, but still untested. I converted some leftover uses of I don't like the |
I agree. Do we have tests for this in openQA that we can use to test it?
Agreed. But from my POV that's not in scope for this, but feel free to add it |
Perform path traversal manually and do not follow symlinks.
Draft because some TODOs still open. Also absolutely untested.