-/* $OpenBSD: efi_softraid.c,v 1.2 2022/08/29 18:54:43 kn Exp $ */
+/* $OpenBSD: efi_softraid.c,v 1.3 2022/10/05 09:58:43 kn Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
* Copyright (c) 2022 Klemens Nanni <kn@openbsd.org>
return;
}
+ /* Keydisks always have a size of zero. */
+ if (bd.bd_size == 0) {
+ fprintf(stderr, "softraid chunk %u is keydisk - skipping...\n",
+ disk);
+ return;
+ }
+
if (strlen(bd.bd_vendor) < 1)
errx(1, "invalid disk name");
part = bd.bd_vendor[strlen(bd.bd_vendor) - 1];
-/* $OpenBSD: i386_softraid.c,v 1.19 2022/08/29 18:54:43 kn Exp $ */
+/* $OpenBSD: i386_softraid.c,v 1.20 2022/10/05 09:58:43 kn Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
* Copyright (c) 2010 Otto Moerbeek <otto@drijf.net>
return;
}
+ /* Keydisks always have a size of zero. */
+ if (bd.bd_size == 0) {
+ fprintf(stderr, "softraid chunk %u is keydisk - skipping...\n",
+ disk);
+ return;
+ }
+
if (strlen(bd.bd_vendor) < 1)
errx(1, "invalid disk name");
part = bd.bd_vendor[strlen(bd.bd_vendor) - 1];
-/* $OpenBSD: sparc64_softraid.c,v 1.6 2022/08/29 18:54:43 kn Exp $ */
+/* $OpenBSD: sparc64_softraid.c,v 1.7 2022/10/05 09:58:43 kn Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
*
return;
}
+ /* Keydisks always have a size of zero. */
+ if (bd.bd_size == 0) {
+ fprintf(stderr, "softraid chunk %u is keydisk - skipping...\n",
+ disk);
+ return;
+ }
+
if (strlen(bd.bd_vendor) < 1)
errx(1, "invalid disk name");
part = bd.bd_vendor[strlen(bd.bd_vendor) - 1];