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

Re: Forcing file/directory properties

=>I know there is a way to force files to take on the 
=>properties/permissions of the directory in which it lives, but I can't 
=>remember how to do it, and can't find my notes.  I presume it's done 
=>with chmod, but the man page for chmod is totally opaque to me.

Files which you own can only be deleted by you if the directory that you 
created it in has the sticky bit set. The most frequent example of that is 

drwxrwxrwt  11 root root 4096 Sep 20 12:59 /tmp

Also, from the stat(2) page:

The set GID bit (S_ISGID) has several special uses: For a directory it 
indicates that BSD semantics is to be used for that directory: files 
created there inherit their group ID from the directory, not from the 
effective gid of the creating process, and directories created there will 
also get the S_ISGID bit set.  For a file that does not have the group 
execution bit (S_IXGRP) set, it indicates mandatory file/record locking.

The only other attributes that there are on a file besides protection mask 
is owner and group. Between UPG (User Private Groups), setgid on a 
directory, and proper management of umask, you should be able to 
accomplish whatever you want.

Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net

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