CLOUDSTACK-5489: Query the user name and add it to the command while mounting a cifs share.

This commit is contained in:
Devdeep Singh 2013-12-17 14:04:05 +05:30
parent 5594ea990f
commit 759d484d9a

View File

@ -230,11 +230,15 @@ public class HypervManagerImpl implements HypervManager {
Script script = null;
String result = null;
if (scheme.equals("cifs")) {
String user = System.getProperty("user.name");
Script command = new Script(true, "mount", _timeout, s_logger);
command.add("-t", "cifs");
command.add(path);
command.add(mountPoint);
command.add("-o", "uid=`whoami`,gid=`whoami`");
if (user != null) {
command.add("-o", "uid=" + user + ",gid=" + user);
}
if (query != null) {
query = query.replace('&', ',');