-
Notifications
You must be signed in to change notification settings - Fork 3.8k
first go at fixing #1790 (lchown part) #1826
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
Conversation
cjihrig
left a comment
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 missing Windows pieces, tests, and docs.
include/uv.h
Outdated
| uv_uid_t uid, | ||
| uv_gid_t gid, | ||
| uv_fs_cb cb); | ||
| UV_EXTERN int uv_ls_chown(uv_loop_t* loop, |
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.
uv_fs_lchown()?
src/unix/fs.c
Outdated
|
|
||
| int uv_fs_lchown(uv_loop_t* loop, | ||
| uv_fs_t* req, | ||
| uv_os_fd_t file, |
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.
The signature doesn't match up.
src/unix/fs.c
Outdated
| uv_gid_t gid, | ||
| uv_fs_cb cb) { | ||
| INIT(LCHOWN); | ||
| req->file = file; |
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 doesn't seem correct to me.
|
the existing there's a TODO in the tests because I have not though yet about how to check that also: |
There are still stubs in the code - Line 2258 in ff167ea
|
|
Now it seems to compile and generate the library fine on windows with VS 2015. There's still the test failing and the missing test (see TODO in |
|
Hi what else can I do to get this PR into libuv ? Thanks |
include/uv.h
Outdated
| uv_gid_t gid, | ||
| uv_fs_cb cb); | ||
| UV_EXTERN int uv_fs_lchown(uv_loop_t* loop, | ||
| uv_fs_t* req, |
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.
Can you line all of these arguments up with the uv_loop_t on the previous line.
src/unix/fs.c
Outdated
|
|
||
|
|
||
| int uv_fs_lchown(uv_loop_t* loop, | ||
| uv_fs_t* req, |
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.
Please line the arguments up.
test/test-fs.c
Outdated
| static void lchown_cb(uv_fs_t* req) { | ||
| ASSERT(req->fs_type == UV_FS_LCHOWN); | ||
| ASSERT(req->result == 0); | ||
| chown_cb_count++; |
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 should be lchown_cb_count?
| static int fchmod_cb_count; | ||
| static int chown_cb_count; | ||
| static int fchown_cb_count; | ||
| static int lchown_cb_count; |
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 variable isn't asserted on anywhere.
| uv_fs_req_cleanup(req); | ||
| } | ||
|
|
||
| static void lchown_cb(uv_fs_t* req) { |
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 isn't called.
|
@bnoordhuis do you have the historical context on why these functions just return 0 on Windows instead of |
|
Not sure what you mean. What does "these functions" refer to? |
|
Sorry, "these functions" refers to the chown family of functions. |
|
It's because there is no meaningful way to implement them, user/group/other isn't a thing on Windows. I don't think it was a deliberate decision to quietly ignore instead of returning ENOSYS, just something that was deemed Good Enough at the time and made node's test suite pass. :-) |
That's what I was looking for. Thanks! |
- increment lchown_cb_count counter - also test async lchown and thereby assert on lchown_cb_count and call lchown_cb - use gid = -1, as per [1] the corresponding ID of the file will not be changed - on cleanup, also remove test_file_link [1] http://pubs.opengroup.org/onlinepubs/9699919799//functions/chown.html
|
all CI failures seem unrelated to me: https://ci.nodejs.org/job/libuv-test-commit-linux/910/nodes=alpine-last-latest-x64/ https://ci.nodejs.org/job/libuv-test-commit-linux/910/nodes=centos6-64/ |
cjihrig
left a comment
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'm not sure if targeting master vs. v1.x is necessary, but LGTM.
Fixes: #1790 PR-URL: #1826 Reviewed-By: Colin Ihrig <[email protected]>
|
Landed on master in 33b6db3. Thanks! I'm going to look into backporting this to v1.x as well. |
Fixes: libuv#1790 PR-URL: libuv#1826 Reviewed-By: Colin Ihrig <[email protected]>
|
Landed on v1.x in aa28f7d. Here is a CI run of that commit with no related failures: https://ci.nodejs.org/view/libuv/job/libuv-test-commit/940/ |
Notable changes: - Building via cmake is now supported. PR-URL: libuv/libuv#1850 - Stricter checks have been added to prevent watching the same file descriptor multiple times. PR-URL: libuv/libuv#1851 Refs: nodejs#3604 - An IPC deadlock on Windows has been fixed. PR-URL: libuv/libuv#1843 Fixes: nodejs#9706 Fixes: nodejs#7657 - uv_fs_lchown() has been added. PR-URL: libuv/libuv#1826 Refs: nodejs#19868 - uv_fs_copyfile() sets errno on error. PR-URL: libuv/libuv#1881 Fixes: nodejs#21329 - uv_fs_fchmod() supports -A files on Windows. PR-URL: libuv/libuv#1819 Refs: nodejs#12803 PR-URL: nodejs#21466 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]>
Notable changes: - Building via cmake is now supported. PR-URL: libuv/libuv#1850 - Stricter checks have been added to prevent watching the same file descriptor multiple times. PR-URL: libuv/libuv#1851 Refs: #3604 - An IPC deadlock on Windows has been fixed. PR-URL: libuv/libuv#1843 Fixes: #9706 Fixes: #7657 - uv_fs_lchown() has been added. PR-URL: libuv/libuv#1826 Refs: #19868 - uv_fs_copyfile() sets errno on error. PR-URL: libuv/libuv#1881 Fixes: #21329 - uv_fs_fchmod() supports -A files on Windows. PR-URL: libuv/libuv#1819 Refs: #12803 PR-URL: #21466 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]>
Notable changes: - Building via cmake is now supported. PR-URL: libuv/libuv#1850 - Stricter checks have been added to prevent watching the same file descriptor multiple times. PR-URL: libuv/libuv#1851 Refs: nodejs#3604 - An IPC deadlock on Windows has been fixed. PR-URL: libuv/libuv#1843 Fixes: nodejs#9706 Fixes: nodejs#7657 - uv_fs_lchown() has been added. PR-URL: libuv/libuv#1826 Refs: nodejs#19868 - uv_fs_copyfile() sets errno on error. PR-URL: libuv/libuv#1881 Fixes: nodejs#21329 - uv_fs_fchmod() supports -A files on Windows. PR-URL: libuv/libuv#1819 Refs: nodejs#12803 PR-URL: nodejs#21466 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]>
Notable changes: - Building via cmake is now supported. PR-URL: libuv/libuv#1850 - Stricter checks have been added to prevent watching the same file descriptor multiple times. PR-URL: libuv/libuv#1851 Refs: #3604 - An IPC deadlock on Windows has been fixed. PR-URL: libuv/libuv#1843 Fixes: #9706 Fixes: #7657 - uv_fs_lchown() has been added. PR-URL: libuv/libuv#1826 Refs: #19868 - uv_fs_copyfile() sets errno on error. PR-URL: libuv/libuv#1881 Fixes: #21329 - uv_fs_fchmod() supports -A files on Windows. PR-URL: libuv/libuv#1819 Refs: #12803 Backport-PR-URL: #24103 PR-URL: #21466 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]>
TODO: