[comp.bugs.sys5] Strange problem with root directories

jfh@killer.UUCP (The Beach Bum) (09/10/87)

Okay, strange new bug (actually, _very_ old bug) occured to me last night
while ruminating on the lost+found bug.

Here is how you get this bizarre baby to show up.

# cd /
# /etc/link . a.
# cd a.

You tell me what is weird about that.  So far it exists as far back as
my Version 7 system at home.  The 5.2 machine at work even has it ...

This works in the root directory of any device/partition.  The test that
causes the bug in namei(sys/nami.c) seems to be NOT testing u.u_dent.d_name[0]
for equality with `.', only u.u_dent.d_name[1] is checked!

Oh, and the fix I posted earlier for the lost+found bug was wrong ...
AFTER comparing u.u_dbuf[i] == u.u_dent.d_name[i], test for u.u_dent.d_name[i]
for '\0', not before.  (Doing it before causes early termination, so that
/. gets found instead of /.profile.)  That was yet-another interesting
problem ...
-- 
John F. Haugh II		HECI Exploration Co. Inc.
UUCP:	...!ihnp4!killer!jfh	11910 Greenville Ave, Suite 600
"Don't Have an Oil Well?"	Dallas, TX. 75243
" ... Then Buy One!"		(214) 231-0993

eric@ms.uky.edu (Eric Herrin) (09/11/87)

>Okay, strange new bug (actually, _very_ old bug) occured to me last night
>while ruminating on the lost+found bug.
>
>Here is how you get this bizarre baby to show up.
>
># cd /
># /etc/link . a.
># cd a.
>
>You tell me what is weird about that.  So far it exists as far back as
>my Version 7 system at home.  The 5.2 machine at work even has it ...

>This works in the root directory of any device/partition.  The test that
>causes the bug in namei(sys/nami.c) seems to be NOT testing u.u_dent.d_name[0]
>for equality with `.', only u.u_dent.d_name[1] is checked!
>

I see nothing weird here.... This works in any directory on my SVR3.1 machine.
Maybe it's supposed to crash or something??  Maybe you think it shouldn't
work at all?  I think it should work, after all, '.' is a directory link,
and /etc/link links directories.  'a.' with your example works just fine and
is a link to /.  /etc/unlink unlinks the link, just like it's supposed to.
Could you explain yourself a little better?


				thanks,
				eric