On Mon, Nov 04, 2002 at 03:17:59PM +0900, Junjiro Okajima wrote:
>
> Andre Oppermann:
> > Hello LDAP fans
>
> Hello all.
>
> i am a user of pbs tools, and my friend told me there are small bugs
> in them. i checked the new source code and found it is true.
>
> pbsadd.c
>
> main() and setup()
> if ( len == 0 && len > 15 ) die_...
> sould be
> if ( len == 0 || len > 15 ) die_...
>
Approved and fixed.
> setup()
> if (control_readint(&serverport,"control/pbsport") == -1) die_control();
> should be
> if (control_readint(&serverport,"control/pbsport") != 1) die_control();
>
This is not correct, pbsport or better serverport defaults to 2821 if
~/control/pbsport is missing. So return values 0 and 1 are valid but -1 is
not. See control.c
> addenv()
> *buf++ = vlen + elen + 1; len++;
> if ( len + elen + vlen + 2 > 1024 ) {
> log_envsize();
> return olen;
> }
> assignment to *buf should be after "if (...)"
> and the similar check code after here can be omitted.
>
This is not a bug, perhaps not optimal but I modified it a bit to make the
function better readable.
> sendrequest()
> please try htons().
>
I'm using now uint16_pack_big from ucspi-tcp. Don't ask why, this is a djb
thing.
>
> and there are the similar points in pbscheck.c too.
>
Also fixed.
thanks for the report.
--
:wq Claudio