Bugtraq mailing list archives

Re: pt_chmod


From: Jeff.Smith () dcs warwick ac uk (Jeff Smith)
Date: Sun, 4 Dec 1994 21:31:17 +0000 (GMT)



Fortunately for SVR4 (and probably solaris) systems, the filesystem
always returns an "ENOENT" if the user trys to create a file with zero
length, so the "chown("", uid, gid)" should never succeed.  However, on
  ^^^^^
I take it that you meant 'zero name length' instead of 'zero length', right?
[...]

Yep.  for example: (and /etc/termcap exists...)

$ truss ln -s /etc/termcap ""

From the original V7 paper "The Unix Time-Sharing System" by Ritchie
and Thompson:

".. If a file begins with a slash, the search starts in the root
directory...  As a limiting case, the name "/" refers to the root
itself.  .. The simplest kind of name, for example, \fBalpha\fR,
refers to a file that itself is found in the current directory. As
another limiting case, the null file name refers to the current
directory."

You might therefore expect chown("", uid, gid) to be equivalent to
chown(".", uid, gid) and ln -s /etc/termcap "" to be equivalent to
ln -s /etc/termcap ., on systems that preserve the early semantics.

--
Jeff Smith, Computer Science, Warwick University, Coventry, CV4 7AL, England
jeff () dcs warwick ac uk       phone: +44 203 523485   fax: +44 203 525714



Current thread: