severe (?) error in tdb.c

Andreas Moroder claudiamoroder at st-ulrich.suedtirol.net
Sat Sep 22 23:27:04 GMT 2001


Hello Jeremy,

i found this using lclint. on tdb.c.
lclint gives me many other warnings about assignment between signed and
unsigned variables.
Most of this warnings depend on the fact that tdb_len and tdb_off are
defined as unsigned while size_t type values are assigned to them.
What is the reason not to define tdb_len and tdb_off as signed ? The 2 MB
limit is allways set by the standard write, read etc. functions.

Best regards
Andreas

-----Ursprüngliche Nachricht-----
Von: "Jeremy Allison" <jra at samba.org>
An: "Jeremy Allison" <jra at samba.org>
Cc: "andreas moroder" <claudiamoroder at st-ulrich.suedtirol.net>;
<samba-technical at lists.samba.org>
Gesendet: Samstag, 22. September 2001 21:14
Betreff: Re: severe (?) error in tdb.c


> On Sat, Sep 22, 2001 at 12:09:59PM -0700, Jeremy Allison wrote:
>
> > off in a struct tdb_traverse_lock is defined as u32, so the value
> > would have to be 0x7FFFFFFF. This means there is a restriction on
> > a tdb file of 2GB, which is not unreasonable (IMHO).
> >
> > We should document it though.
>
> Ok, looking a little more closely, u32 is defined as "unsigned",
> which may (on some compilers) map to a 16 bit unsigned int.
>
> But tdb would fail completely (handling large files) if int was only
> 16 bits, so my feeling is we should test for this at autoconf time, and
> fail the compile if this is so.
>
> Jeremy.





More information about the samba-technical mailing list