[Pkg-shadow-commits] r590 - trunk/tests/chsh/01

Nicolas FRANCOIS nekral-guest at costa.debian.org
Tue Oct 11 22:16:30 UTC 2005


Author: nekral-guest
Date: 2005-10-11 22:16:29 +0000 (Tue, 11 Oct 2005)
New Revision: 590

Modified:
   trunk/tests/chsh/01/run
Log:
chsh now requires a password when not run by root.
These tests should be rewritten with expect.


Modified: trunk/tests/chsh/01/run
===================================================================
--- trunk/tests/chsh/01/run	2005-10-11 22:10:04 UTC (rev 589)
+++ trunk/tests/chsh/01/run	2005-10-11 22:16:29 UTC (rev 590)
@@ -62,22 +62,23 @@
 [ "$ent" = "myuser:x:424242:424242::/home:/bin/bash" ] || exit 1
 echo "OK"
 
-echo -n "changing to a restricted shell, by myuser..."
-su myuser -c "chsh -s $(pwd)/tmp/shell" 2> tmp/out && exit 1
-ent=$(getent passwd myuser)
-[ "$ent" = "myuser:x:424242:424242::/home:/bin/bash" ] || exit 1
-grep "/tmp/shell is an invalid shell." tmp/out > /dev/null
-[ $(wc -l tmp/out| cut -d" " -f1) = "1" ] || exit 1
-echo "OK"
+# Need to be done by expect now (chage asks for a passwd if not root)
+#echo -n "changing to a restricted shell, by myuser..."
+#su myuser -c "chsh -s $(pwd)/tmp/shell" 2> tmp/out && exit 1
+#ent=$(getent passwd myuser)
+#[ "$ent" = "myuser:x:424242:424242::/home:/bin/bash" ] || exit 1
+#grep "/tmp/shell is an invalid shell." tmp/out > /dev/null
+#[ $(wc -l tmp/out| cut -d" " -f1) = "1" ] || exit 1
+#echo "OK"
 
-echo -n "changing to a new valid shell, by myuser..."
-echo $(pwd)/tmp/shell >> /tmp/shells
-su myuser -c "chsh -s $(pwd)/tmp/shell" 2> tmp/out && exit 1
-ent=$(getent passwd myuser)
-[ "$ent" = "myuser:x:424242:424242::/home:/bin/bash" ] || exit 1
-grep "/tmp/shell is an invalid shell." tmp/out > /dev/null
-[ $(wc -l tmp/out| cut -d" " -f1) = "1" ] || exit 1
-echo "OK"
+#echo -n "changing to a new valid shell, by myuser..."
+#echo $(pwd)/tmp/shell >> /tmp/shells
+#su myuser -c "chsh -s $(pwd)/tmp/shell" 2> tmp/out && exit 1
+#ent=$(getent passwd myuser)
+#[ "$ent" = "myuser:x:424242:424242::/home:/bin/bash" ] || exit 1
+#grep "/tmp/shell is an invalid shell." tmp/out > /dev/null
+#[ $(wc -l tmp/out| cut -d" " -f1) = "1" ] || exit 1
+#echo "OK"
 
 echo -n "changing another user's shell..."
 su myuser -c "chsh -s /bin/sh myuser2" 2> tmp/out && exit 1
@@ -86,14 +87,14 @@
 diff -au data/chsh2 tmp/out
 echo "OK"
 
-echo -n "changing to a non-executable shell..."
-chmod a-x tmp/shell
-su myuser -c "chsh -s $(pwd)/tmp/shell myuser" 2> tmp/out && exit 1
-ent=$(getent passwd myuser)
-[ "$ent" = "myuser:x:424242:424242::/home:/bin/bash" ] || exit 1
-grep "/tmp/shell is an invalid shell." tmp/out > /dev/null
-[ $(wc -l tmp/out| cut -d" " -f1) = "1" ] || exit 1
-echo "OK"
+#echo -n "changing to a non-executable shell..."
+#chmod a-x tmp/shell
+#su myuser -c "chsh -s $(pwd)/tmp/shell myuser" 2> tmp/out && exit 1
+#ent=$(getent passwd myuser)
+#[ "$ent" = "myuser:x:424242:424242::/home:/bin/bash" ] || exit 1
+#grep "/tmp/shell is an invalid shell." tmp/out > /dev/null
+#[ $(wc -l tmp/out| cut -d" " -f1) = "1" ] || exit 1
+#echo "OK"
 
 echo -n "changing to an invalid shell name..."
 cp /bin/bash tmp/sh:ell




More information about the Pkg-shadow-commits mailing list