* From: Dom Mitchell <dom.mitch...@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 majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to