Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Device-mapper Development (http://www.linux-archive.org/device-mapper-development/)
-   -   dm-ioctl: Don't allow multiple device specifiers (http://www.linux-archive.org/device-mapper-development/547034-dm-ioctl-dont-allow-multiple-device-specifiers.html)

Mikulas Patocka 07-01-2011 07:05 PM

dm-ioctl: Don't allow multiple device specifiers
 
dm-ioctl: Don't allow multiple device specifiers

Exactly one of name, uuid, device has to be specified.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
drivers/md/dm-ioctl.c | 6 ++++++
1 file changed, 6 insertions(+)

Index: linux-2.6.39-fast/drivers/md/dm-ioctl.c
================================================== =================
--- linux-2.6.39-fast.orig/drivers/md/dm-ioctl.c 2011-07-01 19:52:31.000000000 +0200
+++ linux-2.6.39-fast/drivers/md/dm-ioctl.c 2011-07-01 19:53:04.000000000 +0200
@@ -739,10 +739,16 @@ static struct hash_cell *__find_device_h
struct hash_cell *hc = NULL;

if (*param->uuid) {
+ if (*param->name || param->dev)
+ return NULL;
+
hc = __get_uuid_cell(param->uuid);
if (!hc)
return NULL;
} else if (*param->name) {
+ if (param->dev)
+ return NULL;
+
hc = __get_name_cell(param->name);
if (!hc)
return NULL;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


All times are GMT. The time now is 07:34 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.