Unlinking objects in a directory with sticky bit set

Matthew Dillon dillon at apollo.backplane.com
Sun May 3 22:40:28 PDT 2009


: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 :)

    Nope!  Ok, you *could* have used something more obvious there :-)

    In anycase, I've tracked it down.   The rename code was not checking
    the sticky bit for the rename target at all, so it happily overwrite
    the file owned by someone else.  It was doing a VDELETE test for the
    rename source (which tests the sticky bit) and a VCREATE test for the
    rename target (which is designed for O_CREAT and doesn't deal with
    rename's file replacement, so it wasn't).  I added a VRENAME and
    NLC_RENAME so I could properly code testing of the rename-target.

    I'll commit a fix in a few minutes once I finish testing it.  

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>





More information about the Bugs mailing list