Bug 1894 - nmbd_serverlistdb - An unsigned time_t type should never be equal to -1
nmbd_serverlistdb - An unsigned time_t type should never be equal to -1
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
Alpha OpenVMS
: P3 normal
: none
Assigned To: Tim Potter
Samba QA Contact
: 1895 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2004-10-08 18:28 UTC by John Malmberg
Modified: 2005-08-24 10:24 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description John Malmberg 2004-10-08 18:28:19 UTC
In the module nmbd_serverlistdb,

In the routines expire_servers(),

A comparison is being made with a time_t type to see if it is -1.

On a platform where time_t is unsigned, it can never have a negative value.

Some C compilers have an extension where they will promote the -1 to be an
unsigned type with all bits set to make this work, but I would recommend putting
a cast of (time_t) on these comparisons just to make sure that these conversions
work, as from a logical point of view, any comparison of an unsigned value with
a negative number should always be false.

See bug 1888
Comment 1 John Malmberg 2004-10-08 19:52:46 UTC
*** Bug 1895 has been marked as a duplicate of this bug. ***
Comment 2 John Malmberg 2004-10-08 20:01:49 UTC
Additional affected modules:


Comment 3 Tim Potter 2005-08-02 13:43:13 UTC
Also fixed.
Comment 4 Gerald (Jerry) Carter 2005-08-24 10:24:45 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.