CVS commit: [netbsd-9] src/sbin/dump

2023-08-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 21 12:14:23 UTC 2023

Modified Files:
src/sbin/dump [netbsd-9]: optr.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1717):

sbin/dump/optr.c: revision 1.44

Silently ignore fstab entries with NAME= entries that cannot be resolved.

Fixes PR 56249.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.2.1 src/sbin/dump/optr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/dump/optr.c
diff -u src/sbin/dump/optr.c:1.43 src/sbin/dump/optr.c:1.43.2.1
--- src/sbin/dump/optr.c:1.43	Fri Mar  1 16:42:11 2019
+++ src/sbin/dump/optr.c	Mon Aug 21 12:14:23 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: optr.c,v 1.43 2019/03/01 16:42:11 christos Exp $	*/
+/*	$NetBSD: optr.c,v 1.43.2.1 2023/08/21 12:14:23 martin Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)optr.c	8.2 (Berkeley) 1/6/94";
 #else
-__RCSID("$NetBSD: optr.c,v 1.43 2019/03/01 16:42:11 christos Exp $");
+__RCSID("$NetBSD: optr.c,v 1.43.2.1 2023/08/21 12:14:23 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -344,9 +344,10 @@ allocfsent(const struct fstab *fs)
 	new->fs_file = xstrdup(fs->fs_file);
 	new->fs_type = xstrdup(fs->fs_type);
 	new->fs_spec = xmalloc(FILENAME_MAX);
-	if (getfsspecname(new->fs_spec, FILENAME_MAX, fs->fs_spec) == NULL)
-		quite(errno, "can't resolve mount point %s (%s)",
-		fs->fs_spec, new->fs_spec);
+	if (getfsspecname(new->fs_spec, FILENAME_MAX, fs->fs_spec) == NULL) {
+		free(new);
+		return NULL;
+	}
 	new->fs_passno = fs->fs_passno;
 	new->fs_freq = fs->fs_freq;
 	return new;
@@ -384,6 +385,9 @@ getfstab(void)
 			continue;
 #endif
 		fs = allocfsent(fs);
+		if (fs == NULL)
+			continue;
+
 		pf = (struct pfstab *)xmalloc(sizeof (*pf));
 		pf->pf_fstab = fs;
 		SLIST_INSERT_HEAD(, pf, pf_list);



CVS commit: [netbsd-9] src/sbin/dump

2023-08-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 21 12:14:23 UTC 2023

Modified Files:
src/sbin/dump [netbsd-9]: optr.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1717):

sbin/dump/optr.c: revision 1.44

Silently ignore fstab entries with NAME= entries that cannot be resolved.

Fixes PR 56249.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.2.1 src/sbin/dump/optr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.