"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "difffile.c" between
nsd-4.3.6.tar.gz and nsd-4.3.7.tar.gz

About: NSD is an authoritative only, high performance, simple name server daemon.

difffile.c  (nsd-4.3.6):difffile.c  (nsd-4.3.7)
skipping to change at line 562 skipping to change at line 562
/* see if nsec3 addition triggers need action */ /* see if nsec3 addition triggers need action */
static void static void
nsec3_add_rr_trigger(namedb_type* db, rr_type* rr, zone_type* zone, nsec3_add_rr_trigger(namedb_type* db, rr_type* rr, zone_type* zone,
udb_ptr* udbz) udb_ptr* udbz)
{ {
/* the RR has been added in full, also to UDB (and thus NSEC3PARAM /* the RR has been added in full, also to UDB (and thus NSEC3PARAM
* in the udb has been adjusted) */ * in the udb has been adjusted) */
if(zone->nsec3_param && rr->type == TYPE_NSEC3 && if(zone->nsec3_param && rr->type == TYPE_NSEC3 &&
(!rr->owner->nsec3 || !rr->owner->nsec3->nsec3_node.key) (!rr->owner->nsec3 || !rr->owner->nsec3->nsec3_node.key)
&& nsec3_rr_uses_params(rr, zone)) { && nsec3_rr_uses_params(rr, zone)) {
if(!zone->nsec3_last) {
/* all nsec3s have previously been deleted, but
* we have nsec3 parameters, set it up again from
* being cleared. */
nsec3_precompile_newparam(db, zone);
}
/* added NSEC3 into the chain */ /* added NSEC3 into the chain */
nsec3_precompile_nsec3rr(db, rr->owner, zone); nsec3_precompile_nsec3rr(db, rr->owner, zone);
/* the domain has become an NSEC3-domain, if it was precompiled /* the domain has become an NSEC3-domain, if it was precompiled
* previously, remove that, neatly done in routine above */ * previously, remove that, neatly done in routine above */
nsec3_rrsets_changed_remove_prehash(rr->owner, zone); nsec3_rrsets_changed_remove_prehash(rr->owner, zone);
/* set this NSEC3 to prehash */ /* set this NSEC3 to prehash */
prehash_add(db->domains, rr->owner); prehash_add(db->domains, rr->owner);
} else if(!zone->nsec3_param && rr->type == TYPE_NSEC3PARAM) { } else if(!zone->nsec3_param && rr->type == TYPE_NSEC3PARAM) {
/* see if this means NSEC3 chain can be used */ /* see if this means NSEC3 chain can be used */
nsec3_find_zone_param(db, zone, udbz, NULL, 0); nsec3_find_zone_param(db, zone, udbz, NULL, 0);
skipping to change at line 1718 skipping to change at line 1724
+strlen(name)+1, NULL)) { +strlen(name)+1, NULL)) {
log_msg(LOG_ERR, "tasklist: out of space, cannot add delk"); log_msg(LOG_ERR, "tasklist: out of space, cannot add delk");
return; return;
} }
TASKLIST(&e)->task_type = task_del_key; TASKLIST(&e)->task_type = task_del_key;
p = (char*)TASKLIST(&e)->zname; p = (char*)TASKLIST(&e)->zname;
memmove(p, name, strlen(name)+1); memmove(p, name, strlen(name)+1);
udb_ptr_unlink(&e, udb); udb_ptr_unlink(&e, udb);
} }
void task_new_add_cookie_secret(udb_base* udb, udb_ptr* last,
const char* secret) {
udb_ptr e;
char* p;
size_t const secret_size = strlen(secret) + 1;
DEBUG(DEBUG_IPC, 1, (LOG_INFO, "add task add_cookie_secret"));
if(!task_create_new_elem(udb, last, &e,
sizeof(struct task_list_d) + secret_size, NULL))
{
log_msg(LOG_ERR, "tasklist: out of space, cannot add add_cookie_s
ecret");
return;
}
TASKLIST(&e)->task_type = task_add_cookie_secret;
p = (char*)TASKLIST(&e)->zname;
memmove(p, secret, secret_size);
udb_ptr_unlink(&e, udb);
}
void task_new_drop_cookie_secret(udb_base* udb, udb_ptr* last) {
udb_ptr e;
DEBUG(DEBUG_IPC, 1, (LOG_INFO, "add task drop_cookie_secret"));
if(!task_create_new_elem(udb, last, &e, sizeof(struct task_list_d), NULL)
) {
log_msg(LOG_ERR, "tasklist: out of space, cannot add drop_cookie_
secret");
return;
}
TASKLIST(&e)->task_type = task_drop_cookie_secret;
udb_ptr_unlink(&e, udb);
}
void task_new_activate_cookie_secret(udb_base* udb, udb_ptr* last) {
udb_ptr e;
DEBUG(DEBUG_IPC, 1, (LOG_INFO, "add task activate_cookie_secret"));
if(!task_create_new_elem(udb, last, &e, sizeof(struct task_list_d), NULL)
) {
log_msg(LOG_ERR, "tasklist: out of space, cannot add activate_coo
kie_secret");
return;
}
TASKLIST(&e)->task_type = task_activate_cookie_secret;
udb_ptr_unlink(&e, udb);
}
void task_new_add_pattern(udb_base* udb, udb_ptr* last, void task_new_add_pattern(udb_base* udb, udb_ptr* last,
struct pattern_options* p) struct pattern_options* p)
{ {
region_type* temp; region_type* temp;
buffer_type* buffer; buffer_type* buffer;
udb_ptr e; udb_ptr e;
DEBUG(DEBUG_IPC,1, (LOG_INFO, "add task addpattern %s", p->pname)); DEBUG(DEBUG_IPC,1, (LOG_INFO, "add task addpattern %s", p->pname));
temp = region_create(xalloc, free); temp = region_create(xalloc, free);
buffer = buffer_create(temp, 4096); buffer = buffer_create(temp, 4096);
pattern_options_marshal(buffer, p); pattern_options_marshal(buffer, p);
skipping to change at line 1959 skipping to change at line 2006
static void static void
task_process_del_key(struct nsd* nsd, struct task_list_d* task) task_process_del_key(struct nsd* nsd, struct task_list_d* task)
{ {
char* name = (char*)task->zname; char* name = (char*)task->zname;
DEBUG(DEBUG_IPC,1, (LOG_INFO, "delkey task %s", name)); DEBUG(DEBUG_IPC,1, (LOG_INFO, "delkey task %s", name));
/* this is reload and nothing is using the TSIG key right now */ /* this is reload and nothing is using the TSIG key right now */
key_options_remove(nsd->options, name); key_options_remove(nsd->options, name);
} }
static void static void
task_process_add_cookie_secret(struct nsd* nsd, struct task_list_d* task) {
uint8_t secret_tmp[NSD_COOKIE_SECRET_SIZE];
ssize_t decoded_len;
char* secret = (char*)task->zname;
DEBUG(DEBUG_IPC, 1, (LOG_INFO, "add_cookie_secret task %s", secret));
if( strlen(secret) != 32 ) {
log_msg(LOG_ERR, "invalid cookie secret: %s", secret);
explicit_bzero(secret, strlen(secret));
return;
}
decoded_len = hex_pton(secret, secret_tmp, NSD_COOKIE_SECRET_SIZE);
if( decoded_len != 16 ) {
explicit_bzero(secret_tmp, NSD_COOKIE_SECRET_SIZE);
log_msg(LOG_ERR, "unable to parse cookie secret: %s", secret);
explicit_bzero(secret, strlen(secret));
return;
}
explicit_bzero(secret, strlen(secret));
add_cookie_secret(nsd, secret_tmp);
explicit_bzero(secret_tmp, NSD_COOKIE_SECRET_SIZE);
}
static void
task_process_drop_cookie_secret(struct nsd* nsd, struct task_list_d* task)
{
(void)task;
DEBUG(DEBUG_IPC, 1, (LOG_INFO, "drop_cookie_secret task"));
if( nsd->cookie_count <= 1 ) {
log_msg(LOG_ERR, "can not drop the only active cookie secret");
return;
}
drop_cookie_secret(nsd);
}
static void
task_process_activate_cookie_secret(struct nsd* nsd, struct task_list_d* task)
{
(void)task;
DEBUG(DEBUG_IPC, 1, (LOG_INFO, "activate_cookie_secret task"));
if( nsd->cookie_count <= 1 ) {
log_msg(LOG_ERR, "can not activate the only active cookie secret"
);
return;
}
activate_cookie_secret(nsd);
}
static void
task_process_add_pattern(struct nsd* nsd, struct task_list_d* task) task_process_add_pattern(struct nsd* nsd, struct task_list_d* task)
{ {
region_type* temp = region_create(xalloc, free); region_type* temp = region_create(xalloc, free);
buffer_type buffer; buffer_type buffer;
struct pattern_options *pat; struct pattern_options *pat;
buffer_create_from(&buffer, task->zname, task->yesno); buffer_create_from(&buffer, task->zname, task->yesno);
pat = pattern_options_unmarshal(temp, &buffer); pat = pattern_options_unmarshal(temp, &buffer);
DEBUG(DEBUG_IPC,1, (LOG_INFO, "addpattern task %s", pat->pname)); DEBUG(DEBUG_IPC,1, (LOG_INFO, "addpattern task %s", pat->pname));
pattern_options_add_modify(nsd->options, pat); pattern_options_add_modify(nsd->options, pat);
region_destroy(temp); region_destroy(temp);
skipping to change at line 2089 skipping to change at line 2186
task_process_opt_change(nsd, TASKLIST(task)); task_process_opt_change(nsd, TASKLIST(task));
break; break;
#ifdef USE_ZONE_STATS #ifdef USE_ZONE_STATS
case task_zonestat_inc: case task_zonestat_inc:
task_process_zonestat_inc(nsd, udb, last_task, TASKLIST(task)); task_process_zonestat_inc(nsd, udb, last_task, TASKLIST(task));
break; break;
#endif #endif
case task_apply_xfr: case task_apply_xfr:
task_process_apply_xfr(nsd, udb, last_task, task); task_process_apply_xfr(nsd, udb, last_task, task);
break; break;
case task_add_cookie_secret:
task_process_add_cookie_secret(nsd, TASKLIST(task));
break;
case task_drop_cookie_secret:
task_process_drop_cookie_secret(nsd, TASKLIST(task));
break;
case task_activate_cookie_secret:
task_process_activate_cookie_secret(nsd, TASKLIST(task));
break;
default: default:
log_msg(LOG_WARNING, "unhandled task in reload type %d", log_msg(LOG_WARNING, "unhandled task in reload type %d",
(int)TASKLIST(task)->task_type); (int)TASKLIST(task)->task_type);
break; break;
} }
udb_ptr_free_space(task, udb, TASKLIST(task)->size); udb_ptr_free_space(task, udb, TASKLIST(task)->size);
} }
 End of changes. 4 change blocks. 
0 lines changed or deleted 113 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)