]> Dogcows Code - chaz/tar/blob - tests/ignfail.sh
(max): New macro.
[chaz/tar] / tests / ignfail.sh
1 #! /bin/sh
2 # Unreadable directories yielded error despite --ignore-failed-read.
3
4 . ./preset
5 . $srcdir/before
6
7 > check-uid
8 set - x`ls -l check-uid`
9 if test $3 = root; then
10
11 # The test is meaningless for super-user.
12 rm check-uid
13
14 else
15
16 touch file
17 mkdir directory
18 touch directory/file
19
20 echo 1>&2 -----
21 chmod 000 file
22 tar cf archive file
23 status=$?
24 chmod 600 file
25 test $status = 2 || exit 1
26
27 echo 1>&2 -----
28 chmod 000 file
29 tar cf archive --ignore-failed-read file || exit 1
30 status=$?
31 chmod 600 file
32 test $status = 0 || exit 1
33
34 echo 1>&2 -----
35 chmod 000 directory
36 tar cf archive directory
37 status=$?
38 chmod 700 directory
39 test $status = 2 || exit 1
40
41 echo 1>&2 -----
42 chmod 000 directory
43 tar cf archive --ignore-failed-read directory || exit 1
44 status=$?
45 chmod 700 directory
46 test $status = 0 || exit 1
47
48 err="\
49 -----
50 tar: Cannot add file file: Permission denied
51 tar: Error exit delayed from previous errors
52 -----
53 tar: Cannot add file file: Permission denied
54 -----
55 tar: Cannot add directory directory: Permission denied
56 tar: Error exit delayed from previous errors
57 -----
58 tar: Cannot add directory directory: Permission denied
59 "
60
61 fi
62
63 . $srcdir/after
This page took 0.033637 seconds and 4 git commands to generate.