]> granicus.if.org Git - pdns/commitdiff
and use the newly defined insert-record-query-auth
authorBert Hubert <bert.hubert@netherlabs.nl>
Thu, 24 Mar 2011 13:54:40 +0000 (13:54 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Thu, 24 Mar 2011 13:54:40 +0000 (13:54 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2095 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/backends/gsql/gsqlbackend.cc

index e46cebe76693e4edac8b101b7e396853ca5ce0f6..0bcaea7577aa885706e22e8c8be71e79192ebe82 100644 (file)
@@ -246,7 +246,7 @@ GSQLBackend::GSQLBackend(const string &mode, const string &suffix)
   d_InfoOfAllSlaveDomainsQuery=getArg("info-all-slaves-query");
   d_SuperMasterInfoQuery=getArg("supermaster-query");
   d_InsertSlaveZoneQuery=getArg("insert-slave-query");
-  d_InsertRecordQuery=getArg("insert-record-query");
+  d_InsertRecordQuery=getArg("insert-record-query"+authswitch);
   d_UpdateSerialOfZoneQuery=getArg("update-serial-query");
   d_UpdateLastCheckofZoneQuery=getArg("update-lastcheck-query");
   d_InfoOfAllMasterDomainsQuery=getArg("info-all-master-query");
@@ -694,11 +694,22 @@ bool GSQLBackend::get(DNSResourceRecord &r)
 bool GSQLBackend::feedRecord(const DNSResourceRecord &r)
 {
   char output[10240];
-  snprintf(output,sizeof(output)-1,d_InsertRecordQuery.c_str(),
+  if(d_dnssecQueries) {
+    snprintf(output,sizeof(output)-1,d_InsertRecordQuery.c_str(),
+          sqlEscape(r.content).c_str(),
+          r.ttl, r.priority,
+          sqlEscape(r.qtype.getName()).c_str(),
+          r.domain_id, toLower(sqlEscape(r.qname)).c_str(), (int)r.auth); 
+  }
+  else {
+    snprintf(output,sizeof(output)-1,d_InsertRecordQuery.c_str(),
           sqlEscape(r.content).c_str(),
           r.ttl, r.priority,
           sqlEscape(r.qtype.getName()).c_str(),
           r.domain_id, toLower(sqlEscape(r.qname)).c_str()); 
+  }
+     
+     
   try {
     d_db->doCommand(output);
   }