[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cvs and heimdal



Sorry to followup on my mail yet again...

On Fri, Jul 30, 1999 at 02:21:40PM +1000, Brian May wrote:
> 0. I got rsh to work.
> 
> My /etc/inetd.conf entry is I have hacked together looks like:
> 
> kshell stream  tcp nowait root /usr/sbin/tcpd /usr/local/lib/heimdal/libexec/rshd -k -x
> 
> [655] [snoopy:bam] ~/cvswork/heimdal/appl/rsh >/usr/local/lib/heimdal/bin/rsh snoopy date
> Fri Jul 30 13:59:00 EST 1999
> [656] [snoopy:bam] ~/cvswork/heimdal/appl/rsh >/usr/local/lib/heimdal/bin/rsh -x snoopy date
> Fri Jul 30 13:59:10 EST 1999
> rsh: read: No such file or directory
> 
> To me it looks like errno is being used even though an error never
> occured, hence its value is undefined. This patch would appear to fix
> the problem:

There is still a problem is rsh. It doesn't know when to stop! Only
seems to be the case when STDIN is used, eg:

>/usr/local/lib/heimdal/bin/rsh -x snoopy cat
hello, this is just test to proove that it is working
hello, this is just test to proove that it is working
still working?
still working?
[Pushing ^D does nothing except close(0) - see below ]
[Push ^C instead]

tracing through the code, I find that the client receives an empty
packet from the server, and then just stops dead in the select call.
I think this is a case of dead-lock, as the client is waiting for the
server, while the server is waiting for the client. Anybody with
better knowledge of TCP/IP protocols then me should be able to fix it.

Here is the end of the strace of the client (AFAIK inside loop(...)):

read(4, "\0", 1)                        = 1
select(7, [0 4 6], NULL, NULL, NULL)    = 1 (in [0])
read(0, "hello, this is just test to proo"..., 16384) = 54
write(4, "hello, this is just test to proo"..., 54) = 54
select(7, [0 4 6], NULL, NULL, NULL)    = 1 (in [4])
read(4, "hello, this is just test to proo"..., 16384) = 54
write(1, "hello, this is just test to proo"..., 54) = 54
select(7, [0 4 6], NULL, NULL, NULL)    = 1 (in [0])
read(0, "still working?\n", 16384)      = 15
write(4, "still working?\n", 15)        = 15
select(7, [0 4 6], NULL, NULL, NULL)    = 1 (in [4])
read(4, "still working?\n", 16384)      = 15
write(1, "still working?\n", 15)        = 15
select(7, [0 4 6], NULL, NULL, NULL)    = 1 (in [0])
read(0, "", 16384)                      = 0
close(0)                                = 0
select(7, [4 6], NULL, NULL, NULL)      = ? ERESTARTNOHAND (To be restarted)
--- SIGINT (Interrupt) ---
+++ killed by SIGINT +++

I think the problem is that some code is missing to tell the server
that STDIN has been closed.

-- 
Brian May <bam@snoopy.apana.org.au>