-# This program is free software; you can redistribute it and/or modify
+# Copyright 2006-2007, 2013-2014 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The bug occurs when extracting from a tarfile a directory when the directory
# already exists and the version in the tarfile has more permissive
# permissions than your umask. In this case, the permissions of the
# existing directory will toggle between the version which complies with
# your umask (which would be correct, without -p) and the version from the
# The bug occurs when extracting from a tarfile a directory when the directory
# already exists and the version in the tarfile has more permissive
# permissions than your umask. In this case, the permissions of the
# existing directory will toggle between the version which complies with
# your umask (which would be correct, without -p) and the version from the
# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
genfile --stat=mode:777 directory
# After both restores, the directory mode should be 755
genfile --stat=mode:777 directory
# After both restores, the directory mode should be 755