Do more testing for the EA/CAP removal on write bug.
[xfstests-dev.git] / 093
diff --git a/093 b/093
index 89b114bd990546784ca687c2c39d1c2e2ca8408a..72397da445fbcd609e79f8f04654975c77d9c7ef 100755 (executable)
--- a/093
+++ b/093
@@ -65,6 +65,11 @@ _testfilter()
     sed -e "s#$testdir#TESTDIR#g"
 }
 
+_filefilter()
+{
+    sed -e "s#$tmp##" -e "s#$file#file#"
+}
+
 # real QA test starts here
 _supported_fs xfs udf
 _supported_os IRIX
@@ -105,13 +110,67 @@ $tmp.append
 echo "ls -P on file"
 ls -P $file | _testfilter
 
+echo "cat file"
+echo "----"
+cat $file
+echo "----"
+
 echo "append to file as user without caps"
 # in particular user doesn't have FSETID or SETFCAP
 $runas -u $uid $tmp.append
 
+echo "cat file"
+echo "----"
+cat $file
+echo "----"
+
+echo "ls -P on file"
+ls -P $file | _testfilter
+
+# try again when it doesn't have the EA
+echo "append to file as user without caps a 2nd time"
+$runas -u $uid $tmp.append
+
 echo "ls -P on file"
 ls -P $file | _testfilter
 
+echo "cat file"
+echo "----"
+cat $file
+echo "----"
+
+echo "only let root write to file"
+chmod 700 $file
+chown root $file 
+
+echo "as non-root try to append to file"
+$runas -u $uid $tmp.append 2>&1 | _filefilter
+
+echo "restore perms on file"
+chmod 777 $file
+
+echo "set a root EA on file"
+attr -R -s test -V testval $file | _filefilter
+
+echo "list EA on file"
+attr -R -l $file | _filefilter
+
+echo "as non-root try to append to file"
+$runas -u $uid $tmp.append 2>&1 | _filefilter
+
+echo "list EA on file"
+attr -R -l $file | _filefilter
+
+chown $uid $file
+chmod ugo+w $testdir
+echo "as non-root call writemod"
+$runas -u $uid src/writemod $file 2>&1 | _filefilter
+
+echo "cat file"
+echo "----"
+cat $file
+echo "----"
+
 # success, all done
 status=0
 exit