From owner-freebsd-bugs Sun Jan 9 13:30:16 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 5B0F115302 for ; Sun, 9 Jan 2000 13:30:08 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id NAA25003; Sun, 9 Jan 2000 13:30:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from anarcat.dyndns.org (phobos.IRO.UMontreal.CA [132.204.20.20]) by hub.freebsd.org (Postfix) with ESMTP id 0344014D5A for ; Sun, 9 Jan 2000 13:28:35 -0800 (PST) (envelope-from spidey@anarcat.dyndns.org) Received: by anarcat.dyndns.org (Postfix, from userid 1000) id 1B22D1BD2; Sun, 9 Jan 2000 13:10:20 -0500 (EST) Message-Id: <20000109181020.1B22D1BD2@anarcat.dyndns.org> Date: Sun, 9 Jan 2000 13:10:20 -0500 (EST) From: spidey@anarcat.dyndns.org Reply-To: spidey@anarcat.dyndns.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/16015: Obscure error message in pkg_delete Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 16015 >Category: bin >Synopsis: Obscure error message in pkg_delete >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jan 9 13:30:02 PST 2000 >Closed-Date: >Last-Modified: >Originator: Spidey >Release: FreeBSD 3.4-STABLE i386 >Organization: >Environment: Latest stable (28.12.1999). >Description: pkg_delete gives a very strange error message that is too hard to understand. It should be changed to something more descriptive. >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. >Fix: Suggested patch: *** perform.c Sun Jan 9 13:08:18 2000 --- perform.c.orig Sun Jan 9 13:08:18 2000 *************** *** 169,175 **** if (chdir(home) == FAIL) { cleanup(0); ! errx(2, "Can't chdir() to %s.", home); } if (!Fake) { --- 169,175 ---- if (chdir(home) == FAIL) { cleanup(0); ! errx(2, "Toto! This doesn't look like Kansas anymore!"); } if (!Fake) { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message