Date: Wed, 7 Apr 1999 21:52:20 -0700 (PDT) From: mharo@area51.fremont.ca.us To: FreeBSD-gnats-submit@freebsd.org Subject: bin/11016: Patch: pkg_info tries to cd to .mkversion Message-ID: <199904080452.VAA25643@patrol.area51.fremont.ca.us>
next in thread | raw e-mail | index | archive | help
>Number: 11016 >Category: bin >Synopsis: Patch: pkg_info tries to cd to .mkversion >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Apr 7 22:00:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Michael Haro >Release: FreeBSD 3.1-STABLE i386 >Organization: >Environment: >Description: > From: "Stephen J. Roznowski" <sjr@home.net> > Subject: pkg_info error? > When I run "pkg_info -aI", I get the following error: > pkg_info: can't change directory to '/var/db/pkg/.mkversion'! The following patch fixes this problem. A better patch might be to stat the files in the directory and only attempt a chdir on directories. I didn't do that as you might want to just have non- directories return the error and stating all the files would probably take more time to run in which case the following is fine. >How-To-Repeat: pkg_info -aI >Fix: =================================================================== RCS file: /host/trang.nuxi.com/FBSD/CVS-repository/src/usr.sbin/pkg_install/info/perform.c,v retrieving revision 1.26 diff -u -r1.26 perform.c --- perform.c 1998/12/16 13:59:31 1.26 +++ perform.c 1999/04/08 04:46:06 @@ -134,7 +134,7 @@ warnx("can't find package `%s' installed or in a file!", pkg); return 1; } - if (chdir(log_dir) == FAIL) { + if (chdir(log_dir) == FAIL && strcmp(pkg, ".mkversion")) { warnx("can't change directory to '%s'!", log_dir); return 1; } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904080452.VAA25643>