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

[dm-devel] [PATCH 6/6] Fix user_friendly_names for WWIDs with spaces



The user_friendly_names code didn't handle WWIDs with spaces correctly.  This
fixes it by taking everything from the start of the WWID to the end of the line
as the WWID.  The only downside is that if someone hand edits their bindings
file, they may leave stray whitespace at the end of the line, and cause it to
not match.  This could ne solved by quoting the WWIDs and escaping any quotes
that they might have, but I don't think that people hand edit their bindings
files enough to make it a problem.

Signed-off-by: Benjamin Marzinski <bmarzins redhat com>
---
 libmultipath/alias.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: multipath-tools-081203/libmultipath/alias.c
===================================================================
--- multipath-tools-081203.orig/libmultipath/alias.c
+++ multipath-tools-081203/libmultipath/alias.c
@@ -243,7 +243,7 @@ lookup_binding(FILE *f, char *map_wwid, 
 		curr_id = scan_devname(alias);
 		if (curr_id >= id)
 			id = curr_id + 1;
-		wwid = strtok(NULL, " \t");
+		wwid = strtok(NULL, "");
 		if (!wwid){
 			condlog(3,
 				"Ignoring malformed line %u in bindings file",


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