Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 May 1995 22:47:40 +0200
From:      Bernard.Steiner@Germany.EU.net
To:        freebsd-bugs@FreeBSD.org
Subject:   strange symlinks
Message-ID:  <199505092047.WAA17816@qwerty.Germany.EU.net>

next 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.

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



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