Add basic suuport for extended attributes.
[tar.git] / tests / extrac06.at
blob35cb221f36feaf04c3568f91ec39373fc97268a2
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright (C) 2006, 2007 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
9 # any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
21 # The bug occurs when extracting from a tarfile a directory when the directory
22 # already exists and the version in the tarfile has more permissive
23 # permissions than your umask.  In this case, the permissions of the
24 # existing directory will toggle between the version which complies with
25 # your umask (which would be correct, without -p) and the version from the
26 # tarfile.
28 # Reported by: Ian Jackson <iwj@ubuntu.com>
30 # References: <17461.519.640947.664400@davenant.relativity.greenend.org.uk>
33 AT_SETUP([mode of extracted directories])
34 AT_KEYWORDS([extract extract06 directory mode])
36 AT_TAR_CHECK([
38 # Force umask
39 umask 022
41 # Make sure user's umask is honored, even if we are superuser
42 TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
44 # Create a directory
45 mkdir directory
46 chmod 777 directory
47 genfile --stat=mode:777 directory
49 # Archive it
50 tar cf arc directory
52 # Change its permissions ...
53 chmod 755 directory
54 genfile --stat=mode:777 directory
56 # ... and attempt to restore it twice
57 tar xf arc directory --warning=no-timestamp
58 genfile --stat=mode:777 directory
60 tar xf arc directory --warning=no-timestamp
61 genfile --stat=mode:777 directory
63 # After both restores, the directory mode should be 755
65 [0],
66 [777
67 755
68 755
69 755
72 AT_CLEANUP