[Opendnssec-develop] [OpenDNSSEC] #121: Please remove db specific code from non-ksm directory

OpenDNSSEC owner-dnssec-trac at kirei.se
Wed Mar 24 22:36:27 UTC 2010


#121: Please remove db specific code from non-ksm directory
------------------------------------------+---------------------------------
Reporter:  Ondřej Surý <ondrej@…>         |       Owner:  sion    
    Type:  enhancement                    |      Status:  new     
Priority:  minor                          |   Component:  Enforcer
 Version:  trunk                          |    Keywords:          
------------------------------------------+---------------------------------
 ./enforcerd/enforcer.c has:
 {{{
 #ifdef USE_MYSQL
     nchar = snprintf(buffer, sizeof(buffer),
         "and DEAD < DATE_ADD('%s', INTERVAL -%d SECOND) ", rightnow,
 interval);
 #else
     nchar = snprintf(buffer, sizeof(buffer),
         "and DEAD < DATETIME('%s', '-%d SECONDS') ", rightnow, interval);
 #endif /* USE_MYSQL */
 }}}

 And utils/ksmutil.c has:

 {{{
 #ifdef USE_MYSQL
     nchar = snprintf(buffer, sizeof(buffer),
         "DATE_ADD('%s', INTERVAL %d SECOND) ", datetime,
 collection.ksklife);
 #else
     nchar = snprintf(buffer, sizeof(buffer),
         "DATETIME('%s', '+%d SECONDS') ", datetime, collection.ksklife);
 #endif /* USE_MYSQL */
 }}}

 Adding little helper function to libksm could be a solution.

 This would allow dynamic compilation of libksm and simple swap between
 sqlite3 and mysql backends without exchanging binaries.

-- 
Ticket URL: <http://trac.opendnssec.org/ticket/121>
OpenDNSSEC <http://www.opendnssec.org/>
OpenDNSSEC


More information about the Opendnssec-develop mailing list