diff options
author | Ron Yorston <rmy@pobox.com> | 2019-02-25 11:44:19 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-02-25 11:44:19 +0000 |
commit | bf465dd5036d1f3f3fd3812f737579b1f795ca83 (patch) | |
tree | 433fab3d5817c5a0679fa908ebb94f21b49b00c0 /win32 | |
parent | 01f99c063ec92a22d97c339768ec0679a0316315 (diff) | |
download | busybox-w32-bf465dd5036d1f3f3fd3812f737579b1f795ca83.tar.gz busybox-w32-bf465dd5036d1f3f3fd3812f737579b1f795ca83.tar.bz2 busybox-w32-bf465dd5036d1f3f3fd3812f737579b1f795ca83.zip |
win32: fake permissions/ownership for inaccessible files
If stat(2) knows a file exists but can't obtain additional metadata
for it give it root ownership and no permissions for other.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/mingw.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 84522d3ea..378c4001f 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -448,6 +448,11 @@ static int do_lstat(int follow, const char *file_name, struct mingw_stat *buf) | |||
448 | (((ino_t)hdata.nFileIndexHigh)<<32); | 448 | (((ino_t)hdata.nFileIndexHigh)<<32); |
449 | buf->st_nlink = S_ISDIR(buf->st_mode) ? 2 : hdata.nNumberOfLinks; | 449 | buf->st_nlink = S_ISDIR(buf->st_mode) ? 2 : hdata.nNumberOfLinks; |
450 | } | 450 | } |
451 | else { | ||
452 | buf->st_uid = 0; | ||
453 | buf->st_gid = 0; | ||
454 | buf->st_mode &= ~(S_IROTH|S_IWOTH|S_IXOTH); | ||
455 | } | ||
451 | CloseHandle(fh); | 456 | CloseHandle(fh); |
452 | #endif | 457 | #endif |
453 | 458 | ||