summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-09-24 00:11:16 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-09-24 00:11:16 +0000
commit28f7bbe1f362f59dd11ca8fe28737c20b11d1a82 (patch)
tree0e7e23d0b68314d04344778fbaf044bbd1344653 /sbin
parent2caa943e41da0e13cfd43716d449696c87cf736e (diff)
Now that HW_DISKNAMES returns xx0: or xx0:uid entries, we must truncate
the : and uid components out -- otherwise these two programs will work poorly.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/raidctl/raidctl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/raidctl/raidctl.c b/sbin/raidctl/raidctl.c
index 7f8c492e0a1..4251d81765d 100644
--- a/sbin/raidctl/raidctl.c
+++ b/sbin/raidctl/raidctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raidctl.c,v 1.30 2009/11/12 15:29:24 deraadt Exp $ */
+/* $OpenBSD: raidctl.c,v 1.31 2010/09/24 00:11:15 deraadt Exp $ */
/* $NetBSD: raidctl.c,v 1.27 2001/07/10 01:30:52 lukem Exp $ */
/*-
@@ -1203,6 +1203,11 @@ get_all_devices(char ***diskarray, const char *genericname)
i = 0;
fp = disks;
while ((p = strsep(&fp, ",")) != NULL) {
+ char *q = strchr(p, ':');
+
+ if (q)
+ *q = '\0';
+
if (strstr((const char*)p, genericname) != NULL) {
if (asprintf(&(*diskarray)[i++], "/dev/%s%c", p,
'a' + getrawpartition()) == -1)