Skip to content

Commit

Permalink
connectors/ssh: let autoconf find default remote shell
Browse files Browse the repository at this point in the history
Problem: default remote shell is hardwired in the ssh
connector source to "/usr/bin/rsh".  On systems that don't
install "mrsh" (TOSS) and don't use debian alternatives,
/usr/bin/rsh is not a symlink to the preferred remote shell.

Have autoconf perform the search for a suitable remote
shell program, and put the results in HAVE_SSH, then
use that in the ssh connector source.

Configure searches in the current path for "rsh", then "ssh",
then falls back to /usr/bin/rsh as before if none found.
  • Loading branch information
garlick committed May 7, 2019
1 parent 7a2eb8f commit da6d740
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ else
[deepbind is unsupported with asan, musl and so-forth])
fi

# N.B. /usr/bin/rsh is a symlink to preferred remote shell on some systems
AC_PATH_PROGS(SSH, [rsh ssh], [/usr/bin/rsh])
AC_DEFINE_UNQUOTED([PATH_SSH], "$SSH",
[Define remote shell program to be used by the ssh:// connector])

LT_INIT
AC_PROG_AWK
Expand Down
4 changes: 1 addition & 3 deletions src/connectors/ssh/ssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#include "src/common/libutil/popen2.h"
#include "src/common/libutil/fdutils.h"

static const char *default_ssh_cmd = "/usr/bin/rsh";

#define CTX_MAGIC 0xe534babb
typedef struct {
int magic;
Expand Down Expand Up @@ -361,7 +359,7 @@ flux_t *connector_init (const char *path, int flags)
c->magic = CTX_MAGIC;

if (!(c->ssh_cmd = getenv ("FLUX_SSH")))
c->ssh_cmd = default_ssh_cmd;
c->ssh_cmd = PATH_SSH;
if (argz_add (&c->ssh_argz, &c->ssh_argz_len, c->ssh_cmd) != 0)
goto error;
if (parse_ssh_port (c, path) < 0) /* [-p port] */
Expand Down

0 comments on commit da6d740

Please sign in to comment.