aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-22 22:33:08 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-23 04:44:38 +1000
commit8261931d1b3ed1a5efec057f623738388f4ed39e (patch)
tree12ed9812b48f917bf5aac0b72b6c9cb97342c8fc
parentd20aaa26a9aff415552e7bb30560d614ae21cd2b (diff)
downloadbusybox-w32-8261931d1b3ed1a5efec057f623738388f4ed39e.tar.gz
busybox-w32-8261931d1b3ed1a5efec057f623738388f4ed39e.tar.bz2
busybox-w32-8261931d1b3ed1a5efec057f623738388f4ed39e.zip
coreutils/test: fix wrong "test -rwx"
-rw-r--r--coreutils/test.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/coreutils/test.c b/coreutils/test.c
index f9b872f1d..0a020314e 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -563,6 +563,7 @@ static int test_eaccess(char *path, int mode)
563 if (stat(path, &st) < 0) 563 if (stat(path, &st) < 0)
564 return -1; 564 return -1;
565 565
566#ifndef __MINGW32__
566 if (euid == 0) { 567 if (euid == 0) {
567 /* Root can read or write any file. */ 568 /* Root can read or write any file. */
568 if (mode != X_OK) 569 if (mode != X_OK)
@@ -578,6 +579,9 @@ static int test_eaccess(char *path, int mode)
578 mode <<= 6; 579 mode <<= 6;
579 else if (is_a_group_member(st.st_gid)) 580 else if (is_a_group_member(st.st_gid))
580 mode <<= 3; 581 mode <<= 3;
582#else
583 mode <<= 6; /* owner */
584#endif
581 585
582 if (st.st_mode & mode) 586 if (st.st_mode & mode)
583 return 0; 587 return 0;