comparison src/context.cpp @ 149:9581f6e62574

switch to second context wins in all cases
author carl
date Mon, 19 Feb 2007 15:57:24 -0800
parents 9330b8d6a56b
children c7fc218686f5
comparison
equal deleted inserted replaced
148:9330b8d6a56b 149:9581f6e62574
418 418
419 void CONFIG::add_to(char *to, CONTEXTP con) { 419 void CONFIG::add_to(char *to, CONTEXTP con) {
420 context_map::iterator i = env_to.find(to); 420 context_map::iterator i = env_to.find(to);
421 if (i != env_to.end()) { 421 if (i != env_to.end()) {
422 CONTEXTP c = (*i).second; 422 CONTEXTP c = (*i).second;
423 int s = strlen(to);
424 bool at = s && (to[s-1] == '@');
425 if (at && con->is_parent(c->get_parent())) {
426 if (debug_syslog) {
427 char oldname[maxlen];
428 char newname[maxlen];
429 char *oldn = c->get_full_name(oldname, maxlen);
430 char *newn = con->get_full_name(newname, maxlen);
431 char buf[maxlen*3];
432 snprintf(buf, maxlen*3, "both %s and %s claim envelope to %s, the first one wins", oldn, newn, to);
433 my_syslog(buf);
434 }
435 return; // don't take over user@ entries from your ancestors children
436 }
437 if ((c != con) && (c != con->get_parent())) { 423 if ((c != con) && (c != con->get_parent())) {
438 if (debug_syslog) { 424 if (debug_syslog) {
439 char oldname[maxlen]; 425 char oldname[maxlen];
440 char newname[maxlen]; 426 char newname[maxlen];
441 char *oldn = c->get_full_name(oldname, maxlen); 427 char *oldn = c->get_full_name(oldname, maxlen);