Whamcloud - gitweb
LU-7003 utils: must quote the value of the context option 94/18294/5
authorFrederic Saunier <frederic.saunier@atos.net>
Tue, 2 Feb 2016 08:46:43 +0000 (09:46 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 14 Mar 2016 02:41:59 +0000 (02:41 +0000)
As per mount(8) notes, the context value might contain commas,
in which case the  value has to be properly quoted, otherwise
mount(8) will interpret the comma as a separator between mount
options.

Signed-off-by: Frederic Saunier <frederic.saunier@atos.net>
Change-Id: I75e958da26273fe2a15ccae01a1176c3549821b8
Reviewed-on: http://review.whamcloud.com/18294
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/mount_utils_ldiskfs.c

index 1ce4aa1..54b62fe 100644 (file)
@@ -553,8 +553,9 @@ static void append_unique(char *buf, char *prefix, char *key, char *val,
 
                strscat(buf, key, maxbuflen);
                if (val != NULL) {
 
                strscat(buf, key, maxbuflen);
                if (val != NULL) {
-                       strscat(buf, "=", maxbuflen);
+                       strscat(buf, "=\"", maxbuflen);
                        strscat(buf, val, maxbuflen);
                        strscat(buf, val, maxbuflen);
+                       strscat(buf, "\"", maxbuflen);
                }
        }
 }
                }
        }
 }