]> Dogcows Code - chaz/tar/blob - tests/extrac06.at
Options to control option handling in file lists.
[chaz/tar] / tests / extrac06.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4
5 # Copyright 2006-2007, 2013-2014 Free Software Foundation, Inc.
6
7 # This file is part of GNU tar.
8
9 # GNU tar is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
13
14 # GNU tar is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 # The bug occurs when extracting from a tarfile a directory when the directory
23 # already exists and the version in the tarfile has more permissive
24 # permissions than your umask. In this case, the permissions of the
25 # existing directory will toggle between the version which complies with
26 # your umask (which would be correct, without -p) and the version from the
27 # tarfile.
28 #
29 # Reported by: Ian Jackson <iwj@ubuntu.com>
30 #
31 # References: <17461.519.640947.664400@davenant.relativity.greenend.org.uk>
32 #
33
34 AT_SETUP([mode of extracted directories])
35 AT_KEYWORDS([extract extract06 directory mode])
36
37 AT_TAR_CHECK([
38
39 # Force umask
40 umask 022
41
42 # Make sure user's umask is honored, even if we are superuser
43 TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
44
45 # Create a directory
46 mkdir directory
47 chmod 777 directory
48 genfile --stat=mode:777 directory
49
50 # Archive it
51 tar cf arc directory
52
53 # Change its permissions ...
54 chmod 755 directory
55 genfile --stat=mode:777 directory
56
57 # ... and attempt to restore it twice
58 tar xf arc directory --warning=no-timestamp
59 genfile --stat=mode:777 directory
60
61 tar xf arc directory --warning=no-timestamp
62 genfile --stat=mode:777 directory
63
64 # After both restores, the directory mode should be 755
65 ],
66 [0],
67 [777
68 755
69 755
70 755
71 ])
72
73 AT_CLEANUP
This page took 0.037667 seconds and 5 git commands to generate.