commit - 3a9f646cf520cb09e23e74cf150460e7c159cd0c
commit + 9050e62864d044b4ed8dd17b06587d67cc6296f9
blob - 25818843508a92cf65312408fee40abe2028abc0
blob + aa7a9534a58d2c80e103a87a08936d9cfc8eca26
--- configure
+++ configure
Variables available:
+ SSH_PROG absolute path to the ssh(1) binary
LDADD generic linker flags
LDADD_LIBEVENT linker flags for libevent
LDADD_LIBEVENT2 linker flags for libevent2
INSTALL_MAN=
INSTALL_DATA=
PKG_CONFIG=
+SSH_PROG=
# SunOS sets "cc", but this doesn't exist.
# It does have gcc, so try that instead.
INCLUDEDIR="$val" ;;
PKG_CONFIG)
PKG_CONFIG="$val" ;;
+ SSH_PROG)
+ SSH_PROG="$val" ;;
*)
echo "$0: invalid key: $key" 1>&2
exit 1
}
}
+test -z "${SSH_PROG}" && {
+ command -v ssh 2>/dev/null 1>&2 && {
+ SSH_PROG="$(command -v ssh)"
+ echo "found ssh: $SSH_PROG" 1>&2
+ echo "found ssh: $SSH_PROG" 1>&3
+ } || {
+ echo "ssh not found: giving up" >&2
+ echo "ssh not found: giving up" >&3
+ exit 1
+ }
+}
+
+
#----------------------------------------------------------------------
# These are the values that will be pushed into config.h after we test
# for whether they're supported or not.
# define __dead __attribute__((noreturn))
#endif
+#define SSH_PROG "${SSH_PROG}"
+
#endif /*!OCONFIGURE_CONFIG_H*/
EOF
blob - 76d1c926a07fddfea1512f3aa474e861975525e1
blob + 5165c214553938162adbd3ec9fade118a9ecd5d8
--- lstun.c
+++ lstun.c
#include "log.h"
-#ifndef SSH_PATH
-#define SSH_PATH "/usr/bin/ssh"
-#endif
-
#define MAXSOCK 32
#define BACKOFF 1
#define RETRIES 16
log_warnx("fork");
return -1;
case 0:
- execl(SSH_PATH, "ssh", "-L", ssh_tflag, "-NTq", ssh_dest,
+ execl(SSH_PROG, "ssh", "-L", ssh_tflag, "-NTq", ssh_dest,
NULL);
fatal("exec");
default:
event_add(&sockev[i], NULL);
}
- if (unveil(SSH_PATH, "x") == -1)
- fatal("unveil(%s)", SSH_PATH);
+ if (unveil(SSH_PROG, "x") == -1)
+ fatal("unveil(%s)", SSH_PROG);
/*
* dns, inet: bind the socket and connect to the childs.