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>
}
/*
- * 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
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);
}