diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-08-03 03:01:32 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-08-03 03:01:32 +0000 |
commit | a9e696da2713627d164d9f487601fc401a14bc03 (patch) | |
tree | 4bbe93604d107c17700ff0fff6b8e04879e714d1 /sbin/bioctl/bioctl.c | |
parent | ce9ca2691a4cd28815a28cc4151dd061d7fd85b8 (diff) |
be more sure about what is a drive vs controller; ok marco
Diffstat (limited to 'sbin/bioctl/bioctl.c')
-rw-r--r-- | sbin/bioctl/bioctl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c index eab5079cae7..3fa9d99b718 100644 --- a/sbin/bioctl/bioctl.c +++ b/sbin/bioctl/bioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bioctl.c,v 1.19 2005/08/03 02:39:55 deraadt Exp $ */ +/* $OpenBSD: bioctl.c,v 1.20 2005/08/03 03:01:31 deraadt Exp $ */ /* * Copyright (c) 2004, 2005 Marco Peereboom @@ -41,6 +41,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <ctype.h> #include <util.h> #include "bioctl.h" @@ -89,7 +90,9 @@ main(int argc, char *argv[]) if (argc < 0 || argc > 1) usage(); - if (strncmp(argv[0], "sd", 2) == 0) + /* if at least glob sd[0-9]*, it is a drive identifier */ + if (strncmp(argv[0], "sd", 2) == 0 && strlen(argv[0]) > 2 && + isdigit(argv[0][2])) sd_dev = argv[0]; else bioc_dev = argv[0]; |