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

Fix #749, #620: implement lchown() #752

Open
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@andrewkoung
Copy link
Contributor

commented Apr 7, 2019

Let me know if my logic was wrong, but I believe this was the correct flow.

@codecov-io

This comment has been minimized.

Copy link

commented Apr 7, 2019

Codecov Report

Merging #752 into master will increase coverage by 0.03%.
The diff coverage is 87.09%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/filesystem/interface.js 93.29% <ø> (ø) ⬆️
src/filesystem/implementation.js 84.21% <87.09%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4aae538...34434b0. Read the comment docs.

@modeswitch
Copy link
Member

left a comment

Quick first pass. @humphd I haven't reviewed the implementation itself.

Show resolved Hide resolved src/filesystem/implementation.js Outdated
Show resolved Hide resolved src/filesystem/implementation.js Outdated
Show resolved Hide resolved src/filesystem/implementation.js Outdated
Show resolved Hide resolved src/filesystem/interface.js Outdated
Show resolved Hide resolved src/filesystem/implementation.js Outdated

@humphd humphd changed the title implementing lchown() Fix #749, #620: implement lchown() Apr 10, 2019

@humphd

This comment has been minimized.

Copy link
Contributor

commented Apr 10, 2019

Updated the title of this PR, since it will fix #749, #620.

@humphd
Copy link
Contributor

left a comment

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 something
  • lchown /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.

Show resolved Hide resolved src/filesystem/interface.js Outdated
@andrewkoung

This comment has been minimized.

Copy link
Contributor Author

commented Apr 17, 2019

There happens to be a test for chown() already, but I've created the test for lchown()!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.