tar acl support has strange behavior when used with --xattr

Bug #1386237 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tar (Ubuntu)
New
Medium
Unassigned

Bug Description

as discovered in bug 1382632 (http://launchpad.net/bugs/1382632), tar's --acl has unexpected behaviors.
The one that caught us there was that extracting a tar file with '--acl' that was created without '--acl' results in default acl being set on the top level extracted directory. One would expect that if the source tar file had no acl information that the extracted directory would have no 'default' acl.

I'll attach a script here that shows behavior of multiple combinations of:
  tar -c [--acl / -no-acl / default]
  tar -x [--acl / --no-acl / default ]
and source directories with acl, without acl and with default "default" acl.

Related Bugs:
 * bug 1382632: horizon insecure key file permissions
 * bug 1386237: tar strange behavior with --acl
 * bug 1313550: ping broken (xattrs lost in tar extraction)

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: tar 1.27.1-2
ProcVersionSignature: Ubuntu 3.16.0-23.31-generic 3.16.4
Uname: Linux 3.16.0-23-generic x86_64
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Oct 27 09:42:03 2014
EcryptfsInUse: Yes
InstallationDate: Installed on 2011-10-19 (1104 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
SourcePackage: tar
UpgradeStatus: Upgraded to utopic on 2013-05-20 (525 days ago)

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

heres output of a run of 'tmp-acl-bavior':

description: updated
Revision history for this message
Scott Moser (smoser) wrote :

Just to demonstrate a particularly odd behavior:
#!/bin/bash
set -e; set -o pipefail
tmpd=$(mktemp -d)
trap "rm -Rf "$tmpd"" EXIT

cd $tmpd; mkdir defaults ex
setfacl --default --modify u::rwx --modify g::r-x --modify other::r-x defaults
setfacl --remove-default ex

xattr_args="--xattrs --xattrs-include=*"
( set -x; tar $xattr_args --no-acl -cpf - defaults | tar -C ex $xattr_args --no-acl -xpf - )

for d in defaults ex/defaults; do
   echo === $d ===
   echo " == getfacl $d =="; getfacl $d | sed 's,^, ,'
   echo " == ls -l $d ==" ; ls -l "$d" | sed 's,^, ,'
   echo " == ls -ld $d ==" ; ls -ld "$d" | sed 's,^, ,'
   echo
done

## end script / begin output ##
+ tar --xattrs '--xattrs-include=*' --no-acl -cpf - defaults
+ tar -C ex --xattrs '--xattrs-include=*' --no-acl -xpf -
=== defaults ===
 == getfacl defaults ==
 # file: defaults
 # owner: smoser
 # group: smoser
 user::rwx
 group::rwx
 other::r-x
 default:user::rwx
 default:group::r-x
 default:other::r-x

 == ls -l defaults ==
 total 0
 == ls -ld defaults ==
 drwxrwxr-x+ 2 smoser smoser 4096 Oct 27 11:18 defaults

=== ex/defaults ===
 == getfacl ex/defaults ==
 # file: ex/defaults
 # owner: smoser
 # group: smoser
 user::rwx
 group::rwx
 other::r-x
 default:user::rwx
 default:group::r-x
 default:other::r-x

 == ls -l ex/defaults ==
 total 0
 == ls -ld ex/defaults ==
 drwxrwxr-x+ 2 smoser smoser 4096 Oct 27 11:18 ex/defaults

summary: - tar acl support has strange behaviors
+ tar acl support has strange behavior when used with --xattr
Mathew Hodson (mhodson)
Changed in tar (Ubuntu):
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.