summaryrefslogtreecommitdiff
path: root/test/root/restore.test
blob: 6003cd46d4d205aa2e8912c9c2ff3efdb1f11002 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Ensure setuid bit is restored when the owner changes
 https://bugzilla.redhat.com/show_bug.cgi?id=467936#c7

	$ touch passwd
	$ chmod 755 passwd
	$ chmod u+s passwd
	$ getfacl passwd > passwd.acl
	$ cat passwd.acl
	> # file: passwd
	> # owner: root
	> # group: root
	> # flags: s--
	> user::rwx
	> group::r-x
	> other::r-x
	>
	$ chown bin passwd
	$ chmod u+s passwd
	$ setfacl --restore passwd.acl
	$ ls -dl passwd | awk '{print $1 " " $3 " " $4}'
	> -rwsr-xr-x root root

	$ rm passwd passwd.acl