first go at fixing #1790 (lchown part)#1826
Conversation
cjihrig
left a comment
There was a problem hiding this comment.
This is missing Windows pieces, tests, and docs.
| uv_uid_t uid, | ||
| uv_gid_t gid, | ||
| uv_fs_cb cb); | ||
| UV_EXTERN int uv_ls_chown(uv_loop_t* loop, |
|
|
||
| int uv_fs_lchown(uv_loop_t* loop, | ||
| uv_fs_t* req, | ||
| uv_os_fd_t file, |
There was a problem hiding this comment.
The signature doesn't match up.
| uv_gid_t gid, | ||
| uv_fs_cb cb) { | ||
| INIT(LCHOWN); | ||
| req->file = file; |
There was a problem hiding this comment.
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 |
| 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.
Can you line all of these arguments up with the uv_loop_t on the previous line.
|
|
||
|
|
||
| int uv_fs_lchown(uv_loop_t* loop, | ||
| uv_fs_t* req, |
There was a problem hiding this comment.
Please line the arguments up.
| 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.
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.
This variable isn't asserted on anywhere.
| uv_fs_req_cleanup(req); | ||
| } | ||
|
|
||
| static void lchown_cb(uv_fs_t* req) { |
|
@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=debian7-docker-armv7/ 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/ https://ci.nodejs.org/job/libuv-test-commit-aix/879/nodes=aix61-ppc64/ https://ci.nodejs.org/job/libuv-test-commit-zos/724/nodes=zos-s390x/ |
cjihrig
left a comment
There was a problem hiding this comment.
I'm not sure if targeting master vs. v1.x is necessary, but LGTM.
|
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 <cjihrig@gmail.com>
|
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 <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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 <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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 <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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 <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
TODO: