Operating System - HP-UX
1823064 Members
3220 Online
109645 Solutions
New Discussion юеВ

HP telnet/telnetd truncates large commands

 
Hani ElHaffar
New Member

HP telnet/telnetd truncates large commands

I have a HP 9000 machine running HP UX 11. I then telnet to that HP machine, and from there telent to a Sun machine running Solaris 2.6. Now when I send a large command (~500 characters) the HP machine is removing the first 480 characters, and only sending the last 20 or so characters to the Sun machine. The Sun machine then reports an error b/c the command is incomplete. Does anyone know why HP telnet does this, and how to solve this issue? I have gathered tcp dumps using ethereal just to be sure, and I can provide them.
15 REPLIES 15
Ron Kinner
Honored Contributor

Re: HP telnet/telnetd truncates large commands

How are you inputting the 500 characters? Are you typing all 500 in or do you have a file that you copy and paste?

Have you tried telneting directly from the HP's console? Does it still mess up? What are you telneting from?

Do your tcpdumps show the 500 characters reaching the HP but only 20 leaving or are you monitoring at the Sun end. Does the whole string fit in one packet? How big is the packet?

What is the MTU on all links?

Ron
avsrini
Trusted Contributor

Re: HP telnet/telnetd truncates large commands

Hi,
In hp the max command line length is 256 bytes only. check the following

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000065680011

But when you are telneting to solaris, that shell has to take care of the command lenght.

I'll search for more info, if i get some, i'll update you.

Srini.
Be on top.
Jeff Schussele
Honored Contributor

Re: HP telnet/telnetd truncates large commands

Hey Ron...one more & you would have had a top-ten there buddy. =:)

Cheers,
Jeff (Who's elbow's firmly extended into ribs & betting it'll take Hani a while)

PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: HP telnet/telnetd truncates large commands

....to reply to them all....

Ummmm,
Jeff (who should have added that....)
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Hani ElHaffar
New Member

Re: HP telnet/telnetd truncates large commands

Thanks for your help... Here are the answers to your questions:
1. How are you inputting the 500 characters? Are you typing all 500 in or do you have a file that you copy and paste?

I am inputting the entire 500 characters in one go. That is they are all being sent in one telnet packet.

2. Have you tried telneting directly from the HP's console? Does it still mess up? What are you telneting from?

I cannot telnet directly from the HP box b/c it is setup as a "headless" machine (ie, no CDE running, no monitor, no keyboard etc). Basically it is a standalone server, so I have to telnet to it first.
I am telneting from a Red Hat 6.2 Linux machine.

3. Do your tcpdumps show the 500 characters reaching the HP but only 20 leaving or are you monitoring at the Sun end. Does the whole string fit in one packet? How big is the packet?

Yes the tcp dumps show the ~500 characters reaching the HP, but only ~20 are leaving the HP machine. I have monitored from both the HP and Sun machine. It is the HP machine that is truncating the command.
Yes the whole string fits into one Telnet/TCP packet.

Ok here are the actual figures-

Total Packet size: 610 bytes
Ethernet: 14 bytes
IP Header Length: 20 bytes
TCP Header Length: 32 bytes
Telnet Data Length: 544 bytes


Total Packet size: 86 bytes
Ethernet: 14 bytes
IP Header Length: 20 bytes
TCP Header Length: 20 bytes
Telnet Data Length: 32 bytes

4. What is the MTU on all links?
MTU on the HP and Solaris machines is 1500

Please let me know if you need more info. Thanks!
Hani ElHaffar
New Member

Re: HP telnet/telnetd truncates large commands

Srini thanks for your suggestion. I found that limitation myself, and so I installed bash on the HP machine, and set that to be the default shell. Bash allows you more than 256 characters. In fact, if I just telnet only to the HP machine I can do an echo of the ~500 character command on the shell, which is echoed correctly. The HP is recieving the ~500 characters correctly, but it is just not sending it out!

Yes Solaris is running the Zshell by default as well, and that accepts the ~500 characters. I have verified that as well.

In any case I dont think the shell has anything to do with this problem, b/c I am not issueing any commands to the HP shell. Telnet is running in the shell, so telnet is the application processing the data.
Ron Kinner
Honored Contributor

Re: HP telnet/telnetd truncates large commands

Near as I can tell the usual buffer is 1024 which should be big enough.

If you telnet to the Sun and open a VI session then open it for edit with an "i" then paste the whole 500 characters command does that work?

Logon to the HP. Do

stty -a

and post the output.

Then logon to your Sun and repeat.

Also post the output.

I'm thinking the rows=30 might be biting you. (at least that's what mine says it is set to) You say your actual telnet data package is 32 which with a couple of control characters is essentially 30. I'm wondering if this is more than a coincidence.

You might also check the .profile and .environ to see if anything funky is going on there.

Ron



Ron Kinner
Honored Contributor

Re: HP telnet/telnetd truncates large commands

Oops forget about the rows =30. Mistook that for the columns=80, But I still think we need to look at the stty -a stuff. Especially if the paste to vi works.

Ron
Hani ElHaffar
New Member

Re: HP telnet/telnetd truncates large commands

Hi Ron,

The pasting into vi on the Sun machine directly works (this is without using the HP machine as a go between).
Here is the output for stty:

