diff options
| author | Brian Feldman <green@FreeBSD.org> | 1999-08-18 00:18:52 +0000 |
|---|---|---|
| committer | Brian Feldman <green@FreeBSD.org> | 1999-08-18 00:18:52 +0000 |
| commit | eb5e5558e972044e99afe83a14f9e1c08576be3a (patch) | |
| tree | ffc2d926f808bd5e394f3cae180efbd20d141825 /bin/test | |
| parent | 944494356b6d870f37091138dc9893773560675d (diff) | |
Notes
Diffstat (limited to 'bin/test')
| -rw-r--r-- | bin/test/test.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/test/test.c b/bin/test/test.c index a4ae0cd7c467..43a26aa219a8 100644 --- a/bin/test/test.c +++ b/bin/test/test.c @@ -12,7 +12,7 @@ #ifndef lint static const char rcsid[] = - "$Id: test.c,v 1.22 1999/08/14 05:38:04 chris Exp $"; + "$Id: test.c,v 1.23 1999/08/16 09:44:09 sheldonh Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -328,7 +328,12 @@ filstat(nm, mode) case FILWR: return access(nm, W_OK) == 0; case FILEX: - return access(nm, X_OK) == 0; + if (access(nm, X_OK) == 0) { + if (getuid() == 0 && (s.st_mode & 0111) == 0) + return 0; + return 1; + } + return 1; case FILEXIST: return access(nm, F_OK) == 0; case FILREG: |
