Re: why can I write to a file I don't have permission to??

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

 



On April 14, 2005 07:55 pm, David.Knight@xxxxxxxxxxxx wrote:
> On April 14, 2005 02:56 pm, David.Knight@xxxxxxxxxxxx wrote:
> > RedHat List,
> >         I was working on a script the other day and ran into
> > an anomaly with the file permission's on files. I have
> > checked this on several ES servers and all produce the same
> > results.

As Tobias pointed out, you can get the behaviour you want 
(almost) by setting the sticky bit on the directory; man chmod.

Note that the man page is slightly wrong unclear.  With the 
sticky bit on the directory the file may be deleted by either 
the file's owner or the directory's owner.  In your case it 
won't help because the user is the directory owner and so can 
remove the file.  Compare that to /tmp where root is the 
directory owner and the directory has the sticky bit set, so the 
non-root user won't be able to delete root's files (or anyone 
else's)

References:
- W. Richard Stevens' "Advanced Programming in the Unix 
Environment" (generally accepted as quite authoritative), 
sections 4.5 and 4.10
- Single Unix Specification V3 - General Concepts - Directory 
Protection

-- 
Bill Medland
mailto:billmedland@xxxxxxxxxxxxxxxx
http://webhome.idirect.com/~kbmed

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux