SEND-PR: -*- send-pr -*-
SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
SEND-PR: will all comments (text enclosed in `<' and `>').
SEND-PR: 
SEND-PR: Please consult the send-pr man page `send-pr(1)' or the Texinfo
SEND-PR: manual if you are not sure how to fill out a problem report.
SEND-PR:
SEND-PR: Note that the Synopsis field is mandatory.  The Subject (for
SEND-PR: the mail) will be made the same as Synopsis unless explicitly
SEND-PR: changed.
SEND-PR:
SEND-PR: Choose from the following categories:
SEND-PR:
SEND-PR: bin   conf  docs  gnu   i386  kern  misc  ports 
SEND-PR:
To: FreeBSD-gnats-submit@freebsd.org
Reply-To: jhs@
cc:	gj_ERASE@freebsd.org
Subject: vipw deletes symbolic link/etc/master.passwd & creates unwanted file
From: jhs@_ERASE_freebsd.org
Reply-To: jhs
X-send-pr-version: 3.2


>Submitter-Id:   current-users
>Originator:     Julian H. Stacey jhs@
>Organization:   FreeBSD
>Confidential:   no
>Synopsis:       vipw deletes symbolic link /etc/master.passwd & creates unwanted file
>Severity:       non-critical
>Priority:       low
>Category:       bin
>Release:        FreeBSD 2.2.5-RELEASE i386 & 2.2.2
>Class:          sw-bug
>Environment: 

	On 2.2.2 & 2.2.5 Releases ....
	How I came across this problem:
	  I am runnning multiple systems here, all sharing common etc files,
	  such as hosts & disktab etc, auto updated via rdist,
	  all my users have common site wide directories, regardless of
	  host, via use of /site/home/user_name.
	  (Having not learnt YP yet) I decided to include /etc/master.passwd
	   in my list of site wide common files with a symbolic link
		cd /etc ; ln -s ../site/etc/master.passwd master.passwd
	  (Yup I know the pwd file won't get updated on all hosts immediately)
	Yo do not need multiple machines to see this problem though,
	a single system is enough.

>Description: 

	vipw should, just like vi & other programs that open a name,
	not {trash the existing sym link & create a new file}
	but {use the symbolic link}

>How-To-Repeat: 

	su
	cd /etc
	ls -l master.passwd		# see a file
	mkdir -p /site/etc
	mv master.passwd /site/etc/master.passwd
	ln -s ../site/etc/master.passwd master.passwd	\
	ls -l master.passwd		# see a sym link
	vipw
		do some change
	ls -l master.passwd		# see a file ... the sym link is lost

>Fix: 
	I have looked at
		rel.2.2.5/src/usr.sbin/vipw/pw_util.c line 114
	but not tried changing it yet, maybe later,
	unless someone makes a case that this weird behaviour
	thet I don't like is somehow a security feature & not a bug ?


