Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/installboot/arch don't complain if the mbr was all ...
details: https://anonhg.NetBSD.org/src/rev/208f36dfb293
branches: trunk
changeset: 355182:208f36dfb293
user: christos <christos%NetBSD.org@localhost>
date: Mon Jul 17 18:43:45 2017 +0000
description:
don't complain if the mbr was all 0's.
diffstat:
usr.sbin/installboot/arch/landisk.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diffs (42 lines):
diff -r 116a7d959f9d -r 208f36dfb293 usr.sbin/installboot/arch/landisk.c
--- a/usr.sbin/installboot/arch/landisk.c Mon Jul 17 14:36:13 2017 +0000
+++ b/usr.sbin/installboot/arch/landisk.c Mon Jul 17 18:43:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: landisk.c,v 1.6 2013/10/19 17:08:15 christos Exp $ */
+/* $NetBSD: landisk.c,v 1.7 2017/07/17 18:43:45 christos Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if !defined(__lint)
-__RCSID("$NetBSD: landisk.c,v 1.6 2013/10/19 17:08:15 christos Exp $");
+__RCSID("$NetBSD: landisk.c,v 1.7 2017/07/17 18:43:45 christos Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -100,12 +100,18 @@
goto done;
}
if (mbr.mbr_magic != le16toh(MBR_MAGIC)) {
- if (params->flags & IB_VERBOSE) {
- printf(
- "Ignoring MBR with invalid magic in sector 0 of `%s'\n",
- params->filesystem);
+ const char *p = (const char *)&mbr;
+ const char *e = p + sizeof(mbr);
+ while (p < e && !*p)
+ p++;
+ if (p != e) {
+ if (params->flags & IB_VERBOSE) {
+ printf(
+ "Ignoring MBR with invalid magic in sector 0 of `%s'\n",
+ params->filesystem);
+ }
+ memset(&mbr, 0, sizeof(mbr));
}
- memset(&mbr, 0, sizeof(mbr));
}
/*
Home |
Main Index |
Thread Index |
Old Index