HP machine-
-bash-2.05b$ stty -a
speed 0 baud; line = 0;
rows = 0; columns = 0
min = 4; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp ; dsusp
werase ; lnext
parenb -parodd cs7 -cstopb hupcl -cread -clocal -loblk -crts
-ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon -ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop
-bash-2.05b$


Sun Machine:
brc2s07f% stty -a
speed 38400 baud;
csdata ?
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^h; kill = ^u;
eof = ^d; eol = ; eol2 = ; swtch = ;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff -pare
xt
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
brc2s07f%
Ron Kinner
Honored Contributor

Re: HP telnet/telnetd truncates large commands

I am still interested in whether the paste into VI works when you telnet through the HP.

I'm wondering if there is something in the command that is causing it to act funny. Can you just send something like aaaa...aaa (the same number of a's as you have characters in the command and see what happens.

If that works can you just send half of the original command and see what happens. If that doesn't go through then half of that command until it works then increase by degrees until you determine exactly how long a command it will take. How small does the command have to be to work and what characters are directly preceding the cutoff?


Ron
Hani ElHaffar
New Member

Re: HP telnet/telnetd truncates large commands

Hi Ron,

The paste into vi, telneting thru the HP machine to the Sun machine does not work. I just tried typing in useless characters like you suggested, and it seems the HP will only allow upto 512 bytes of data at a time in a Telnet packet. Anything above that number, and HP telnet will just delete the first 512 bytes, and send whatever comes after that. It almost seems like a buffer overflow problem. Maybe telnet has a hard coded 512 character buffer size on HP-UX. Is there any way to report this back to HP, or get one of their engineers to take a look?

I also tried updating the telnet app on the HP system. I downloaded the latest telnet patch from HP support PHNE_24829 and that did not resolve the issue.
Ron Kinner
Honored Contributor

Re: HP telnet/telnetd truncates large commands

It does appear that HP's telnet has a 512 character limitation. The 512 number makes it look very much like a buffer problem. I have been unsuccessful in finding a way to increase it. As a work around can you send it in two packets with a backslash at the end of the first one?

Could you perhaps write a script on the sun to generate the command based on some input variables?

Also you might want to look at trying to replace HP's telnet with something like Kerberos' http://www.pdc.kth.se/kth-krb/
I notice they report fixing several buffer overflow problems in telnetd on their website.


As for how to report this to HP the normal procedure assumes you have a service contract then you just open a ticket with them. I do not have a service contract and I am not really knowledgeable about HP so I don't even know how to do that.

Rick Jones from HP appears to have an insight into their networking software. You might try to contact him directly. I won't post his email address since that's not polite but if you search for

"rick jones" hp

on www.google.com you will see several versions of his email address. I presume the one with tardy in it is the latest.

Ron
Kuppens Danny
New Member

Re: HP telnet/telnetd truncates large commands

Hi all,

Interesting problem we are facing similar problems in our labs here in Brussels:

1:See following connection schema:
PC --TCP/IP-> HPUX11.11--TCP/IP-->SUNSol2.8

2: Test Scenario:
From the PC:
-First telnet(Exceed???s telnet) to the HP server:
- telnet
- From here (connected to hp) I do telnet to the SUN server:
- telnet
- Connected via telnet to SUN trough HP I do:
- cat >
- From my PC I ???paste??? a file on the telnet session containing the cat command.
- Note the paste buffer contain only ACSII characters copied from notepad.
- I end with D.
- Compare size with wc of :.

3: Results:
3.a: with size of paste buffer < 1024 are ok, pasting file > 1024 are not correctly transmitted:
# wc -c *
1023 num1023 =paste buffer = 1023 char
1024 num1024 =paste buffer = 1024 char
513 num1025 =paste buffer = 1025 char
1025 rlog1025
1250 rlog1250
738 telnet1250

3.b: The same test but with rlogin instead of telnet from HP to SUN give a correct file size:
see rlog1250 !!!

3.c: When changing the roles and first login on SUN than on HP and paste on an HP file gives a correct transmission.

3.d: We also have a Solaris PC in the lab also paste from HP to Sun was failing.

3.e: When using instead of the Exceed telnet the native Windows2000 telnet or the Hyperterm window command buffers > 1024 are correctly pasted.

I have feeling facing a 1024 bytes limit somewhere ??...

Who can help? Any advise? Can telnet params be changed?

Kind Regards,
Danny Kuppens




The worst feedback is no feedback
rmahesh
New Member

Re: HP telnet/telnetd truncates large commands

Hi All,

I too face the same problem here. Is there anything to change with the ".profile" ? If any of you come across a better solution, it will be helpful for everybody if it is published here.

Thanks and Regards,
- Mahesh R
rmahesh
New Member

Re: HP telnet/telnetd truncates large commands

Hi,

Please include ixoff to your .profile in the unix environment. This worked for us and hope it might help you also. Go to '$ vi .profile' and enter ixoff or -ixoff and that should work.

Hence when you see the "stty" setting, it will look like this.

>sh -c "stty"
speed 9600 baud; evenp hupcl -cread
min = 1; quit = ^_; erase = ^H; kill = ^U;
swtch ;
brkint -inpck icrnl -ixany ixoff onlcr nul-fill tab3
-iexten echo echoe -echok
-echoctl ├в echoke

All the Best

- Regards
Mahesh R