summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-07-30 10:00:26 +0200
committerJeff Layton <jlayton@samba.org>2013-07-30 07:21:50 -0400
commit4e315f6a02a4edb259b33bcf0665eba259fee2f2 (patch)
tree42863f198e09f0ea864b9f816c40f9abfbd3ebc5
parent3ec619fce9abaa37edd4540840913682d48c5359 (diff)
downloadcifs-utils-4e315f6a02a4edb259b33bcf0665eba259fee2f2.tar.gz
cifs-utils-4e315f6a02a4edb259b33bcf0665eba259fee2f2.tar.bz2
cifs-utils-4e315f6a02a4edb259b33bcf0665eba259fee2f2.zip
Do not rely on hardcoded path to systemd-ask-password.
Relying on hardcoded /bin/systemd-ask-password path breaks systemd that install systemd-ask-password in /usr/bin. Since both paths are supposed to be in ${PATH} and popen() passes the command to shell, just pass 'systemd-ask-password' and let the shell find it. Fixes: https://bugzilla.samba.org/show_bug.cgi?id=10054 Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--mount.cifs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mount.cifs.c b/mount.cifs.c
index e76beee..7206dcb 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -1626,7 +1626,7 @@ drop_child_privs(void)
}
/*
- * If systemd is running and /bin/systemd-ask-password --
+ * If systemd is running and systemd-ask-password --
* is available, then use that else fallback on getpass(..)
*
* Returns: @input or NULL on error
@@ -1649,7 +1649,7 @@ get_password(const char *prompt, char *input, int capacity)
FILE *ask_pass_fp = NULL;
cmd = ret = NULL;
- if (asprintf(&cmd, "/bin/systemd-ask-password \"%s\"", prompt) >= 0) {
+ if (asprintf(&cmd, "systemd-ask-password \"%s\"", prompt) >= 0) {
ask_pass_fp = popen (cmd, "re");
free (cmd);
}