/[svn]/ircd-hybrid-7.2/src/s_user.c
ViewVC logotype

Diff of /ircd-hybrid-7.2/src/s_user.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 591 by michael, Mon May 8 18:40:00 2006 UTC revision 592 by michael, Thu May 11 12:43:02 2006 UTC
# Line 67  static char umode_buffer[IRCD_BUFSIZE]; Line 67  static char umode_buffer[IRCD_BUFSIZE];
67  static void user_welcome(struct Client *);  static void user_welcome(struct Client *);
68  static void report_and_set_user_flags(struct Client *, const struct AccessItem *);  static void report_and_set_user_flags(struct Client *, const struct AccessItem *);
69  static int check_xline(struct Client *);  static int check_xline(struct Client *);
 static int check_regexp_xline(struct Client *);  
70  static void introduce_client(struct Client *, struct Client *);  static void introduce_client(struct Client *, struct Client *);
71  static void *uid_get(va_list);  static void *uid_get(va_list);
72    
# Line 418  register_local_user(struct Client *clien Line 417  register_local_user(struct Client *clien
417    
418    assert(source_p == client_p);    assert(source_p == client_p);
419    
420    /* end of valid user name check */    if (check_xline(source_p))
   if (check_xline(source_p) || check_regexp_xline(source_p))  
421      return;      return;
422    
423    if (IsDead(client_p))    if (IsDead(client_p))
# Line 1210  user_welcome(struct Client *source_p) Line 1208  user_welcome(struct Client *source_p)
1208  static int  static int
1209  check_xline(struct Client *source_p)  check_xline(struct Client *source_p)
1210  {  {
1211    struct ConfItem *conf;    struct ConfItem *conf = NULL;
1212    struct MatchItem *xconf;    const char *reason = NULL;
   const char *reason;  
1213    
1214    if ((conf = find_matching_name_conf(XLINE_TYPE, source_p->info,    if ((conf = find_matching_name_conf(XLINE_TYPE, source_p->info, NULL, NULL, 0)) ||
1215                                        NULL, NULL, 0)) != NULL)        (conf = find_matching_name_conf(RXLINE_TYPE, source_p->info, NULL, NULL, 0)))
1216    {    {
1217      xconf = map_to_conf(conf);      struct MatchItem *reg = map_to_conf(conf);
1218      xconf->count++;  
1219        ++reg->count;
1220    
1221      if (xconf->reason != NULL)      if (reg->reason != NULL)
1222        reason = xconf->reason;        reason = reg->reason;
1223      else      else
1224        reason = "No Reason";        reason = "No Reason";
1225    
# Line 1231  check_xline(struct Client *source_p) Line 1229  check_xline(struct Client *source_p)
1229                           get_client_name(source_p, HIDE_IP),                           get_client_name(source_p, HIDE_IP),
1230                           source_p->sockhost);                           source_p->sockhost);
1231    
1232      ServerStats->is_ref++;            ServerStats->is_ref++;
1233      if (REJECT_HOLD_TIME > 0)      if (REJECT_HOLD_TIME > 0)
1234      {      {
1235        sendto_one(source_p, ":%s NOTICE %s :Bad user info",        sendto_one(source_p, ":%s NOTICE %s :Bad user info",
# Line 1244  check_xline(struct Client *source_p) Line 1242  check_xline(struct Client *source_p)
1242      return 1;      return 1;
1243    }    }
1244    
   return 0;  
 }  
   
 static int  
 check_regexp_xline(struct Client *source_p)  
 {  
   struct ConfItem *conf = NULL;  
   const char *reason = NULL;  
   
   if ((conf = find_matching_name_conf(RXLINE_TYPE, source_p->info, NULL, NULL, 0)))  
   {  
     struct MatchItem *reg = map_to_conf(conf);  
   
     ++reg->count;  
   
     if (reg->reason != NULL)  
       reason = reg->reason;  
     else  
       reason = "No Reason";  
   
     sendto_realops_flags(UMODE_REJ, L_ALL,  
                          "X-line (REGEX) Rejecting [%s] [%s], user %s [%s]",  
                          source_p->info, reason,  
                          get_client_name(source_p, HIDE_IP),  
                          source_p->sockhost);  
   
     ServerStats->is_ref++;  
     exit_client(source_p, &me, "Bad user info");  
     return 1;  
   }  
   
1245    return 0;    return 0;
1246  }  }
1247    

Legend:
Removed from v.591  
changed lines
  Added in v.592

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28