[PATCH] Do not rely on hardcoded path to systemd-ask-password.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 mount.cifs.c | 4 ++--
 1 file 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);
 		}
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux