[BSD] chmod kerdes

Nagy László Zsolt nagylzs at freemail.hu
2004. Okt. 21., Cs, 11:01:09 CEST


  Sziasztok!

A chmod manualja ezt tartalmazza:

MODES
     Modes may be absolute or symbolic.  An absolute mode is an octal number
     constructed from the sum of one or more of the following values:

           4000    (the setuid bit).  Executable files with this bit set 
will
                   run with effective uid set to the uid of the file owner.
                   Directories with this bit set will force all files 
and sub-
                   directories created in them to be owned by the directory
                   owner and not by the uid of the creating process, if the
                   underlying file system supports this feature: see 
chmod(2)
                   and the suiddir option to mount(8).
           2000    (the setgid bit).  Executable files with this bit set 
will
                   run with effective gid set to the gid of the file owner.
           1000    (the sticky bit).  See chmod(2) and sticky(8).
           0400    Allow read by owner.
           0200    Allow write by owner.
           0100    For files, allow execution by owner.  For directories,
                   allow the owner to search in the directory.

és így tovább...

Ezzel szemben, ha midnight commander-ből chmod-olom a /tmp könyvtárat, 
akkor ezt látom:

Name: tmp
Permissions (Octal): 41777
Owner name: root
Group name: wheel

Kérdéseim:

- Mi az a 40000 az elején?
- Miért nincs dokumentálva? Ha mégis van, akkor hol? (És a chmod-nál 
miért nincs?)

A kérdés azért merült föl, mert a php.ini-ben a /tmp volt beállítva file 
feltöltési könyvtárnak; és ezzel a beállítással az esetek 50%-ban 
működött a file feltöltés.
Utána csináltam egy másik könyvtárat aminek www a tulajdonosa, és most 
már teljesen megbízhatóan megy. Az egyetlen különbség amit találtam az új
temporális könyvtár és a /tmp között az a jogokban van. Az enyém így néz ki:

messias# cd /var/www
messias# ls -l
total 2
drwxrwx---  2 www  www  512 Oct 21 10:49 tmp
messias#

A /tmp pedig így:

messias# cd /
messias# ls -l | grep tmp
drwxrwxrwt  10 root  wheel  2048 Oct 21 10:59 tmp
messias#

Gondolom a 't' betű a sticky bit-et jelenti, ami könyvtár esetén azt 
jelenti, hogy append only, nem lehet belőle törölni.
Ezt sem értem, ennek mi értelme?
A másik (fontosabb) kérdés: hol van a rejtélyes 40000 és mit csinál?

Üdv,

   Laci 2.0





További információk a(z) BSD levelezőlistáról