NFS mount options can be in format "uid=NUM,gid=NUM".
In this case, mount-nfs.so requires replacement of "," with "&",
and whole nfs_server string has to be quoted. See also #829.

Signed-off-by: Justin Cinkelj <justin.cink...@xlab.si>
---
 modules/cloud-init/cloud-init.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/cloud-init/cloud-init.cc b/modules/cloud-init/cloud-init.cc
index b5ec190..5e05c82 100644
--- a/modules/cloud-init/cloud-init.cc
+++ b/modules/cloud-init/cloud-init.cc
@@ -11,6 +11,7 @@
 #include <memory>
 #include "client.hh"
 #include <boost/asio.hpp>
+#include <boost/algorithm/string/replace.hpp>
 #include "data-source.hh"
 #include <osv/debug.hh>
 #include <osv/firmware.hh>
@@ -219,11 +220,11 @@ void mount_module::yaml_to_request(const YAML::Node& 
node, http::server::request
     http::server::header param;
     param.name = "command";
     param.value = "/tools/mount-nfs.so";
-    param.value += " " + nfs_server;
+    param.value += " \"" + nfs_server;
     if (options.size() > 0) {
-        param.value += "/?" + options;
+        param.value += "/?" + boost::replace_all_copy(options, ",", "&");
     }
-    param.value += " " + mount_point;
+    param.value += "\" " + mount_point;
     req.query_parameters.push_back(param);
     //fprintf(stderr, "MNT: param name='%s' value='%s'", param.name.c_str(), 
param.value.c_str());
     req.method = method;
-- 
2.9.3

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to