Unlinking objects in a directory with sticky bit set

YONETANI Tomokazu qhwt+dfly at les.ath.cx
Sun May 3 21:06:14 PDT 2009


On Sun, May 03, 2009 at 08:27:46PM -0700, Matthew Dillon wrote:
> 
> :The problem is I (as a non-root user) can still rename(2) an object that
> :I do not own, in a sticky directory on HAMMER filesystem.
> :
> :On UFS:
> :# mkdir -m 1777 sticky && touch sticky/ROOT
> :# su -m nobody -c 'cd sticky && mv ROOT R00T && echo HEY'
> :mv: rename ROOT to R00T: Operation not permitted
> :
> :On HAMMER:
> :# mkdir -m 1777 sticky && touch sticky/ROOT
> :# su -m nobody -c 'cd sticky && mv ROOT R00T && echo HEY'
> :HEY
> 
>     test28# su -m nobody -c 'cd sticky && mv ROOT R00T2 && echo HEY'
>     mv: rename ROOT to R00T2: No such file or directory
>     test28#

This is expected, because the original file(ARE OH OH TEE) has been
renamed to (ARE ZERO ZERO TEE).  I guess ZEROs and OHs are not very
distictive on your monitor :)

>     There may be a short cut for renaming a file to itself, which is
>     basically a NOP.  I'll track down the path.
> 
> 					-Matt
> 					Matthew Dillon 
> 					<dillon at backplane.com>





More information about the Bugs mailing list