Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 May 1995 14:19:28 -0700 (PDT)
From:      "Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com>
To:        Bernard.Steiner@Germany.EU.net
Cc:        freebsd-bugs@FreeBSD.org
Subject:   Re: strange symlinks
Message-ID:  <199505092119.OAA05612@gndrsh.aac.dev.com>
In-Reply-To: <199505092047.WAA17816@qwerty.Germany.EU.net> from "Bernard.Steiner@Germany.EU.net" at May 9, 95 10:47:40 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Folks,
> while playing with my FreeBSD 2.0R I came across the following oddity:
> 
> 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.

EEEkkkksss.. this has been around for a long time, it has to do with
the changes in BSD 4.4 on who owns symbolic links, this is part of
the POSIX changes.

Basically all symbolic links have the owner of the directory that holds
them.  Also true for the time stamps.  

Kirk McKusik sent us a patch for his proposal to fix it, and now that
I go back and look at the mail he sent it to just David Greenman and
myself.  I though it had gone to the whole -arch mailling list :-(.

I'll go test this patch out and if it makes things better I will
apply it.

> 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.
> 
> Okay, so that is as per the specs in the PRM (and, thusly, probably POSIX).
> However, it seems sort of stranke, doesn't it ?
> IMHO the mkdir ought to produce a directory /tmp/foo and not fail.
> 
> Third, whatever happened to the fchdir() syscall that I vaguely remember
> having had in (at least) 386BSD0.1 ?
> 
> Thanks,
> 	Bernard
> 


-- 
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?199505092119.OAA05612>