LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Sticky-bit (http://www.linuxquestions.org/questions/linux-software-2/sticky-bit-4175437604/)

fakie_flip 11-17-2012 03:46 PM

Sticky-bit
 
If a directory has does not have write permission for both group and others, does setting sticky bit on it affect it at all? How?

frankbell 11-17-2012 09:24 PM

According to this link:

Quote:

If you set the sticky bit to a directory, other users cannot delete or rename the files (or subdirectories) within that directory.

When the sticky bit is set on a directory, only the owner and the root user can delete / rename the files or directories within that directory.
It does not seem to affect permission to write a file to the directory, but I was too lazy to test for it.

fakie_flip 11-19-2012 01:25 PM

I know that much, but it only applies when users who are not the owner of the directory have write permissions. Otherwise, they wouldn't be able to modify anything under that directory anyways that they are not the owner of.

rknichols 11-19-2012 06:04 PM

The owner of the directory is always permitted to delete any file there, so the sticky bit would have no effect if the only write permission for the directory is for the directory owner. If either the "group" or the "other" write permission bit is set, then the sticky bit would prevent someone other than the directory owner from removing a file that they did not own.


All times are GMT -5. The time now is 04:28 PM.