[erlang-bugs] standard ssh to erlang sshd gives default shell, not the one specified in ssh:daemon/3
Niclas Eklund
nick@REDACTED
Mon Aug 2 14:22:09 CEST 2010
Hello!
Try something like:
Exec = {Module, Function, ArgList},
ssh:daemon({0,0,0,0}, <PORT>, [{exec, Exec}|Options]).
Best regards,
Niclas @ Erlang/OTP
On Mon, 26 Jul 2010, andrei zavada wrote:
> Hi,
>
> Consider the case of starting ssh:daemon/3 with bespoke shell supplied as
> {shell, {Module, Function, Args}} in the proplist as its third parameter.
>
> Everything works as expected if I just do (using openssh-5.5_p1, the current
> version in Gentoo per this writing)
>
> $ ssh -p<port> localhost
>
> My shell is now invoked and is happily serving commands. Once I try the same
> with a command-line parameter, i.e.,
>
> $ ssh -p<port> localhost fafa
>
> (expecting "fafa" to be passed to my shell function), the server hands "fafa"
> over to the Erlang standard shell, which prints:
>
> {error,{1,erl_parse,["syntax error before: ",[]]}}
>
> And, logically, appending a dot to "fafa" makes it a valid Erlang expression,
> which gets me a nice
>
> fafa
>
> The expected behaviour is that sshd accept the command and feed it to the
> custom shell the user specified in the Options proplist.
>
> This misbehaviour is verified in otp-12B-5, otp-13B04, as well as in otp-14A.
> All systems were tested on a Gentoo box (~amd64 arch), built from unpatched
> sources from erlang.org.
>
> Is this a bug, as I suppose it is?
>
> Regards
> Andrei Zavada
>
> ________________________________________________________________
> erlang-bugs (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-bugs-unsubscribe@REDACTED
>
More information about the erlang-bugs
mailing list