aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-02-25 11:44:19 +0000
committerRon Yorston <rmy@pobox.com>2019-02-25 11:44:19 +0000
commitbf465dd5036d1f3f3fd3812f737579b1f795ca83 (patch)
tree433fab3d5817c5a0679fa908ebb94f21b49b00c0 /win32
parent01f99c063ec92a22d97c339768ec0679a0316315 (diff)
downloadbusybox-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.c5
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