From 97f91a4d238d41f4e093ac5e9cd3d43354e9f057 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sat, 3 Feb 2007 18:22:34 +0000 Subject: Don't spoof an msdosfs partition if it claims to start after the end of the disk. Fixes the creation of spurious 'i' partitions on new iPod Shuffle. And other devices with no MBR, just a FAT32 filesystem. Pointed out most recently by Stephan A. Rickauer for his sixth generation, clip-on iPod shuffle. Fix tested by Stephan. ok pedro@ tom@ miod@ 'nice' deraadt@ --- sys/arch/landisk/landisk/disksubr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/arch/landisk') diff --git a/sys/arch/landisk/landisk/disksubr.c b/sys/arch/landisk/landisk/disksubr.c index 9ea6931b274..a3251e2d058 100644 --- a/sys/arch/landisk/landisk/disksubr.c +++ b/sys/arch/landisk/landisk/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.12 2006/10/29 00:02:35 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.13 2007/02/03 18:22:33 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -166,6 +166,8 @@ donot: continue; if (letoh32(dp2->dp_size) > lp->d_secperunit) continue; + if (letoh32(dp2->dp_start) > lp->d_secperunit) + continue; if (letoh32(dp2->dp_size) == 0) continue; if (letoh32(dp2->dp_start)) -- cgit v1.2.3