through and failing when we attempt to read and validate the disklabel.
Also return ENOTSUP rather than EPERM if an attempt is made to write to a
softraid volume.
-/* $OpenBSD: biosdev.c,v 1.20 2013/03/23 16:08:27 deraadt Exp $ */
+/* $OpenBSD: biosdev.c,v 1.21 2013/12/28 02:40:41 jsing Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
}
if (bv->sbv_level == 'C' && bv->sbv_keys == NULL)
- sr_crypto_decrypt_keys(bv);
+ if (sr_crypto_decrypt_keys(bv) != 0)
+ return EPERM;
if (bv->sbv_diskinfo == NULL) {
dip = alloc(sizeof(struct diskinfo));
-/* $OpenBSD: softraid.c,v 1.5 2013/10/20 13:25:20 stsp Exp $ */
+/* $OpenBSD: softraid.c,v 1.6 2013/12/28 02:40:41 jsing Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
/* We only support read-only softraid. */
if (rw != F_READ)
- return EPERM;
+ return ENOTSUP;
/* Partition offset within softraid volume. */
sr_dip = (struct diskinfo *)bv->sbv_diskinfo;
-/* $OpenBSD: biosdev.c,v 1.87 2013/03/23 16:08:29 deraadt Exp $ */
+/* $OpenBSD: biosdev.c,v 1.88 2013/12/28 02:40:41 jsing Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
}
if (bv->sbv_level == 'C' && bv->sbv_keys == NULL)
- sr_crypto_decrypt_keys(bv);
+ if (sr_crypto_decrypt_keys(bv) != 0)
+ return EPERM;
if (bv->sbv_diskinfo == NULL) {
dip = alloc(sizeof(struct diskinfo));
-/* $OpenBSD: softraid.c,v 1.5 2013/10/20 13:25:21 stsp Exp $ */
+/* $OpenBSD: softraid.c,v 1.6 2013/12/28 02:40:41 jsing Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
/* We only support read-only softraid. */
if (rw != F_READ)
- return EPERM;
+ return ENOTSUP;
/* Partition offset within softraid volume. */
sr_dip = (struct diskinfo *)bv->sbv_diskinfo;