there's a bug in restore's interactive mode, which occurs when you 'add'
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 26 Mar 1994 04:41:24 +0000 (20:41 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 26 Mar 1994 04:41:24 +0000 (20:41 -0800)
a directory not in the dump.
From: "Chris G. Demetriou" <cgd@sun-lamp.cs.berkeley.edu>

SCCS-vsn: sbin/restore/utilities.c 8.2

usr/src/sbin/restore/utilities.c

index 28017f0..e3641f1 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)utilities.c        8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)utilities.c        8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -44,6 +44,7 @@ pathcheck(name)
                *cp = '\0';
                ep = lookupname(name);
                if (ep == NULL) {
                *cp = '\0';
                ep = lookupname(name);
                if (ep == NULL) {
+                       /* Safe; we know the pathname exists in the dump. */
                        ep = addentry(name, pathsearch(name)->d_ino, NODE);
                        newnode(ep);
                }
                        ep = addentry(name, pathsearch(name)->d_ino, NODE);
                        newnode(ep);
                }
@@ -300,11 +301,13 @@ ino_t
 dirlookup(name)
        const char *name;
 {
 dirlookup(name)
        const char *name;
 {
+       struct direct *dp;
        ino_t ino;
        ino_t ino;
+       ino = ((dp = pathsearch(name)) == NULL) ? 0 : dp->d_ino;
 
 
-       ino = pathsearch(name)->d_ino;
        if (ino == 0 || TSTINO(ino, dumpmap) == 0)
        if (ino == 0 || TSTINO(ino, dumpmap) == 0)
-               fprintf(stderr, "%s is not on tape\n", name);
+               fprintf(stderr, "%s is not on the tape\n", name);
        return (ino);
 }
 
        return (ino);
 }