[dm-devel] [PATCH] execute_program() fix in multipath-tools-0.4.4

k-ueda at ct.jp.nec.com k-ueda at ct.jp.nec.com
Wed Apr 27 22:26:24 UTC 2005


Hi Christophe,

If there is no space (' ') in callout strings, the callout isn't called
in multipath-tools-0.4.4.

For example, in the default multipath.conf, default_prio_callout
is set as "/bin/false".  But it's not called due to this bug.
If I set it as "/bin/false ", it works.

Regards,
Ky (Kiyoshi Ueda)


--- multipath-tools-0.4.4/libmultipath/callout.c	2005-04-14 13:17:17.000000000 -0400
+++ execute-program-fix/libmultipath/callout.c	2005-04-28 05:29:30.228646923 -0400
@@ -29,8 +29,8 @@ int execute_program(char *path, char *va
 	int i;
 
 	i = 0;
+	strfieldcpy(arg, path);
 	if (strchr(path, ' ')) {
-		strfieldcpy(arg, path);
 		pos = arg;
 		while (pos != NULL) {
 			if (pos[0] == '\'') {
@@ -39,11 +39,13 @@ int execute_program(char *path, char *va
 				argv[i] = strsep(&pos, "\'");
 				while (pos[0] == ' ')
 					pos++;
-		} else {
+			} else {
 				argv[i] = strsep(&pos, " ");
 			}
 			i++;
 		}
+	} else {
+		argv[i++] = arg;
 	}
 	argv[i] =  NULL;
 




More information about the dm-devel mailing list