Skip to content

Commit cb68f2c

Browse files
authored
Merge pull request #4532 from grondo/issue#3731
fix ssh connector with csh/tcsh shells
2 parents 5ca42d9 + f5b1924 commit cb68f2c

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/connectors/ssh/ssh.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ int build_ssh_command (const char *uri_path,
152152

153153
/* LD_LIBRARY_PATH */
154154
if (ld_lib_path) {
155+
if (argz_add (&argz, &argz_len, "env") != 0)
156+
goto nomem;
155157
(void)snprintf (buf, sizeof (buf), "LD_LIBRARY_PATH=%s", ld_lib_path);
156158
if (argz_add (&argz, &argz_len, buf) != 0)
157159
goto nomem;

t/scripts/tssh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ echo hostname=${hostname} >&2
2525
echo cmd=\"$*\" >&2
2626

2727
unset FLUX_URI
28-
eval $*
28+
exec $SHELL -c "$*"

t/t1106-ssh-connector.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ test_expect_success 'ssh:// with local sockdir works' '
2121
grep hostname=localhost basic.err &&
2222
grep cmd= basic.err | grep "flux relay $TEST_SOCKDIR"
2323
'
24+
test -x /bin/tcsh && test_set_prereq HAVE_TCSH
25+
test_expect_success HAVE_TCSH 'ssh:// with local sockdir and SHELL=tcsh works' '
26+
FLUX_URI=ssh://localhost${TEST_SOCKDIR} \
27+
FLUX_SSH=$TEST_SSH \
28+
SHELL=/bin/tcsh \
29+
flux getattr size 2>basic.err &&
30+
grep hostname=localhost basic.err &&
31+
grep cmd= basic.err | grep "flux relay $TEST_SOCKDIR"
32+
'
2433

2534
test_expect_success 'ssh:// with local sockdir and port works' '
2635
FLUX_URI=ssh://localhost:42${TEST_SOCKDIR} FLUX_SSH=$TEST_SSH \

0 commit comments

Comments
 (0)