Changeset 2429

Show
Ignore:
Timestamp:
02/27/12 11:47:17 (2 years ago)
Author:
peter
Message:

fix NSEC wraparound

Location:
trunk/pdns
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/modules/gmysqlbackend/gmysqlbackend.cc

    r2326 r2429  
    8888    declare(suffix,"insert-record-query-auth","", "insert into records (content,ttl,prio,type,domain_id,name,auth) values ('%s',%d,%d,'%s',%d,'%s', '%d')"); 
    8989     
     90    declare(suffix,"get-order-first-query","DNSSEC Ordering Query, first", "select ordername, name from records where auth=1 and domain_id=%d order by 1 asc limit 1"); 
    9091    declare(suffix,"get-order-before-query","DNSSEC Ordering Query, before", "select ordername, name from records where ordername <= '%s' and auth=1 and domain_id=%d order by 1 desc limit 1"); 
    9192    declare(suffix,"get-order-after-query","DNSSEC Ordering Query, after", "select min(ordername) from records where ordername > '%s' and auth=1 and domain_id=%d"); 
    9293    declare(suffix,"get-order-last-query","DNSSEC Ordering Query, last", "select ordername, name from records where ordername != '' and auth=1 and domain_id=%d order by 1 desc limit 1"); 
    9394    declare(suffix,"set-order-and-auth-query", "DNSSEC set ordering query", "update records set ordername='%s',auth=%d where name='%s' and domain_id='%d'"); 
    94      
    9595     
    9696    declare(suffix,"update-serial-query","", "update domains set notified_serial=%d where id=%d"); 
  • trunk/pdns/modules/gpgsqlbackend/gpgsqlbackend.cc

    r2326 r2429  
    8585    declare(suffix,"insert-record-query-auth","", "insert into records (content,ttl,prio,type,domain_id,name,auth) values (E'%s',%d,%d,'%s',%d,E'%s', '%d')"); 
    8686     
     87    declare(suffix,"get-order-first-query","DNSSEC Ordering Query, last", "select ordername, name from records where auth and domain_id=%d order by 1 asc limit 1"); 
    8788    declare(suffix,"get-order-before-query","DNSSEC Ordering Query, before", "select ordername, name from records where ordername <= E'%s' and auth and domain_id=%d order by 1 desc limit 1"); 
    8889    declare(suffix,"get-order-after-query","DNSSEC Ordering Query, after", "select min(ordername) from records where ordername > E'%s' and auth and domain_id=%d"); 
  • trunk/pdns/modules/gsqlite3backend/gsqlite3backend.cc

    r2326 r2429  
    8484    declare(suffix,"list-query-auth","AXFR query", "select content,ttl,prio,type,domain_id,name, auth from records where domain_id='%d' order by name, type"); 
    8585     
     86    declare(suffix,"get-order-first-query","DNSSEC Ordering Query, first", "select ordername, name from records where auth=1 and domain_id=%d order by 1 asc limit 1"); 
    8687    declare(suffix,"get-order-before-query","DNSSEC Ordering Query, before", "select ordername, name from records where ordername <= '%s' and auth=1 and domain_id=%d order by 1 desc limit 1"); 
    8788    declare(suffix,"get-order-after-query","DNSSEC Ordering Query, after", "select min(ordername) from records where ordername > '%s' and auth=1 and domain_id=%d"); 
  • trunk/pdns/pdns/backends/gsql/gsqlbackend.cc

    r2326 r2429  
    282282  if (d_dnssecQueries) 
    283283  { 
     284    d_firstOrderQuery = getArg("get-order-first-query"); 
    284285    d_beforeOrderQuery = getArg("get-order-before-query"); 
    285286    d_afterOrderQuery = getArg("get-order-after-query"); 
     
    336337  string tmp=lcqname; 
    337338 
    338 retryAfter: 
    339339  snprintf(output, sizeof(output)-1, d_afterOrderQuery.c_str(), sqlEscape(tmp).c_str(), id); 
    340340   
     
    345345 
    346346  if(after.empty() && !tmp.empty()) { 
    347     //cerr<<"Oops, have to pick the first, there is no last!"<<endl; 
    348     tmp.clear(); 
    349     goto retryAfter; 
     347    snprintf(output, sizeof(output)-1, d_firstOrderQuery.c_str(), id); 
     348   
     349    d_db->doQuery(output); 
     350    while(d_db->getRow(row)) { 
     351      after=row[0]; 
     352    } 
    350353  } 
    351354 
  • trunk/pdns/pdns/backends/gsql/gsqlbackend.hh

    r2326 r2429  
    8585  string d_ZoneLastChangeQuery; 
    8686   
     87  string d_firstOrderQuery; 
    8788  string d_beforeOrderQuery; 
    8889  string d_afterOrderQuery;