Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 May 1995 18:17:58 -0700 (PDT)
From:      "Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com>
To:        terry@cs.weber.edu (Terry Lambert)
Cc:        Bernard.Steiner@Germany.EU.net, freebsd-bugs@FreeBSD.org
Subject:   Re: strange symlinks
Message-ID:  <199505100117.SAA06009@gndrsh.aac.dev.com>
In-Reply-To: <9505092214.AA19830@cs.weber.edu> from "Terry Lambert" at May 9, 95 04:14:48 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> > Assumption: directory /tmp exits, owned by bin.bin mode 1777
> > then ln -s /tmp/foo /tmp/bar produces symlink /tmp/bar *owned* by bin
> > regardless of who issued the symlink command, and subsequent rm /tmp/bar
> > is refused for non-owner, i.e. any normal user except for bin and root.
> > 
> > This is bogus.
> 
> It's a generic 4.4 problem with making symlinks in the directory entries
> themselves.  Probably when the sticky bit is set, it ought to make the
> old-style links instead.
> 
> > The next one may be a general 4.4 problem...
> > assumption: /tmp/foo does not exist, /tmp/bar is a symlink to /tmp/foo.
> > chdir("/tmp/bar") fails with ENOENT, but at the same time
> > mkdir("/tmp/bar", 0x777) fails with EEXIST.
> 
> I think this is a generic result of the path component item evaluation
> order.  I guess the only thing to say is that "according to the code,
> this is correct behaviour"  8-).
> 
> > Third, whatever happened to the fchdir() syscall that I vaguely remember
> > having had in (at least) 386BSD0.1 ?
> 
> It had *better* still be there!  I've been using it with a couple of
> minor code changes to get about a 15% performance increase out of
> Samba by keeping an open descriptor for the exported file system to
> make all opens relative instead of having to traverse every component
> up to the path on the volume itself.

It should be there, from my 2.0-current system:
gndrsh# locate fchdir
/usr/share/man/man2/fchdir.2

It is a system call.


-- 
Rod Grimes                                      rgrimes@gndrsh.aac.dev.com
Accurate Automation Company                   Custom computers for FreeBSD



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505100117.SAA06009>