Portál AbcLinuxu, 12. května 2025 18:35

Dotaz: SUID

27.12.2008 20:59 WGA
SUID
Přečteno: 329×
Odpovědět | Admin

Dobry den, neni mi jasne nastavovani SUID bitu, pro priklad:

[user@NB a]$ whoami
user
[user@NB a]$ ls -l
total 544
-rwxrwxrwx 1 root root 549188 2008-12-27 20:43 bash
[user@NB a]$ ./bash
[user@NB a]$ exit
[user@NB a]$ sudo chmod 4777 bash
[user@NB a]$ ls -l
total 544
-rwsrwxrwx 1 root root 549188 2008-12-27 20:43 bash
[user@NB a]$ ./bash
bash-3.2$ whoami
user
bash-3.2$ exit
 

 

Jsem tedy uzivatel user a ve slozce mam kopii programu bash, ktera je vlastnena rootem. bash spustim, prompt je stale stejny a stiskem CTRL+D se zase odhlasim. Pote souboru nastavim suid bit a soubor znovu spustim. Zmenil se prompt (nevite proc?) ale stale jsem uzivatel user a nemam rootovska prava. Muzete mi to prosim nekdo objasnit?

Nástroje: Začni sledovat (2) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

Fuky avatar 27.12.2008 23:13 Fuky | skóre: 52 | blog: 4u
Rozbalit Rozbalit vše Re: SUID
Odpovědět | | Sbalit | Link | Blokovat | Admin
C wrapper + SUID
-- RÁMO: psí tábor , ETriatlon: Výuka plavání
Fuky avatar 27.12.2008 23:30 Fuky | skóre: 52 | blog: 4u
Rozbalit Rozbalit vše Re: SUID

Jinak více v manuálové stránce Bashe:

-p Turn on privileged mode. In this mode, the $ENV and $BASH_ENV files are not processed, shell functions are not inherited from the environment, and the SHELLOPTS variable, if it appears in the environment, is ignored. If the shell is started with the effective user (group) id not equal to the real user (group) id, and the -p option is not supplied, these actions are taken and the effective user id is set to the real user id. If the -p option is supplied at startup, the effective user id is not reset. Turning this option off causes the effective user and group ids to be set to the real user and group ids.

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.