Subject: Re: kern/576: can't remove symlink created on the directory with sticky bit
To: None <netbsd-bugs@NetBSD.ORG>
From: Masaru Oki <oki@fs.telcom.oki.co.jp>
List: netbsd-bugs
Date: 11/18/1994 13:31:18
>>>>> On Wed, 16 Nov 94 13:06:03 JST,
 oki@fs.telcom.oki.co.jp (Masaru Oki) said:

>> maybe, yet another fix:
[stuff deleted]

sorry, wrong changes in above changes.

but...

in ufs_lookup(),

		/*
		 * If directory is "sticky", then user must own
		 * the directory, or the file in it, else she
		 * may not delete it (unless she's root). This
		 * implements append-only directories.
		 */
		if ((dp->i_mode & ISVTX) &&
		    cred->cr_uid != 0 &&
		    cred->cr_uid != dp->i_uid &&
		    VTOI(tdp)->i_uid != cred->cr_uid) {
		    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

why always compare?
symbolic links don't have owners, so symbolic links
don't have uid (see chown(8).) but then, symbolic links' uid
could be referenced in above conditional clause.

Masaru Oki