openssh-SNAP-20001207 scp "Bad file descriptor" sort-of work-around

Richard E. Silverman res at shore.net
Fri Dec 8 16:33:53 EST 2000


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 7 Dec 2000, James wrote:

> Ok, I'm having trouble with the language here.  You talk about interactive
> and non-interactive sessions, but there are, in fact, for bash:
> 
>   a) Login-interactive shells
>   b) Non-login-interactive shells
>   c) Non-interactive shells

And you're missing one: "non-login-non-interactive."  All you're pointing
out is that a shell has two binary properties: "login-ness" and
"interactive-ness."  The usual definitions of these things are reflected
in the man page for bash:

       A login shell is one whose first character of argument zero is a -,
       or one started with the -login flag.

       An  interactive shell is one whose standard input and out<AD>
       put are both connected  to  terminals  (as  determined  by
       isatty(3)), or one started with the -i option. ...

Under this definition, scp is indeed starting a non-interactive shell: it
runs ssh in a subprocess, to run scp in server mode as a remote command on
the other side. SSH does not allocate a pty on the remote side for
commands (unless forced to with the -t option).  Your shell is run as
"<shell> -c scp ..." to start the remote scp, and isatty(0) will return
false.

> You say "Your shell initialisation for non-interactive sessions must not
> produce any output."  Well, it does not, really, none at all, zip.  

How have you tested this?

> And still, scp breaks.  scp is NOT starting a _non-interactive_ shell.

What definition of "non-interactive shell" are you using?

- -- 
  Richard Silverman
  slade at shore.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.2 (GNU/Linux)
Comment: pgpenvelope 2.8.10 - http://pgpenvelope.sourceforge.net/

iD8DBQE6MHLMRF4zsgDn/HcRAhSSAJ4g8KsrlPZyLi2kheaas1TvJJCZJgCfU2/8
bzsxfjYQxkiBDQcZDxcgDJ0=
=F9Sh
-----END PGP SIGNATURE-----






More information about the openssh-unix-dev mailing list