comparison src/context.cpp @ 162:c4bce911c276 stable-6-03

don't add auto whitelist for A to A
author carl
date Sat, 14 Jul 2007 12:25:17 -0700
parents b3ed72ee6564
children 97d7da45fe2a
comparison
equal deleted inserted replaced
161:d384df37491f 162:c4bce911c276
514 pthread_mutex_unlock(&mutex); 514 pthread_mutex_unlock(&mutex);
515 } 515 }
516 516
517 517
518 bool WHITELISTER::is_white(char *from) { 518 bool WHITELISTER::is_white(char *from) {
519 bool rc = false;
520 pthread_mutex_lock(&mutex); 519 pthread_mutex_lock(&mutex);
521 autowhite_sent::iterator i = rcpts.find(from); 520 autowhite_sent::iterator i = rcpts.find(from);
522 if (i != rcpts.end()) { 521 bool rc = (i != rcpts.end());
523 time_t when = (*i).second;
524 time_t now = time(NULL);
525 rc = (when+(days*8640) > now);
526 }
527 pthread_mutex_unlock(&mutex); 522 pthread_mutex_unlock(&mutex);
528 return rc; 523 return rc;
529 } 524 }
530 525
531 526
736 else 731 else
737 return NULL; 732 return NULL;
738 } 733 }
739 734
740 735
741 WHITELISTERP CONTEXT::find_autowhite(char *to) { 736 WHITELISTERP CONTEXT::find_autowhite(char *from, char *to) {
742 if (whitelister && cover_env_to(to)) 737 if (whitelister && cover_env_to(to) && !cover_env_to(from))
743 return whitelister; 738 return whitelister;
744 else if (parent) 739 else if (parent)
745 return parent->find_autowhite(to); 740 return parent->find_autowhite(from, to);
746 else 741 else
747 return NULL; 742 return NULL;
748 } 743 }
749 744
750 745