aboutsummaryrefslogtreecommitdiff
path: root/bin/test
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1994-11-05 20:24:49 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1994-11-05 20:24:49 +0000
commit20662469d56b27ce7a59acbc9f7ef907cd16aaf2 (patch)
treed60f854f1ecd354fa65a99ca0f319e6874e7076a /bin/test
parent692a99c012514f7d592c8e60b66d9203e0a7a93d (diff)
downloadsrc-20662469d56b27ce7a59acbc9f7ef907cd16aaf2.tar.gz
src-20662469d56b27ce7a59acbc9f7ef907cd16aaf2.zip
Fix root -w case according to manpage (-x & -r cases already accords)
Pointed by Bruce.
Notes
Notes: svn path=/head/; revision=4170
Diffstat (limited to 'bin/test')
-rw-r--r--bin/test/test.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/test/test.c b/bin/test/test.c
index 3218a42a47e1..a7785ac4ad6b 100644
--- a/bin/test/test.c
+++ b/bin/test/test.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: test.c,v 1.6 1994/11/05 17:28:03 ache Exp $
+ * $Id: test.c,v 1.7 1994/11/05 17:31:23 ache Exp $
*/
#ifndef lint
@@ -347,9 +347,12 @@ exist:
i = S_IROTH;
goto permission;
case ISWRITE:
- if (geteuid() == 0)
- goto exist;
- i = S_IWOTH;
+ if (geteuid() != 0)
+ i = S_IWOTH;
+ else {
+ i = S_IWOTH|S_IWGRP|S_IWUSR;
+ goto filebit;
+ }
goto permission;
case ISEXEC:
if (geteuid() != 0) {