[Opendnssec-develop] [OpenDNSSEC] #89: bug in logging.c
OpenDNSSEC
owner-dnssec-trac at kirei.se
Wed Jan 27 13:01:01 UTC 2010
#89: bug in logging.c
--------------------+-------------------------------------------------------
Reporter: mdavids | Owner: rb
Type: defect | Status: new
Priority: minor | Component: Unknown
Version: trunk | Keywords:
--------------------+-------------------------------------------------------
There is a bug in the 'facility2int' function in
logging.c.
else if (strncmp(dup, "LOCAL0", 6) && strlen(dup) == 6)
*fac = LOG_LOCAL0;
and all the other ones in that same statement seem to have the wrong
effect. When 'dup' is 'LOCAL0', the return value of strncmp is zero,
hence the if-statement will fail, where it was suppose to be succesful,
Solution:
else if (strncmp(dup, "LOCAL0", 6) == 0 && strlen(dup) == 6)
*fac = LOG_LOCAL0;
Or
else if (! strncmp(dup, "LOCAL0", 6) && strlen(dup) == 6)
*fac = LOG_LOCAL0;
--
Marco Davids
--
Ticket URL: <http://trac.opendnssec.org/ticket/89>
OpenDNSSEC <http://www.opendnssec.org/>
OpenDNSSEC
More information about the Opendnssec-develop
mailing list