]> Dogcows Code - chaz/tar/commitdiff
tar: avoid assumptions about root access and chmod -w in test cases
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 26 Aug 2010 17:22:44 +0000 (10:22 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 26 Aug 2010 17:23:06 +0000 (10:23 -0700)
* tests/extrac07.at, tests/extrac09.at, tests/listed03.at: Use
AT_UNPRIVILEGED_PREREQ, since this test requires non-root
privileges.
* tests/extrac07.at: Don't use "chmod -w", as POSIX says it's not
portable to start a chmod permissions-list with "-" as it may be
confused with an option.  Use "chmod a-w" instead.

tests/extrac07.at
tests/extrac09.at
tests/listed03.at

index 920175cd211290ffe6f4443e73e6c0a9d7a9f874..d993dc36be0004a946d7cfb97bbeb9601a01e6a5 100644 (file)
@@ -28,13 +28,15 @@ AT_SETUP([extracting symlinks to a read-only dir])
 AT_KEYWORDS([extract extract07 read-only symlink])
 
 AT_TAR_CHECK([
+AT_UNPRIVILEGED_PREREQ
+
 echo Prepare the directory
 mkdir dir
 genfile -f foo
 cd dir
 ln -s ../foo .
 cd ..
-chmod -w dir
+chmod a-w dir
 
 echo Create the archive
 tar cf archive dir || exit 1
index 4506c04df7fc41f5cd1989bce69f314551ffc03a..8241c30a149a5501bc728c86c1795f459280f6a9 100644 (file)
@@ -23,6 +23,8 @@ AT_SETUP([no need to save dir with unreadable . and ..])
 AT_KEYWORDS([extract extrac09])
 
 AT_TAR_CHECK([
+AT_UNPRIVILEGED_PREREQ
+
 mkdir dir
 mkdir dir/sub
 mkdir dir/sub/extract
index 5bf8e5830391eca11a7f9a729ccbe0ca774ff303..f3feda761e7df450d45e9d3f98c401922da7a4b4 100644 (file)
@@ -23,6 +23,8 @@ AT_SETUP([incremental dump when the parent directory is unreadable])
 AT_KEYWORDS([listed incremental listed03])
 
 AT_TAR_CHECK([
+AT_UNPRIVILEGED_PREREQ
+
 mkdir dir
 mkdir dir/sub
 mkdir dir/sub/a
This page took 0.031927 seconds and 4 git commands to generate.