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

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



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;
 


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