summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-05-28 17:05:51 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-05-28 17:05:51 +0000
commitb9f233f48941ef2bbf4d31cf4e41b191a8b07a2d (patch)
tree52929d5e1bc56fdbf1b40410fea722aa19921b43 /sys/arch
parent041daf757cbccb0d554ab5214e5fee087044e235 (diff)
If readsgilabel() is invoked in spoofing mode, only report the whole device
and volume header partitions. This makes DIOCGPDINFO return correct results, which in turn lets disklabel -A behave as intended.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sgi/sgi/disksubr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/sgi/sgi/disksubr.c b/sys/arch/sgi/sgi/disksubr.c
index 95728895095..7a0646fb8fe 100644
--- a/sys/arch/sgi/sgi/disksubr.c
+++ b/sys/arch/sgi/sgi/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.12 2009/05/13 01:31:58 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.13 2009/05/28 17:05:50 miod Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -172,13 +172,17 @@ readsgilabel(struct buf *bp, void (*strat)(struct buf *),
for (i = 0; i < 16; i++) {
int bsd = maptab[i].m;
+ int type = maptab[i].b;
+
+ if (spoofonly && type != FS_UNUSED && type != FS_OTHER)
+ continue;
DL_SETPOFFSET(&lp->d_partitions[bsd],
dlp->partitions[i].first);
DL_SETPSIZE(&lp->d_partitions[bsd],
dlp->partitions[i].blocks);
- lp->d_partitions[bsd].p_fstype = maptab[i].b;
- if (lp->d_partitions[bsd].p_fstype == FS_BSDFFS) {
+ lp->d_partitions[bsd].p_fstype = type;
+ if (type == FS_BSDFFS) {
lp->d_partitions[bsd].p_fragblock =
DISKLABELV1_FFS_FRAGBLOCK(1024, 8);
lp->d_partitions[bsd].p_cpg = 16;