[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: (ITS#6324) slapd -d ? emits incorrect value for LDAP_DEBUG_ANY on x86_64
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#6324) slapd -d ? emits incorrect value for LDAP_DEBUG_ANY on x86_64
- From: jwm@horde.net
- Date: Wed, 7 Oct 2009 15:07:50 GMT
- Auto-submitted: auto-generated (OpenLDAP-ITS)
On Tue, Oct 06, 2009 at 10:04:45PM +0200, masarati@aero.polimi.it wrote:
> > The 32-bit value 4294967295 for LDAP_DEBUG_ANY is also rejected.
> > lutil_atoix() declares i as type long and tries to check for overflow(?)
> > with this cast:
> >
> > if ( (long)(int)i != i ) {
> >
> > which always fails in this case on x86_64. lutil_atoux() might be the more
> > appropriate choice here.
> >
> > str2loglevel() seems to behave correctly by virtue of verb_to_mask()
> > returning an index into loglevel_ops, but I haven't checked extensively.
> > loglevel_init(), however, does specify a hardcoded -1 for the Any level
> > instead of LDAP_DEBUG_ANY.
>
> Please check the fix in HEAD. I can't check right now on x86_64, but I'll
> probably do it tomorrow. Apparently, I didn't break anything on 32 bit.
'slapd -d ?' still lists the 64-bit value for LDAP_DEBUG_ANY on x86_64:
--
Installed log subsystems:
Any (18446744073709551615)
[...]
--
As I mentioned, this is due to the unsigned long format specifier (%lu) in
loglevel_print(). Changing the format specifier to %u emits the correct
value (4294967295) on this architecture.
With your fix, slapd accepts the numeric value 4294967295 for
LDAP_DEBUG_ANY on x86_64.
john
--
John Morrissey _o /\ ---- __o
jwm@horde.net _-< \_ / \ ---- < \,
www.horde.net/ __(_)/_(_)________/ \_______(_) /_(_)__