[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: NFS i prawa usera



Piotr Konieczny wrote:
>>> Czy moze chodzi o ustawienie w prawach dostepu do katalogu chmod
>>> bitu lepkosci inaczej sticky bit. W ktores ksiazce przeczytalem,
>>> ze ustawienie tego bitu umozliwia zapis i jednoczesnie uniemozliwia
>>> usuwanie.
>>
>> Jeśli jesteś włąścicielem pliku to i tak możesz go usunąć.
>> Tak jest na przykład z /tmp.
>
> Nie do końca masz rację. Musisz mieć prawa w i x do katalogu, żeby  
> usunąć plik. Wtedy nie musisz być właścicielem pliku aby go usunąć. /tmp 
> jest wyjątkiem gdyż ma 'sticky bit'.

Chodziło mi o podkreślenie, że "sticky bit" nie umożliwia zapisu i
jednocześnie uniemożliwia usuwanie. Umożliwia zapis do katalogu do
którego ma się prawa zapisu (to chyba logiczne i wydawało mi się, że nie
muszę tego podkreślać) jednocześnie uniemożliwia innym usuniecie
utworzonego tam pliku jeśli nie są jego właścielami, nawet jeśli mają
do niego prawo do zapisu jako "group" czy "other".

Zacytuję za man chmod(1):

RESTRICTED DELETION FLAG OR STICKY BIT
       The restricted deletion flag or sticky bit is a single bit, whose
interpretation depends on the file type.  For directories, it prevents
unprivileged  users from  removing  or renaming a file in the directory
unless they own the file or the directory; this is called the restricted
deletion flag for the directory, and is commonly found on world-writable
directories like /tmp. For regular files on some older systems, the bit
saves the program's text image on  the  swap device so it will load more
quickly when run; this is called the sticky bit.

"Sticky bit" dla naszego problemu jest więc bezużyteczny gdyż user
wrzucający pliki jest ich właścicielem.

Pozdrawiam,
Rafał


Reply to: