teatotal: Thread: teatotal on Solaris 5.8


[<<] [<] Page 1 of 1 [>] [>>]
Subject: teatotal on Solaris 5.8
From: "Steve M. Gehlbach" ####@####.####
Date: 21 May 2002 22:34:05 -0000
Message-Id: <BPEDILBPDCBCGKGGANJLKEBODKAA.steve@nexpath.com>

I finally figured out the pointer alignment problem on Solaris.

I managed to put an extra byte in the teapacket structure and force it to
align.  The solution is a little crude but it works.  Also, I think there is
a bug in the getarg.c routine in that the trailing null is not copied for
string arguments.  Original code seems to work on Linux but maybe the
malloc() zeros the memory?? not sure.  Maybe strlen() is different.

Here are the changes that compiled and passed all the tests:

-------------------------------------------------------------
arch.h:
30a31,38
> #elif defined(ARCH_SOLARIS)
> #define BIG_ENDIAN 4321
> #define BYTE_ORDER BIG_ENDIAN
> typedef unsigned long u32;
> typedef signed long s32;
> typedef unsigned short u16;
> typedef unsigned char u8;
>

config.inc:
3c3,4
< ARCH = LINUX
---
> #ARCH = LINUX
> ARCH = SOLARIS
35c36
< VERBOSE_ARGUMENT_ERRORS = N
---
> VERBOSE_ARGUMENT_ERRORS = Y

teatotal.h:
35a36
>       u8 dummy;

teaprot.c:
42c42
<               i = base64_read(state->b64, state->pkt, HEADER_LEN + 4);
---
>               i = base64_read(state->b64, state->pkt->hdr, HEADER_LEN +
4);
45c45
<       i = safe_read(state->infd, state->pkt, HEADER_LEN + 4);
---
>       i = safe_read(state->infd, state->pkt->hdr, HEADER_LEN + 4);
191c191
<               if(base64_write(state->b64, state->pkt, block_len) !=
block_len)
---
>               if(base64_write(state->b64, state->pkt->hdr, block_len) !=
block_len)
197c197
<       if(safe_write(state->outfd, state->pkt, block_len) != block_len)
---
>       if(safe_write(state->outfd, state->pkt->hdr, block_len) !=
block_len)

getarg.c:
113c113
<               len = strlen(argv[i]);
---
>               len = strlen(argv[i]) + 1;

----------------------------------------------------------------------------
-----

Thanks for a great set of programs!

/sg


Subject: Re: teatotal on Solaris 5.8
From: Alex Holden ####@####.####
Date: 29 May 2002 12:04:11 -0000
Message-Id: <3CF4C156.6020103@linuxhacker.org>

Steve M. Gehlbach wrote:
> I finally figured out the pointer alignment problem on Solaris.
> I managed to put an extra byte in the teapacket structure and force it to
> align.  The solution is a little crude but it works.  Also, I think there is

ARM had a similar (possibly the same) problem. Can you try the CVS 
snapshot and see if it fixes this problem for you?

> a bug in the getarg.c routine in that the trailing null is not copied for
> string arguments.  Original code seems to work on Linux but maybe the
> malloc() zeros the memory?? not sure.  Maybe strlen() is different.

Yes, that was another bug that I already fixed in the CVS.

The nightly CVS snapshots are available from here:
http://www.linuxhacker.org/pub/cvs-snapshots/tea-total/

-- 
------------ Alex Holden - http://www.linuxhacker.org ------------
If it doesn't work, you're not hitting it with a big enough hammer

Subject: RE: teatotal on Solaris 5.8
From: "Steve M. Gehlbach" ####@####.####
Date: 29 May 2002 22:23:10 -0000
Message-Id: <BPEDILBPDCBCGKGGANJLMEHCDKAA.steve@nexpath.com>

The May 29 version compiles and checks on Solaris 5.8 using gcc version
2.95.3 with the following:

  ARCH = UNKNOWN_BIG  in config.inc
  LDFLAGS = -lsocket  in the Makefile.

There were two compile warnings; not sure if they are significant:

randint.c: In function `generate_key':
randint.c:80: warning: pointer targets in passing arg 2 of `MD5Update'
differ in signedness

tead.c: In function `init_tead':
tead.c:65: warning: subscript has type `char'

Thanks,

Steve G.

-----Original Message-----
From: Alex Holden ####@####.####
Sent: Wednesday, May 29, 2002 4:54 AM
To: ####@####.####
Cc: ####@####.####
Subject: Re: teatotal on Solaris 5.8


Steve M. Gehlbach wrote:
> I finally figured out the pointer alignment problem on Solaris.
> I managed to put an extra byte in the teapacket structure and force it to
> align.  The solution is a little crude but it works.  Also, I think there
is

ARM had a similar (possibly the same) problem. Can you try the CVS
snapshot and see if it fixes this problem for you?

> a bug in the getarg.c routine in that the trailing null is not copied for
> string arguments.  Original code seems to work on Linux but maybe the
> malloc() zeros the memory?? not sure.  Maybe strlen() is different.

Yes, that was another bug that I already fixed in the CVS.

The nightly CVS snapshots are available from here:
http://www.linuxhacker.org/pub/cvs-snapshots/tea-total/

--
------------ Alex Holden - http://www.linuxhacker.org ------------
If it doesn't work, you're not hitting it with a big enough hammer


---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####


[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.