teatotal: teatotal on Solaris 5.8


Previous by date: 21 May 2002 22:34:05 -0000 Solaris help?, Steve M. Gehlbach
Next by date: 21 May 2002 22:34:05 -0000 Re: teatotal on Solaris 5.8, Alex Holden
Previous in thread:
Next in thread: 21 May 2002 22:34:05 -0000 Re: teatotal on Solaris 5.8, Alex Holden

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



Previous by date: 21 May 2002 22:34:05 -0000 Solaris help?, Steve M. Gehlbach
Next by date: 21 May 2002 22:34:05 -0000 Re: teatotal on Solaris 5.8, Alex Holden
Previous in thread:
Next in thread: 21 May 2002 22:34:05 -0000 Re: teatotal on Solaris 5.8, Alex Holden


Powered by ezmlm-browse 0.20.