Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs/tmpfs chown the workdir to unpriv user instead of c...



details:   https://anonhg.NetBSD.org/src/rev/ebcfa6669577
branches:  trunk
changeset: 762896:ebcfa6669577
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sat Mar 05 07:41:11 2011 +0000

description:
chown the workdir to unpriv user instead of chmod 711.  Otherwise,
if your (root's) login shell is {t,}csh, su -m gets outoutsmarted.

diffstat:

 tests/fs/tmpfs/t_create.sh |  7 +++----
 tests/fs/tmpfs/t_mkdir.sh  |  7 +++----
 2 files changed, 6 insertions(+), 8 deletions(-)

diffs (54 lines):

diff -r 00ca01327e0b -r ebcfa6669577 tests/fs/tmpfs/t_create.sh
--- a/tests/fs/tmpfs/t_create.sh        Sat Mar 05 06:39:55 2011 +0000
+++ b/tests/fs/tmpfs/t_create.sh        Sat Mar 05 07:41:11 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_create.sh,v 1.7 2010/11/09 13:01:33 jmmv Exp $
+# $NetBSD: t_create.sh,v 1.8 2011/03/05 07:41:11 pooka Exp $
 #
 # Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -52,8 +52,9 @@
        atf_set "require.user" "root"
 }
 attrs_body() {
+       user=$(atf_config_get unprivileged-user)
        # Allow the unprivileged user to access the work directory.
-       chmod 711 .
+       chown ${user} .
 
        test_mount
 
@@ -70,8 +71,6 @@
        test ${st_gid} -eq ${dst_gid} || atf_fail "Incorrect gid"
        test ${st_mode} = 0100644 || atf_fail "Incorrect mode"
 
-       user=$(atf_config_get unprivileged-user)
-
        atf_check -s eq:0 -o empty -e empty mkdir b c
 
        atf_check -s eq:0 -o empty -e empty chown ${user}:0 b
diff -r 00ca01327e0b -r ebcfa6669577 tests/fs/tmpfs/t_mkdir.sh
--- a/tests/fs/tmpfs/t_mkdir.sh Sat Mar 05 06:39:55 2011 +0000
+++ b/tests/fs/tmpfs/t_mkdir.sh Sat Mar 05 07:41:11 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_mkdir.sh,v 1.7 2010/11/08 15:25:50 pooka Exp $
+# $NetBSD: t_mkdir.sh,v 1.8 2011/03/05 07:41:11 pooka Exp $
 #
 # Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -92,13 +92,12 @@
        atf_set "require.user" "root"
 }
 attrs_body() {
+       user=$(atf_config_get unprivileged-user)
        # Allow the unprivileged user to access the work directory.
-       chmod 711 .
+       chown ${user} .
 
        test_mount
 
-       user=$(atf_config_get unprivileged-user)
-
        atf_check -s eq:0 -o empty -e empty mkdir b c
 
        atf_check -s eq:0 -o empty -e empty chown ${user}:0 b



Home | Main Index | Thread Index | Old Index