1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright (C) 2011 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)
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, see <http://www.gnu.org/licenses/>.
21 # This is basic test for support of extended attributes.
23 AT_SETUP([acls/selinux: special files & fifos])
24 AT_KEYWORDS([xattrs selinux acls selacls01])
28 AT_XATTRS_UTILS_PREREQ
34 MAJOR=$( stat /dev/urandom --printf="%t" )
35 MINOR=$( stat /dev/urandom --printf="%T" )
36 mknod dir/chartype c $MAJOR $MINOR
39 chcon -h --user=system_u dir/fifo
40 chcon -h --user=system_u dir/chartype
41 setfacl -m u:$UID:--- dir/fifo
42 setfacl -m u:$UID:rwx dir/chartype
44 getfacl dir/fifo >> before
45 getfattr -msecurity.selinux dir/chartype >> before
47 tar --xattrs --selinux --acls -cf archive.tar dir
51 tar --xattrs --selinux --acls -xf archive.tar
53 getfacl dir/fifo >> after
54 getfattr -msecurity.selinux dir/chartype >> after