[lvm-devel][PATCH] Fix segfault when using -U, -G and -M options in dmsetup

Peter Rajnoha prajnoha at redhat.com
Fri Apr 24 10:42:38 UTC 2009


It seems nobody uses these options :) Permissions will be covered
by udev anyway...

We have to define ":" in getopt for options that require parameters.

Peter


diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 0d6a371..1194c5f 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -2565,7 +2565,7 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir)
 
 	optarg = 0;
 	optind = OPTIND_INIT;
-	while ((ind = -1, c = GETOPTLONG_FN(*argc, *argv, "cCfGj:m:Mno:O:ru:Uv",
+	while ((ind = -1, c = GETOPTLONG_FN(*argc, *argv, "cCfG:j:m:M:no:O:ru:U:v",
 					    long_options, NULL)) != -1) {
 		if (c == ':' || c == '?')
 			return 0;




More information about the lvm-devel mailing list