Blame test/root/restore.test
|
rpm-build |
0a0c83 |
Ensure setuid bit is restored when the owner changes
|
|
rpm-build |
0a0c83 |
https://bugzilla.redhat.com/show_bug.cgi?id=467936#c7
|
|
rpm-build |
0a0c83 |
|
|
rpm-build |
0a0c83 |
Cry immediately if we are not running as root.
|
|
rpm-build |
0a0c83 |
|
|
rpm-build |
0a0c83 |
$ require_root
|
|
rpm-build |
0a0c83 |
|
|
rpm-build |
0a0c83 |
$ touch passwd
|
|
rpm-build |
0a0c83 |
$ chmod 755 passwd
|
|
rpm-build |
0a0c83 |
$ chmod u+s passwd
|
|
rpm-build |
0a0c83 |
$ getfacl passwd > passwd.acl
|
|
rpm-build |
0a0c83 |
$ cat passwd.acl
|
|
rpm-build |
0a0c83 |
> # file: passwd
|
|
rpm-build |
0a0c83 |
> # owner: root
|
|
rpm-build |
0a0c83 |
> # group: root
|
|
rpm-build |
0a0c83 |
> # flags: s--
|
|
rpm-build |
0a0c83 |
> user::rwx
|
|
rpm-build |
0a0c83 |
> group::r-x
|
|
rpm-build |
0a0c83 |
> other::r-x
|
|
rpm-build |
0a0c83 |
>
|
|
rpm-build |
0a0c83 |
$ chown bin passwd
|
|
rpm-build |
0a0c83 |
$ chmod u+s passwd
|
|
rpm-build |
0a0c83 |
$ setfacl --restore passwd.acl
|
|
rpm-build |
0a0c83 |
$ ls -dl passwd | awk '{print $1 " " $3 " " $4}' | sed 's/\\.//g'
|
|
rpm-build |
0a0c83 |
> -rwsr-xr-x root root
|
|
rpm-build |
0a0c83 |
|
|
rpm-build |
0a0c83 |
$ rm passwd passwd.acl
|