Skip to content

Commit

Permalink
use xattrs, acl and selinux if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lange committed May 20, 2015
1 parent 1c2a341 commit 6a0944b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bin/ftar
Expand Up @@ -54,7 +54,7 @@ extract() {
fi

echo "ftar: extracting $file to $target/$dir" | tr -s '/'
$catname $file | tar --numeric-owner -C $target/$dir $vflag -xf -
$catname $file | tar $xattrs --numeric-owner -C $target/$dir $vflag -xf -
tardone=1
# if option -1 is set, only one class will be used
[ $single -eq 1 ] && exit 0
Expand Down Expand Up @@ -109,6 +109,15 @@ done
shift $(($OPTIND - 1))

[ "$1" ] || usage

# check if tar has xattrs support
tar --xattrs -cf /dev/null /dev/null 2>/dev/null 1>/dev/null
if [ $? -eq 0 ]; then
xattrs="--xattrs --selinux --acl"
else
xattrs=
fi

[ -f $ENV{LOGDIR}/FAI_CLASSES ] && classes=$(< $ENV{LOGDIR}/FAI_CLASSES)
# last class has highest priority

Expand Down

0 comments on commit 6a0944b

Please sign in to comment.