Date: Wed, 31 Mar 1999 01:07:51 -0800 (PST) From: asami@freebsd.org (Satoshi - the Wraith - Asami) To: Dom.Mitchell@palmerharvey.co.uk Cc: current@freebsd.org, jkh@freebsd.org Subject: Re: /var/db/pkg/.mkversion Message-ID: <199903310907.BAA48078@silvia.hip.berkeley.edu> In-Reply-To: <E10SGnA-0005bh-00@voodoo.pandhm.co.uk> (message from Dom Mitchell on Wed, 31 Mar 1999 09:56:07 %2B0100) References: <E10SGnA-0005bh-00@voodoo.pandhm.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
* From: Dom Mitchell <Dom.Mitchell@palmerharvey.co.uk> * Just a side note; this new file breaks pkg_info. I've appended a simple * patch below; somebody ought to do something better for the version in * the src tree. Eek. I didn't know it tries to open all files without checking whether it's a directory or not.... * if (chdir(log_dir) == FAIL) { * - warnx("can't change directory to '%s'!", log_dir); * - return 1; * + if (strcmp(log_dir, "/var/db/pkg/.mkversion") != 0) { * + warnx("can't change directory to '%s'!", log_dir); * + return 1; * + } This doesn't look right. I found where it's skipping "." and "..", either we add ".mkversion" there, skip all entries that start with an ".", or check whether a given entry is a directory. I implemented the second option, I think I can ensure that there will be no packages that start with a ".". Jordan, is this ok? === Index: perform.c =================================================================== RCS file: /usr/cvs/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/03/31 09:04:50 @@ -57,7 +57,7 @@ dirp = opendir(tmp); if (dirp) { for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) - if (strcmp(dp->d_name, ".") && strcmp(dp->d_name, "..")) + if (dp->d_name[0] != '.') err_cnt += pkg_do(dp->d_name); (void)closedir(dirp); } === -W To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903310907.BAA48078>