On Fri, Mar 08, 2024 at 08:53:45AM +1100, Darren Tucker wrote:> On Fri, 8 Mar 2024 at 06:59, Corinna Vinschen <vinschen at redhat.com> wrote: > [...] > > After a lot of tinkering I found that the following change in > > dynamic-forward.sh suddenly made the test succeed. > > > > In check_socks(): > > > > ${REAL_SSH} -q -F $OBJ/ssh_config \ > > - -o "ProxyCommand ${proxycmd}${s} $h $PORT 2>/dev/null" \ > > + -o "ProxyCommand ${proxycmd}${s} $h $PORT" \ > > somehost cat ${DATA} > ${COPY} > > > > It occured to me that my login shell is tcsh, not bash. So I changed > > my login shell to bash and, lo and behold, dynamic-forward.sh succeeded > > even with the stderr redirection. > > Nice find! Wow, tsch, I don't think I've used that in this millenium!Yes, nice find.> > Having said that, can this test be changed to be independent of the > > user's long shell? > > Yes we should be able to change to something that invokes > ${TEST_SHELL} -c "[whatever]", although it might take a couple of > attempts to get the quoting right. Lemme have a try...Wouldn't it be simpler to just use '#!/bin/sh' as the shebang line for the dynamic-forward.sh script? It seems it is a long-standing shortcoming of the C shell that there is no simple way to redirect only stderr. The goal of that regression test isn't specifically to test a multitude of shell implementations, right? Kind regards, Job
Hi all, Not all systems have /bin/sh linked to /bin/bash. Regards On 2024-03-07 23:08:34, Job Snijders wrote:> On Fri, Mar 08, 2024 at 08:53:45AM +1100, Darren Tucker wrote: >> On Fri, 8 Mar 2024 at 06:59, Corinna Vinschen <vinschen at redhat.com> wrote: >> [...] >>> After a lot of tinkering I found that the following change in >>> dynamic-forward.sh suddenly made the test succeed. >>> >>> In check_socks(): >>> >>> ${REAL_SSH} -q -F $OBJ/ssh_config \ >>> - -o "ProxyCommand ${proxycmd}${s} $h $PORT 2>/dev/null" \ >>> + -o "ProxyCommand ${proxycmd}${s} $h $PORT" \ >>> somehost cat ${DATA} > ${COPY} >>> >>> It occured to me that my login shell is tcsh, not bash. So I changed >>> my login shell to bash and, lo and behold, dynamic-forward.sh succeeded >>> even with the stderr redirection. >> Nice find! Wow, tsch, I don't think I've used that in this millenium! > Yes, nice find. > >>> Having said that, can this test be changed to be independent of the >>> user's long shell? >> Yes we should be able to change to something that invokes >> ${TEST_SHELL} -c "[whatever]", although it might take a couple of >> attempts to get the quoting right. Lemme have a try... > Wouldn't it be simpler to just use '#!/bin/sh' as the shebang line for > the dynamic-forward.sh script? > > It seems it is a long-standing shortcoming of the C shell that there is > no simple way to redirect only stderr. The goal of that regression test > isn't specifically to test a multitude of shell implementations, right? > > Kind regards, > > Job > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev-- Predrag Ze?evi? predrag.zecevic.1961 at googlemail.com
On Mar 7 22:08, Job Snijders wrote:> On Fri, Mar 08, 2024 at 08:53:45AM +1100, Darren Tucker wrote: > > On Fri, 8 Mar 2024 at 06:59, Corinna Vinschen <vinschen at redhat.com> wrote: > > [...] > > > After a lot of tinkering I found that the following change in > > > dynamic-forward.sh suddenly made the test succeed. > > > > > > In check_socks(): > > > > > > ${REAL_SSH} -q -F $OBJ/ssh_config \ > > > - -o "ProxyCommand ${proxycmd}${s} $h $PORT 2>/dev/null" \ > > > + -o "ProxyCommand ${proxycmd}${s} $h $PORT" \ > > > somehost cat ${DATA} > ${COPY} > > > > > > It occured to me that my login shell is tcsh, not bash. So I changed > > > my login shell to bash and, lo and behold, dynamic-forward.sh succeeded > > > even with the stderr redirection. > > > > Nice find! Wow, tsch, I don't think I've used that in this millenium! > > Yes, nice find. > > > > Having said that, can this test be changed to be independent of the > > > user's long shell? > > > > Yes we should be able to change to something that invokes > > ${TEST_SHELL} -c "[whatever]", although it might take a couple of > > attempts to get the quoting right. Lemme have a try... > > Wouldn't it be simpler to just use '#!/bin/sh' as the shebang line for > the dynamic-forward.sh script?It's not a problem of running dynamic-forward.sh. it's running the ssh call of ProxyCommand which depends on the user's login shell. Corinna
On Fri, 8 Mar 2024 at 09:08, Job Snijders <job at openbsd.org> wrote:> Wouldn't it be simpler to just use '#!/bin/sh' as the shebang line for > the dynamic-forward.sh script?No. dynamic-forward.sh is sourced by test-exec.sh rather than being executed, and test-exec.sh is interpretted by $TEST_SHELL, which configure has determined to (hopefully) be somewhat functional. The issue is not with how dynamic-forward.sh is interpreted, it's with what ssh(1) does with its ProxyCommand, which is to give it to the user's login shell to be parsed and executed. The command at issue would also not work if invoked outside of dynamic-forward.sh for users with tcsh as their login shell. -- Darren Tucker (dtucker at dtucker.net) GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.