DragonFly bugs List (threaded) for 2009-05
Re: Unlinking objects in a directory with sticky bit set
On Sat, May 02, 2009 at 10:53:31AM -0700, Matthew Dillon wrote:
> :On HAMMER filesystem, you can remove an object you do not own even
> :when the directory containing it has sticky bit set:
> Committed as a kernel-layer fix. Please test also, and if it works
> as expected I will cherry-pick it over to 2.2.x as well.
Quoting from sticky(8):
... A file in a sticky directory may only be removed or renamed
by a user if the user has write permission for the directory and the user
is the owner of the file, the owner of the directory, or the super-user.
So rename(2) in a directory with sticky bit set should also be taken care of.
Currently there are three commits to be cherry-picked to 2.2 branch:
The filesystems affected by ee89633d are: ext2fs, hpfs, msdosfs, ntfs,
nwfs, smbfs, udf, ufs, and HAMMER, but I only tested ufs and HAMMER.
And a very silly nit-pick would be that with these commits the return
code is changed from EPERM to EACCES. I can't think of a situation
when that could be a problem, though.