From: Stelian Pop <stelian@popies.net>
Date: Mon, 5 Jul 2004 15:12:44 +0000 (+0000)
Subject: A wrong line in /etc/fstab containing LABEL=... could prevent dump from running.... 
X-Git-Tag: release_0_4b38~14
X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=97be3358a32b246d4336692ebad4b1c366446932;p=dump.git

A wrong line in /etc/fstab containing LABEL=... could prevent dump from running. Fix it.
---

diff --git a/CHANGES b/CHANGES
index a5996ff..f4062d2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.252 2004/07/05 15:02:32 stelian Exp $
+$Id: CHANGES,v 1.253 2004/07/05 15:12:44 stelian Exp $
 
 Changes between versions 0.4b36 and 0.4b37 (released ??????????????)
 ====================================================================
@@ -29,6 +29,11 @@ Changes between versions 0.4b36 and 0.4b37 (released ??????????????)
 5.	Made dump use the blkid library when searching for devices
 	by label or uuid instead of dump's own routines.
 
+6.	Corrected a bug in dump where a wrong LABEL=... line in
+	/etc/fstab could prevent dump from dumping unrelated 
+	filesystems. Thanks to Bruce Lowekamp
+	<lowekamp@users.sourceforge.net> for reporting the bug.
+
 Changes between versions 0.4b35 and 0.4b36 (released April 21, 2004)
 ====================================================================
 
diff --git a/dump/main.c b/dump/main.c
index fec91af..b73a788 100644
--- a/dump/main.c
+++ b/dump/main.c
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-	"$Id: main.c,v 1.93 2004/06/02 09:22:49 stelian Exp $";
+	"$Id: main.c,v 1.94 2004/07/05 15:12:45 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -584,13 +584,9 @@ main(int argc, char *argv[])
 			diskparam[i] = '\0';
 
 	disk = get_device_name(diskparam);
-	if (!disk) {		/* null means the disk is some form
-				   of LABEL= or UID= but it was not
-				   found */
-		msg("Cannot find a disk having %s\n", diskparam);
-		msg("The ENTIRE dump is aborted.\n");
-		exit(X_STARTUP);
-	}
+	if (!disk)
+		disk = strdup(diskparam);
+
 	/*
 	 *	disk can be either the full special file name,
 	 *	the suffix of the special file name,
diff --git a/dump/optr.c b/dump/optr.c
index 8afe500..a4504da 100644
--- a/dump/optr.c
+++ b/dump/optr.c
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-	"$Id: optr.c,v 1.38 2004/04/21 08:55:51 stelian Exp $";
+	"$Id: optr.c,v 1.39 2004/07/05 15:12:45 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -444,7 +444,7 @@ allocfsent(struct mntent *fs)
 	/* Translade UUID=, LABEL= ... */
 	disk = get_device_name(fs->mnt_fsname);
 	if (disk == NULL)
-		quit("Cannot find a disk having %s\n", fs->mnt_fsname);
+		disk = strdup(fs->mnt_fsname);
 
 	/* Discard non block devices */
 	if (stat(disk, &buf) != 0 || !S_ISBLK(buf.st_mode)) {