[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-tech-kern
Subject:    Re: zero-length symlinks
From:       christos () astron ! com (Christos Zoulas)
Date:       2013-11-06 1:56:36
Message-ID: l5c7kk$3cd$1 () ger ! gmane ! org
[Download RAW message or body]

In article <20131105220754.GB295@snowdrop.l8s.co.uk>,
David Laight  <david@l8s.co.uk> wrote:
>On Sun, Nov 03, 2013 at 04:35:19PM -0800, John Nemeth wrote:
>> 
>>      It has to do with the fact that historically mkdir(2) was
>> actually mkdir(3), it wasn't an atomic syscall and was a sequence
>> of operation performed by a library routine...
>
>Actually I think you'll find that mkdir way always a system call.
>It was directory rename that was done with a series of link and
>unlink system calls.

Nope, on 4.1BSD and I believe SVR1 (please correct me),
it was a setuid binary that did:

	mknod("foo", 040000, 0);
	chown("foo", getuid());
	link("foo", "foo/.");
	link(".", "foo/..");

>Also, if you look at any current fs code the processing of "." and
>".." is special - they will be treated as requests for the current
>and parent directories regardless of the inodes they reference.
>Doing otherwise is a complete locking nightmare!

I think that this also came much later. I believe with 4.4BSD.

christos

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic