summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-04-18 20:15:43 +0000
committerderaadt <deraadt@openbsd.org>1997-04-18 20:15:43 +0000
commit53349cfe754168381f42dbaab8bfb36e9e891a1f (patch)
tree35c694b32527fc8159481ff1cb1559ee1102badf /sys
parentFix problem when fetching files with -a. (diff)
downloadwireguard-openbsd-53349cfe754168381f42dbaab8bfb36e9e891a1f.tar.xz
wireguard-openbsd-53349cfe754168381f42dbaab8bfb36e9e891a1f.zip
do not check BOOT_MAGIC!
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/arc/arc/disksubr.c14
-rw-r--r--sys/arch/i386/i386/disksubr.c14
2 files changed, 12 insertions, 16 deletions
diff --git a/sys/arch/arc/arc/disksubr.c b/sys/arch/arc/arc/disksubr.c
index 117c8b173c5..bab95107c7b 100644
--- a/sys/arch/arc/arc/disksubr.c
+++ b/sys/arch/arc/arc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.11 1997/04/18 14:27:23 provos Exp $ */
+/* $OpenBSD: disksubr.c,v 1.12 1997/04/18 20:15:47 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -112,7 +112,6 @@ readdisklabel(dev, strat, lp, osdep)
unsigned long extoff = 0;
int wander = 1;
int n = 0;
- unsigned char *p;
/*
* Read dos partition table, follow extended partitions.
@@ -135,12 +134,11 @@ readdisklabel(dev, strat, lp, osdep)
goto done;
}
- /* XXX - how do we check veracity/bounds of this? */
- p = (unsigned char *)bp->b_data + BOOT_MAGIC_OFF;
- if ((p[0] | (p[1] << 8)) != BOOT_MAGIC) {
- msg = "dos partition corrupt";
- goto done;
- }
+ /*
+ * We would like to check if each MBR has a valid
+ * BOOT_MAGIC, but we cannot because it doesn't
+ * always exist. So.. we assume the MBR is valid.
+ */
bcopy(bp->b_data + DOSPARTOFF, dp, NDOSPART * sizeof(*dp));
diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c
index aae89dbe007..f94a3927d0c 100644
--- a/sys/arch/i386/i386/disksubr.c
+++ b/sys/arch/i386/i386/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.20 1997/04/18 14:27:22 provos Exp $ */
+/* $OpenBSD: disksubr.c,v 1.21 1997/04/18 20:15:43 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -112,7 +112,6 @@ readdisklabel(dev, strat, lp, osdep)
unsigned long extoff = 0;
int wander = 1;
int n = 0;
- unsigned char *p;
/*
* Read dos partition table, follow extended partitions.
@@ -135,12 +134,11 @@ readdisklabel(dev, strat, lp, osdep)
goto done;
}
- /* XXX - how do we check veracity/bounds of this? */
- p = (unsigned char *)bp->b_data + BOOT_MAGIC_OFF;
- if ((p[0] | (p[1] << 8)) != BOOT_MAGIC) {
- msg = "dos partition corrupt";
- goto done;
- }
+ /*
+ * We would like to check if each MBR has a valid
+ * BOOT_MAGIC, but we cannot because it doesn't
+ * always exist. So.. we assume the MBR is valid.
+ */
bcopy(bp->b_data + DOSPARTOFF, dp, NDOSPART * sizeof(*dp));