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

Re: another rsh fix



This is a weird problem using CVS over Heimdal rsh. I have a script,
rshx, that calls Heimdal rsh with "-x". That is, I have set CVS_RSH to "rshx".
This mainly works, except for when too many files have to be updated(?).
For instance:

[527] [silas-2:bam] ~/cvswork/heimdal/appl/kx >cvs update
cvs server: Updating .
M kxd.c
[528] [silas-2:bam] ~/cvswork/heimdal/appl/kx >cd ..
[529] [silas-2:bam] ~/cvswork/heimdal/appl >cvs update
cvs [update aborted]: end of file from server (consult above messages if any)

Now that is understandable that there still may be problems with rshx.
What I find incredibly hard to believe, is that the same command
works fine on Ultrix!!!!!

The problem occurs on OSF/1 V4.0 Heimdal 0.1m. The server in both cases
is Linux Heimdal 0.1m.

I put a bit of debugging into my rshx script:

[537] [silas-2:bam] ~/cvswork/heimdal/appl >cvs update
rsh snoopy.apana.org.au -x -lbam cvs server
rsh: read: Connection reset by peer
cvs [update aborted]: end of file from server (consult above messages if any)
[538] [silas-2:bam] ~/cvswork/heimdal/appl >

The 2nd line from the top is the full command (without quotes) that
is executed. It looks fine to me.


Looking at the strace listing, it would look like the remote end closes
STDOUT and STDERR, before STDIN is closed. My shutdown call is never used,
so that shouldn't be a problem.


Here is the strace listing. The blank lines are mine. I think
the most significant thing I can see, is that only one
response is received from the remote end before it closes
the connection. (which really surpises me even more as to why
using the Ultrix client avoids the problem - it looks like a server
problem.) Note: The round trip time on this network connection
is min/avg/max = 345/721/1518 ms.

Which brings me to another point: It looks
like rsh is sending the request to the remote server, in plain text...
That is the 3-6 write calls to the network scoket, 4, are not encrypted.
Is this meant to happen? It doesn't look too secure to me...

write(4, "\0\0\2/", 4)                  = 4
write(4, "n\202\2+0\202\2\'\240\3\2\1\5\241"..., 559) = 559
read(4, "\0\0\0\0", 4)                  = 4
read(4, "\0\0\0[", 4)                   = 4
read(4, "oY0W\240\3\2\1\5\241\3\2\1\17\242"..., 91) = 91
old_getsockname()                       = 0
old_getpeername()                       = 0
write(4, "bam\0", 4)                    = 4
write(4, "-x ", 3)                      = 3
write(4, "cvs server\0", 11)            = 11
write(4, "bam\0", 4)                    = 4
write(4, "\0\0\0\0", 4)                 = 4
read(4, "\0", 1)                        = 1

select(9, [0 4 8], NULL, NULL, NULL)    = 1 (in [0])
read(0, "Root /homes/bam/cvsroot\nValid-r"..., 16384) = 381
write(4, "\0\0\1}", 4)                  = 4
write(4, "3\226W\256Kf\177\1\343\331R*\353"..., 416) = 416

select(9, [0 4 8], NULL, NULL, NULL)    = 1 (in [4])
read(4, "\0\0\2,", 4)                   = 4
read(4, "\374\347\374\374,:j\352>\2724\270"..., 584) = 584
write(1, "Valid-requests Root Valid-respon"..., 556) = 556

select(9, [0 4 8], NULL, NULL, NULL)    = 1 (in [0])
read(0, "UseUnchanged\n", 16384)        = 13
write(4, "\0\0\0\r", 4)                 = 4
write(4, "?\334\310I$bU\324\222\251\34\"\372"..., 48) = 48

select(9, [0 4 8], NULL, NULL, NULL)    = 1 (in [0])
read(0, "Argument -u\nDirectory .\n/homes"..., 16384) = 16384
obreak(0x14001a000)                     = 0
write(4, "\0\0@\0", 4)                  = 4
write(4, "\217\276\22\20269`\3\rr\36:.\fS\21"..., 16416) = 16416

select(9, [0 4 8], NULL, NULL, NULL)    = 1 (in [0])
read(0, "_X11_PIPES */\n\t\t    } else\n\t"..., 16384) = 12291
obreak(0x14000c000)                     = 0
obreak(0x14001a000)                     = 0
write(4, "\0\0000\3", 4)                = 4
write(4, "Y@O\323\230\374\212`\23O\265^1\3"..., 12320) = 12320

select(9, [0 4 8], NULL, NULL, NULL)    = 1 (in [4])
read(4, "", 4)                          = 0
close(4)                                = 0

select(9, [0 8], NULL, NULL, NULL)      = 1 (in [8])
read(8, "", 4)                          = 0
close(8)                                = 0
close(4)                                = -1 EBADF (Bad file number)
close(0)                                = 0
close(1)                                = 0
close(2)                                = 0
close(5)                                = 0
SYS_310(0x1, 0xfffffffffffff137, 0)     = 0
exit(0)                                 = ?

-- 
Brian May <bmay@csse.monash.edu.au>