Skip to content

Commit 759d484

Browse files
committed
CLOUDSTACK-5489: Query the user name and add it to the command while mounting a cifs share.
1 parent 5594ea9 commit 759d484

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/manager/HypervManagerImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,15 @@ protected String mount(String path, String parent, String scheme, String query)
230230
Script script = null;
231231
String result = null;
232232
if (scheme.equals("cifs")) {
233+
String user = System.getProperty("user.name");
233234
Script command = new Script(true, "mount", _timeout, s_logger);
234235
command.add("-t", "cifs");
235236
command.add(path);
236237
command.add(mountPoint);
237-
command.add("-o", "uid=`whoami`,gid=`whoami`");
238+
239+
if (user != null) {
240+
command.add("-o", "uid=" + user + ",gid=" + user);
241+
}
238242

239243
if (query != null) {
240244
query = query.replace('&', ',');

0 commit comments

Comments
 (0)