[kwlug-disc] Access rights to file/folder

John Van Ostrand john at netdirect.ca
Thu Jul 29 10:35:29 EDT 2010


----- Original Message -----
> On 29/07/2010 8:07 AM, Rashkae wrote:
> > How does that even work? Sticky bit, as far as I know, prevents Bob
> > from
> > deleting files he does not have write permission to, (even though he
> > has
> > write permission to the directory.) In Linux, the sticky bit does
> > not
> > inherit group ownership to new files.
> 
> The sticky bit works differently on files than on directories. As I
> recall, it works as you describe when set on files, and as John
> described (causing new files in the directory to inherit permissions)
> when set on directories.

I mis-wrote. The sticky bit 't' is used on a directory to prevent a user from deleting a file owned by someone else, even if the directory has a 'w'rite permission for that that user. You can see this on /tmp where you don't want another user to delete your temporary file and replace it with something nefarious.

The sticky bit on an executable tells the kernel to keep the executable (or in proper terms, the 't'ext area of a program) in swap for easy access. I don't think this is honoured any more (if it ever was by Linux). It was a performance enhancement on older Unixes and used on frequently run programs. The shell executable was a common one with this bit set since the shell is executed and re-executed a lot by users and scripts.

The sticky bit is often confused with the 's' permissions (as apparently I even did) because it begins with 's'.

If you see a capital 'T' instead of a lower case 't' it just means that file/dir doesn't have the 'x' permission.

-- 
John Van Ostrand 
CTO, co-CEO 
Net Direct Inc. 
564 Weber St. N. Unit 12, Waterloo, ON N2L 5C6 
Ph: 866-883-1172 x5102 
Fx: 519-883-8533 

Linux Solutions / IBM Hardware 





More information about the kwlug-disc mailing list