DragonFly bugs List (threaded) for 2009-05
DragonFly BSD
DragonFly bugs List (threaded) for 2009-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Unlinking objects in a directory with sticky bit set


From: YONETANI Tomokazu <qhwt+dfly@xxxxxxxxxx>
Date: Sun, 3 May 2009 22:55:58 +0900

On Sat, May 02, 2009 at 10:53:31AM -0700, Matthew Dillon wrote:
> :Hi.
> :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:
  918101d3be679a76c85ea8f47b94e05f8eb11ee5
  ee89633d5330733056052c06919a5dd4c01347bc
  dae8d54f0708cf191cbb06ef6aa43cd570ceea90

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.



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