[PATCH 3/3] dm-ioctl: Don't allow multiple device specifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



dm-ioctl: Don't allow multiple device specifiers

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

Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx>

---
 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel


[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux