Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst As pointed out by John D. Baker: replace al...
details: https://anonhg.NetBSD.org/src/rev/c8cfb8ac6ccc
branches: trunk
changeset: 808001:c8cfb8ac6ccc
user: martin <martin%NetBSD.org@localhost>
date: Fri May 01 17:48:36 2015 +0000
description:
As pointed out by John D. Baker: replace all / characters in packnames
(which might be automatically generated from controller names like
"PERC 5/i") with a space before using the string as a file name.
diffstat:
usr.sbin/sysinst/savenewlabel.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diffs (40 lines):
diff -r 2bbd6fe931c2 -r c8cfb8ac6ccc usr.sbin/sysinst/savenewlabel.c
--- a/usr.sbin/sysinst/savenewlabel.c Fri May 01 17:01:08 2015 +0000
+++ b/usr.sbin/sysinst/savenewlabel.c Fri May 01 17:48:36 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: savenewlabel.c,v 1.2 2014/08/03 16:09:38 martin Exp $ */
+/* $NetBSD: savenewlabel.c,v 1.3 2015/05/01 17:48:36 martin Exp $ */
/*
* Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: savenewlabel.c,v 1.2 2014/08/03 16:09:38 martin Exp $");
+__RCSID("$NetBSD: savenewlabel.c,v 1.3 2015/05/01 17:48:36 martin Exp $");
#endif
#include <sys/types.h>
@@ -59,6 +59,7 @@
{
FILE *f;
char *f_name = malloc(STRSIZE * sizeof(char));
+ char *sane_packname, *p;
int i;
pm_devs_t *pm_i;
@@ -73,7 +74,12 @@
snprintf(pm_i->bsddiskname, DISKNAME_SIZE, "disk %c", i);
}
- snprintf(f_name, STRSIZE, "/tmp/disktab.%s", pm->bsddiskname);
+ sane_packname = strdup(pm->bsddiskname);
+ for (p = sane_packname; *p; p++)
+ if (*p == '/')
+ *p = ' ';
+ snprintf(f_name, STRSIZE, "/tmp/disktab.%s", sane_packname);
+ free(sane_packname);
/*
N.B. disklabels only support up to 2TB (32-bit field for sectors).
Home |
Main Index |
Thread Index |
Old Index