Bug 10054 - mount.cifs relies on hardcoded systemd-ask-password location
Summary: mount.cifs relies on hardcoded systemd-ask-password location
Status: RESOLVED FIXED
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: user space tools (show other bugs)
Version: 2.6
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Jeff Layton
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-29 21:00 UTC by Michał Górny
Modified: 2013-07-31 14:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny 2013-07-29 21:00:53 UTC
The current mount.cifs code does the following [1]:

  if (asprintf(&cmd, "/bin/systemd-ask-password \"%s\"", prompt) >= 0) {
    ask_pass_fp = popen (cmd, "re");
    ...

However, this doesn't work when systemd-ask-password isn't installed in /bin (and e.g. sits in /usr/bin).

I suggest simply using 'systemd-ask-password' since all relevant paths should be in $PATH, and popen() executes the command using the shell, therefore being able to make a $PATH lookup.

[1]:http://git.samba.org/?p=cifs-utils.git;a=blob;f=mount.cifs.c;h=e76beeea80dd40120501a9db966fca61436c6574;hb=HEAD#l1652
Comment 1 Jeff Layton 2013-07-30 01:11:27 UTC
Well spotted. I agree wrt to the path.

Care to propose a patch on linux-cifs mailing list?
Comment 2 Michał Górny 2013-07-30 07:59:15 UTC
Here you are: http://thread.gmane.org/gmane.linux.kernel.cifs/8697
Comment 3 Jeff Layton 2013-07-31 14:42:28 UTC
Merged in mainline cifs-utils repo. It should make 6.2, but there's no ETA for that just yet...