Whamcloud - gitweb
b=22376 sanity test for non-root exec-only file execution
authorElena Gryaznova <elena.gryaznova@oracle.com>
Wed, 8 Dec 2010 20:32:43 +0000 (23:32 +0300)
committerAndrew Perepechko <andrew.perepechko@oracle.com>
Thu, 9 Dec 2010 04:09:06 +0000 (07:09 +0300)
o=Andreas.Dilger
i=grev

lustre/tests/sanity.sh

index f70f88f..027f266 100644 (file)
@@ -1306,12 +1306,30 @@ test_29() {
 }
 run_test 29 "IT_GETATTR regression  ============================"
 
-test_30() {
+test_30a() { # was test_30
        cp `which ls` $DIR
-       $DIR/ls /
+       $DIR/ls / || error
        rm $DIR/ls
 }
-run_test 30 "run binary from Lustre (execve) ==================="
+run_test 30a "execute binary from Lustre (execve) =============="
+
+test_30b() {
+       cp `which ls` $DIR
+       chmod go+rx $DIR/ls
+       $RUNAS $DIR/ls / || error
+       rm $DIR/ls
+}
+run_test 30b "execute binary from Lustre as non-root ==========="
+
+test_30c() { # b=22376
+       cp `which ls` $DIR
+       chmod a-rw $DIR/ls
+       cancel_lru_locks mdc
+       cancel_lru_locks osc
+       $RUNAS $DIR/ls / || error
+       rm -f $DIR/ls
+}
+run_test 30c "execute binary from Lustre without read perms ===="
 
 test_31a() {
        $OPENUNLINK $DIR/f31 $DIR/f31 || error