/
githubmirror
/
acl
Обзор
Документация
Войти
/
githubmirror
/
acl
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/root/restore.run
27 строк
590 B
Andreas Gruenbacher
harden setfacl --restore
28 июн 2026, 23:44
28 июн 2026, 23:44
54e14e9
Код
Авторство
О чём код?
Ensure setuid bit is restored when the owner changes https://bugzilla.redhat.com/show_bug.cgi?id=467936#c7 Cry immediately if we are not running as root. $ require_root $ 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 --physical $ ls -dl passwd | awk '{print $1 " " $3 " " $4}' | sed 's/\\.//g' > -rwsr-xr-x root root $ rm passwd passwd.acl