Subject: bin/5264: pkg_delete dumps core if $PREFIX=""
To: None <gnats-bugs@gnats.netbsd.org>
From: Charlie Root <root@polaris.garbled.net>
List: netbsd-bugs
Date: 04/08/1998 05:13:52
>Number:         5264
>Category:       bin
>Synopsis:       pkg_delete dumps core if $PREFIX=""
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr  8 05:20:01 1998
>Last-Modified:
>Originator:     Charlie Root
>Organization:
Tim Rightnour    -  root@garbled.net
http://www.zynetwc.com/~garbled/garbled.html
>Release:        1.3<NetBSD-current source date>
>Environment:
	
System: NetBSD polaris 1.3 NetBSD 1.3 (POLARIS) #0: Thu Mar 26 13:17:18 MST 1998 root@polaris:/usr/src/sys/arch/i386/compile/POLARIS i386


>Description:
If you set PREFIX="", install a package, and then try to pkg_delete it.. 
pkg_delete dumps core instantly.  Obviously PREFIX="" is completely 
bogus, but the program definately shouldn't respond in such a violent 
manner.  The program is attempting to change directory to "" and dying.

	
>How-To-Repeat:
Install a package with PREFIX="" and pkg_delete it.

	
>Fix:
Make pkg_delete sanity check before it does a chdir, print a warning 
message and exit.. rather than abrubtly exploding on the user.  Perhaps 
assuming / instead of NULL would be better, and still allow pkg_delete to 
do it's job.

	
>Audit-Trail:
>Unformatted: