-
Notifications
You must be signed in to change notification settings - Fork 154
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
Fix #749, #620: implement lchown() #752
base: master
Are you sure you want to change the base?
Fix #749, #620: implement lchown() #752
Conversation
Codecov Report
@@ Coverage Diff @@
## master #752 +/- ##
==========================================
+ Coverage 86.88% 86.92% +0.03%
==========================================
Files 16 16
Lines 1739 1751 +12
==========================================
+ Hits 1511 1522 +11
- Misses 228 229 +1
Continue to review full report at Codecov.
|
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.
Quick first pass. @humphd I haven't reviewed the implementation itself.
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.
This is looking really good. One thing it lacks is any kind of testing for the central difference between this and chown
, namely, tests that work with symlinks and make sure that when you all chown
it changes the referenced file, and when you call lchown
, it changes the symlink node instead. I'd add some tests that basically do this:
- create a file named
/file
- create a symlink to
/file
called/link
chown
/link` to 500 500 or somethinglchown
/link to 600 600 or something (different from the first)- call
stat
on/link
and expect the uid/gid to match 500 - call
lstat
on/link
and expect the uid/gid to match 600
I'd break all that up into two separate tests, one for stat
/chown
and the other for lstat
/lchown
. This way we'll know that they work as expected on the proper node.
Great work on this.
There happens to be a test for chown() already, but I've created the test for lchown()! |
Let me know if my logic was wrong, but I believe this was the correct flow.