Skip to content

Commit 079baaf

Browse files
committed
CLOUDSTACK-5489: Query the user name and add it to the command while mounting a cifs share.
1 parent edbc80b commit 079baaf

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
@@ -227,11 +227,15 @@ protected String mount(String path, String parent, String scheme, String query)
227227
Script script = null;
228228
String result = null;
229229
if (scheme.equals("cifs")) {
230+
String user = System.getProperty("user.name");
230231
Script command = new Script(true, "mount", _timeout, s_logger);
231232
command.add("-t", "cifs");
232233
command.add(path);
233234
command.add(mountPoint);
234-
command.add("-o", "uid=`whoami`,gid=`whoami`");
235+
236+
if (user != null) {
237+
command.add("-o", "uid=" + user + ",gid=" + user);
238+
}
235239

236240
if (query != null) {
237241
query = query.replace('&', ',');

0 commit comments

Comments
 (0)