From d8a88c44f0f227caf295a1554f39ed973d481e9e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 15 May 2021 21:59:40 +0200 Subject: [PATCH] fsmounter: fix unused options1 for cifs Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/29d46e058dfdbd66f13015ed934429e113c46778 Author: vanhofen Date: 2021-05-15 (Sat, 15 May 2021) Origin message was: ------------------ - fsmounter: fix unused options1 for cifs ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/fsmounter.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/system/fsmounter.cpp b/src/system/fsmounter.cpp index d10b8216d..105c8d64c 100644 --- a/src/system/fsmounter.cpp +++ b/src/system/fsmounter.cpp @@ -178,7 +178,6 @@ bool CFSMounter::isMounted(const std::string &local_dir) MountInfo mi; in >> mi.device >> mi.mountPoint >> mi.type; - //NI if (mi.type == "tmpfs") continue; @@ -229,8 +228,8 @@ CFSMounter::MountRes CFSMounter::mount(const std::string &ip, const std::string { if (fstype == NFS) { - options1 = "soft"; //NI - options2 = "nolock"; //NI + options1 = "soft"; + options2 = "nolock"; } else if (fstype == CIFS) { @@ -252,8 +251,6 @@ CFSMounter::MountRes CFSMounter::mount(const std::string &ip, const std::string cmd += dir; cmd += ' '; cmd += local_dir; - cmd += " -o "; - cmd += options1; } else if (fstype == CIFS) { @@ -267,12 +264,6 @@ CFSMounter::MountRes CFSMounter::mount(const std::string &ip, const std::string cmd += username; cmd += ",password="; cmd += password; - //cmd += ",unc=//"; for whats needed? - //cmd += ip; - //cmd += '/'; - //cmd += dir; - //cmd += ','; - //cmd += options1; } else { @@ -286,11 +277,18 @@ CFSMounter::MountRes CFSMounter::mount(const std::string &ip, const std::string cmd += ip; cmd += ",root=/"; cmd += dir; - cmd += ','; + } + + if (!options1.empty()) + { + if (fstype == NFS) + cmd += " -o "; + else + cmd += ','; cmd += options1; } - if (options2[0] != '\0') + if (!options2.empty()) { cmd += ','; cmd += options2;