Uploaded image for project: 'Support'
  1. Support
  2. SUPPORT-16

Please remove db specific code from non-ksm directory

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: OpenDNSSEC 2.0
    • Fix Version/s: OpenDNSSEC 1.4.0b1
    • Component/s: Enforcer
    • Labels:
      None

      Description

      ./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.

        Attachments

          Activity

            People

            Assignee:
            sion SiƓn Lloyd
            Reporter:
            nobody Nobody Nogroup
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: