Skip to contentSkip to conversation

Add configure check for the path to systemd-ask-password

PATCH In review Mike Gilbert 4 participants 4 messages Jul 3, 2014 – Sep 6, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add configure check for the path to systemd-ask-password

Gentoo Linux installs this in /usr/bin by default. Also, the user may have installed it in /usr/local/bin if building from source.

---
 configure.ac          | 3 +++
 src/openvpn/console.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
configure.ac +3 -0
index 77e950d..faa2c4a 100644
@@ -368,15 +368,18 @@ AC_ARG_VAR([IPROUTE], [full path to ip utility])
 AC_ARG_VAR([NETSTAT], [path to netstat utility]) # tests
 AC_ARG_VAR([MAN2HTML], [path to man2html utility])
 AC_ARG_VAR([GIT], [path to git utility])
+AC_ARG_VAR([SYSTEMD_ASK_PASSWORD], [path to systemd-ask-password utility])
 AC_PATH_PROGS([IFCONFIG], [ifconfig],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
 AC_PATH_PROGS([ROUTE], [route],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
 AC_PATH_PROGS([IPROUTE], [ip],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
+AC_PATH_PROGS([SYSTEMD_ASK_PASSWORD], [systemd-ask-password],, [$PATH:/usr/local/bin:/usr/bin:/bin])
 AC_CHECK_PROGS([NETSTAT], [netstat], [netstat], [$PATH:/usr/local/sbin:/usr/sbin:/sbin:/etc]) # tests
 AC_CHECK_PROGS([MAN2HTML], [man2html])
 AC_CHECK_PROGS([GIT], [git]) # optional
 AC_DEFINE_UNQUOTED([IFCONFIG_PATH], ["$IFCONFIG"], [Path to ifconfig tool])
 AC_DEFINE_UNQUOTED([IPROUTE_PATH], ["$IPROUTE"], [Path to iproute tool])
 AC_DEFINE_UNQUOTED([ROUTE_PATH], ["$ROUTE"], [Path to route tool])
+AC_DEFINE_UNQUOTED([SYSTEMD_ASK_PASSWORD_PATH], ["$SYSTEMD_ASK_PASSWORD"], [Path to systemd-ask-password tool])
 
 #
 # Libtool
src/openvpn/console.c +1 -1
index afda8ca..059b6f0 100644
@@ -162,7 +162,7 @@ get_console_input_systemd (const char *prompt, const bool echo, char *input, con
   struct argv argv;
 
   argv_init (&argv);
-  argv_printf (&argv, "/bin/systemd-ask-password");
+  argv_printf (&argv, SYSTEMD_ASK_PASSWORD_PATH);
   argv_printf_cat (&argv, "%s", prompt);
 
   if ((std_out = openvpn_popen (&argv, NULL)) < 0) {
Signature · 1 line
2.0.0
#1 lore raw

From: David Sommerseth <[email protected]...>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your patch has been applied to the master branch.

commit ba79c71d1255651bfcb8570519b4033c763d47d3

Author: Mike Gilbert
Date:   Thu Jul 3 16:24:05 2014 -0400
     Add configure check for the path to systemd-ask-password

     Acked-by: David Sommerseth <[email protected]...>
     Message-Id: [email protected]...
     URL: http://article.gmane.org/gmane.network.openvpn.devel/8825
     Signed-off-by: David Sommerseth <[email protected]...>

- --
kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlQJwhYACgkQDC186MBRfrqkhwCeImXXmCZE9u4D5pTvyww4phnU NeYAn1dPujlOE6fKUqvnlBPZuTUtV34m
=d+PW
-----END PGP SIGNATURE-----

#2 lore raw
In reply to Mike Gilbert

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Mike Gilbert

Gentoo Linux installs this in /usr/bin by default. Also, the user may have installed it in /usr/local/bin if building from source.

ACK. Also considering that Fedora have moved /{bin,sbin} to /usr/{bin,sbin}, this makes a lot of sense. More Linux distros may be on the same path as well.

- --
kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlQJw58ACgkQDC186MBRfrqlDQCfWPlExpi46t7oOdZObDucIseL IlYAoKbCGExCNgAijRq4JeYtN9v0CylX
=oHk/
-----END PGP SIGNATURE-----

#3 lore raw

Hi,

Quoted 7 lines · David Sommerseth
Quoted 2 lines · Mike Gilbert

Gentoo Linux installs this in /usr/bin by default. Also, the user may have installed it in /usr/local/bin if building from source.

ACK. Also considering that Fedora have moved /{bin,sbin} to /usr/{bin,sbin}, this makes a lot of sense. More Linux distros may be on the same path as well.

Yeah, double-ACK. Hardcoding program paths in the middle of C code is something we should have never merged in the first place :)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...