]> git.wh0rd.org - dump.git/commitdiff
Fixed dump of a mountpoint which is not an absolute path.
authorStelian Pop <stelian@popies.net>
Tue, 26 Sep 2000 12:34:51 +0000 (12:34 +0000)
committerStelian Pop <stelian@popies.net>
Tue, 26 Sep 2000 12:34:51 +0000 (12:34 +0000)
CHANGES
dump/main.c

diff --git a/CHANGES b/CHANGES
index 699c1f548d3027c8d420f78fa26d558be1d90a0f..7a84ebffaa9f6ef6058332a8514c6b5d4bd1ebaa 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.82 2000/09/01 14:39:21 stelian Exp $
+$Id: CHANGES,v 1.83 2000/09/26 12:34:51 stelian Exp $
 
 Changes between versions 0.4b19 and 0.4b20 (released ???????????????)
 =====================================================================
@@ -26,6 +26,11 @@ Changes between versions 0.4b19 and 0.4b20 (released ???????????????)
        be unreadable by restore). Prevented array overflow
        when multiple -e options are used.
 
+5.     Fixed dump to correctly interpret a filesystem argument
+       which is a mountpoint and it is not an absolute path 
+       (as specified in the fstab). Thanks to Bernhard R. Erdmann 
+       <be@berdmann.de> for reporting the bug.
+
 Changes between versions 0.4b18 and 0.4b19 (released August 20, 2000)
 =====================================================================
 
index eac1f5baad11fdea07589273ef5b15d370c9742b..6bf9a53718a1e40abcb6a081376e654b0b08c332 100644 (file)
@@ -40,7 +40,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.25 2000/09/01 14:40:27 stelian Exp $";
+       "$Id: main.c,v 1.26 2000/09/26 12:34:52 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -208,7 +208,7 @@ main(int argc, char *argv[])
                        }
                        iexclude_list[iexclude_num++] = numarg("inode to exclude",0L,0L);
                        if (iexclude_list[iexclude_num-1] <= ROOTINO) {
-                               (void)fprintf(stderr, "Cannot exclude inode %d\n", iexclude_list[iexclude_num-1]);
+                               (void)fprintf(stderr, "Cannot exclude inode %ld\n", iexclude_list[iexclude_num-1]);
                                exit(X_STARTUP);
                        }
                        msg("Added %d to exclude list\n",
@@ -398,26 +398,36 @@ main(int argc, char *argv[])
                (void)strncpy(spcl.c_filesys, dt->fs_file, NAMELEN);
 #ifdef __linux__
        } else {
-               /*
-                * The argument was not found in the fstab
-                * assume that this is a subtree and search for it
-                */
 #ifdef HAVE_REALPATH
                if (realpath(disk, pathname) == NULL)
 #endif
                        strcpy(pathname, disk);
-               dt = fstabsearchdir(pathname, directory);
-               if (dt != NULL) {
-                       char name[MAXPATHLEN];
-                       (void)strncpy(spcl.c_dev, dt->fs_spec, NAMELEN);
-                       (void)snprintf(name, sizeof(name), "%s (dir %s)",
-                                     dt->fs_file, directory);
-                       (void)strncpy(spcl.c_filesys, name, NAMELEN);
+               /*
+                * The argument could be now a mountpoint of
+                * a filesystem specified in fstab. Search for it.
+                */
+               if ((dt = fstabsearch(pathname)) != NULL) {
                        disk = rawname(dt->fs_spec);
+                       (void)strncpy(spcl.c_dev, dt->fs_spec, NAMELEN);
+                       (void)strncpy(spcl.c_filesys, dt->fs_file, NAMELEN);
                } else {
-                       (void)strncpy(spcl.c_dev, disk, NAMELEN);
-                       (void)strncpy(spcl.c_filesys, "an unlisted file system",
-                           NAMELEN);
+                       /*
+                        * The argument was not found in the fstab
+                        * assume that this is a subtree and search for it
+                        */
+                       dt = fstabsearchdir(pathname, directory);
+                       if (dt != NULL) {
+                               char name[MAXPATHLEN];
+                               (void)strncpy(spcl.c_dev, dt->fs_spec, NAMELEN);
+                               (void)snprintf(name, sizeof(name), "%s (dir %s)",
+                                             dt->fs_file, directory);
+                               (void)strncpy(spcl.c_filesys, name, NAMELEN);
+                               disk = rawname(dt->fs_spec);
+                       } else {
+                               (void)strncpy(spcl.c_dev, disk, NAMELEN);
+                               (void)strncpy(spcl.c_filesys, "an unlisted file system",
+                                   NAMELEN);
+                       }
                }
        }
 #else