summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2011-12-28 14:34:14 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2011-12-28 14:34:14 +0000
commit0208e14f9a30612ffde2a0270224e89ebf50f3e7 (patch)
treef432755a1861cbf7ccbe1ebfa8369b818a878827 /sys/kern
parent3d64e854ed56cf7f72f8ca243a3ddc704e569d97 (diff)
An all-zero DUID is considered to be a blank DUID - ensure that we do not
generate one. ok krw@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_disk.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 97c1c10c3c0..ae347fff99d 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.133 2011/09/21 21:43:57 deraadt Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.134 2011/12/28 14:34:13 jsing Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -227,8 +227,8 @@ initdisklabel(struct disklabel *lp)
* a newer version if needed, etc etc.
*/
int
-checkdisklabel(void *rlp, struct disklabel *lp,
- u_int64_t boundstart, u_int64_t boundend)
+checkdisklabel(void *rlp, struct disklabel *lp, u_int64_t boundstart,
+ u_int64_t boundend)
{
struct disklabel *dlp = rlp;
struct __partitionv0 *v0pp;
@@ -665,7 +665,8 @@ setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_int openmask)
if (dk->dk_label && bcmp(dk->dk_label->d_uid,
nlp->d_uid, sizeof(nlp->d_uid)) == 0)
break;
- } while (dk != NULL);
+ } while (dk != NULL &&
+ bcmp(nlp->d_uid, &uid, sizeof(nlp->d_uid)) == 0);
}
nlp->d_checksum = 0;