1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
5 # Copyright 2006-2007, 2013-2014 Free Software Foundation, Inc.
7 # This file is part of GNU tar.
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.
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.
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/>.
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
29 # Reported by: Ian Jackson <iwj@ubuntu.com>
31 # References: <17461.519.640947.664400@davenant.relativity.greenend.org.uk>
34 AT_SETUP([mode of extracted directories])
35 AT_KEYWORDS([extract extract06 directory mode])
42 # Make sure user's umask is honored, even if we are superuser
43 TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
48 genfile --stat=mode:777 directory
53 # Change its permissions ...
55 genfile --stat=mode:777 directory
57 # ... and attempt to restore it twice
58 tar xf arc directory --warning=no-timestamp
59 genfile --stat=mode:777 directory
61 tar xf arc directory --warning=no-timestamp
62 genfile --stat=mode:777 directory
64 # After both restores, the directory mode should be 755