1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright (C) 2006 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 2, or (at your option)
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
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
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])
41 # Make sure user's umask is honored, even if we are superuser
42 TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
47 genfile --stat=mode:777 directory
52 # Change its permissions ...
54 genfile --stat=mode:777 directory
56 # ... and attempt to restore it twice
58 genfile --stat=mode:777 directory
61 genfile --stat=mode:777 directory
63 # After both restores, the directory mode should be 755