Bug 16015

Summary: Obscure error message in pkg_delete
Product: Base System Reporter: spidey <spidey>
Component: binAssignee: Sheldon Hearn <sheldonh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.4-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description spidey 2000-01-09 21:30:02 UTC
	pkg_delete gives a very strange error message that is too hard
	to understand. It should be changed to something more descriptive.

Fix: Suggested patch:
How-To-Repeat: 
	The guilty code is the following in /usr/src/usr.sbin/pkg_install/delete/perform.c

    if (chdir(home) == FAIL) {
	cleanup(0);
	errx(2, "Toto! This doesn't look like Kansas anymore!");
    }

From what I understand, it tries to chdir to the 'home' and exits if
it can't. In fact, the 'home' is the directory where the procedure
started. ("if (!getcwd(home, FILENAME_MAX))", line 80).  The problem
is that the message "Toto! This doesn't look like Kansas anymore!" is
absolutely weird and doesn't tell what the problem is _at all_.

To repeat, you could cd to a directory, pkg_delete a big package, and,
while pkg_delete is running, remove the directory where pkg_delete
started.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-01-11 12:39:30 UTC
Responsible Changed
From-To: freebsd-bugs->sheldonh

I'll take this one. 
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-01-11 12:39:57 UTC
State Changed
From-To: open->closed

Fixed in rev 1.21 of perform.c and merged to RELENG_3.  I used 
an error message more consistent with the existing messages in 
that file.  Thanks for the report! 

Comment 3 Sheldon Hearn 2000-01-11 13:43:09 UTC
On Tue, 11 Jan 2000 04:41:15 PST, sheldonh@FreeBSD.org wrote:

> Synopsis: Obscure error message in pkg_delete
> 
> State-Changed-From-To: open->closed
> State-Changed-By: sheldonh
> State-Changed-When: Tue Jan 11 04:39:57 PST 2000
> State-Changed-Why: 
> Fixed in rev 1.21 of perform.c and merged to RELENG_3.

FYI, I botched rev 1.21.  The problem is resolved properly in rev 1.22.

Ciao,
Sheldon.