Subject: kern/803: cpio -p does wrong thing with symlinks
To: None <gnats-admin@NetBSD.ORG>
From: Simon J. Gerraty <sjg@zen.void.oz.au>
List: netbsd-bugs
Date: 02/17/1995 20:05:08
>Number:         803
>Category:       kern
>Synopsis:       when doing cpio -p, directories pointed to by symlinks are stuffed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 17 20:05:03 1995
>Originator:     Simon J. Gerraty
>Organization:
Zen Programming...
>Release:        1.0
>Environment:
	
System: NetBSD zen.void.oz.au 1.0 NetBSD 1.0 (ZEN) #6: Tue Dec 13 09:55:20 EST 1994 root@zen.void.oz.au:/usr/src/sys/arch/i386/compile/ZEN i386

Plus patches 1-6

>Description:

I suspect that this is related to the following
Subject: Re: kern/719: users cannot remove symlinks from /tmp!
Subject: Re: kern/642: lstat() returns wrong inode for symlink?

Basically due to a disk showing faults I did:

cd /var find . -print | cpio -pdum /newvar

Interestingly all directories (even on other filesystems) pointed to
by symlinks under /var had their owner and permissions set to those of
/var (drwxr-xr-x  18 root  wheel  512 Feb 18 00:48 /var) which is not
very good for /var/spool/news,/var/spool/nn,/var/spool/lock etc

I think I'll rip out the 4.4BSD symlink semantics on all my 1.0
systems (as per the patch I submitted earlier).  
I'm yet to see _one_ reason for the behaviour and I've found at least
three different reasons for _not_ having it.

>How-To-Repeat:
	
>Fix:
	
>Audit-Trail:
>Unformatted: