#397791 redir: would be nice if it worked as an SSH proxy command

Package:
redir
Source:
redir
Description:
Redirect TCP connections
Submitter:
Daniel Jacobowitz
Date:
2013-09-07 14:15:08 UTC
Severity:
wishlist
#397791#5
Date:
2006-11-09 15:05:51 UTC
From:
To:
I tried to use redir as an SSH ProxyCommand directly, e.g.:
  Host qemu-*
    ProxyCommand redir --inetd --caddr=localhost --cport=%p

It fails like this:

[pid  3193] read(4, "SSH-2.0-OpenSSH_4.3p2 Debian-5\n", 4096) = 31
[pid  3193] write(0, "SSH-2.0-OpenSSH_4.3p2 Debian-5\n", 31) = -1 EBADF (Bad
file descriptor)
[pid  3193] shutdown(0, 0 /* receive */) = -1 ENOTSOCK (Socket operation on
non-socket)

The shutdown failure's not a problem, but its tendency to write to stdin
instead of stdout is a problem; I presume that this works if the same socket
is connected on stdin and stdout using dup, since sockets are bidirectional.

#397791#10
Date:
2007-08-15 23:32:10 UTC
From:
To:
thanks for noting this.  i'm trying to sort out what it means that
this doesn't work.  Canonically, stdin is FD 0 and stdout is FD 1
(stderr is FD 2).

ssh_config(5) describes ProxyCommand as:

  The command can be basically anything, and should read from its
  standard input and write to its standard output.

But inetd(8) says that:

 The master socket will then be passed as fd 0 to the server, which
 will then need to accept the incoming connection.

and redir(1) says:

#397791#17
Date:
2013-09-07 13:38:39 UTC
From:
To:
hi tobias--

i've orphaned redir (http://bugs.debian.org/619357) -- would you be
interested in taking the package over?  If not, i intend to ask
ftp-masters to remove it from the archive.