Bug 1895 - nmbd_serverlistdb - An unsigned time_t type should never be equal to -1
Summary: nmbd_serverlistdb - An unsigned time_t type should never be equal to -1
Status: RESOLVED DUPLICATE of bug 1894
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.0.7
Hardware: Alpha OpenVMS
: P3 normal
Target Milestone: none
Assignee: Tim Potter
QA Contact: Samba QA Contact
Depends on:
Reported: 2004-10-08 18:44 UTC by John Malmberg
Modified: 2004-10-08 19:52 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:44:06 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:44 UTC
Somehow I entered this bug in twice.

*** This bug has been marked as a duplicate of 1894 ***