ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/client.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/client.c (file contents):
Revision 5590 by michael, Tue Feb 17 17:55:01 2015 UTC vs.
Revision 5985 by michael, Tue May 26 18:52:42 2015 UTC

# Line 104 | Line 104 | make_client(struct Client *from)
104    client_p->hnext = client_p;
105    SetUnknown(client_p);
106    strcpy(client_p->username, "unknown");
107 <  strcpy(client_p->account, "0");
107 >  strcpy(client_p->account, "*");
108  
109    return client_p;
110   }
# Line 349 | Line 349 | check_conf_klines(void)
349                                       client_p->connection->aftype, NULL, NULL, 1)))
350      {
351        conf_try_ban(client_p, conf);
352 <      continue; /* and go examine next fd/client_p */
353 <    }
354 <
355 <    if (ConfigGeneral.glines)
356 <    {
357 <      if ((conf = find_conf_by_address(client_p->host, &client_p->connection->ip,
358 <                                       CONF_GLINE, client_p->connection->aftype,
359 <                                       client_p->username, NULL, 1)))
360 <      {
361 <        conf_try_ban(client_p, conf);
362 <        /* and go examine next fd/client_p */
363 <        continue;
364 <      }
352 >      continue;  /* and go examine next Client */
353      }
354  
355      if ((conf = find_conf_by_address(client_p->host, &client_p->connection->ip,
# Line 369 | Line 357 | check_conf_klines(void)
357                                       client_p->username, NULL, 1)))
358      {
359        conf_try_ban(client_p, conf);
360 <      continue;
360 >      continue;  /* and go examine next Client */
361      }
362  
363 <    if ((conf = find_matching_name_conf(CONF_XLINE,  client_p->info,
363 >    if ((conf = find_matching_name_conf(CONF_XLINE, client_p->info,
364                                          NULL, NULL, 0)))
365      {
366        conf_try_ban(client_p, conf);
367 <      continue;
367 >      continue;  /* and go examine next Client */
368      }
369    }
370  
371 <  /* also check the unknowns list for new dlines */
371 >  /* Also check the unknowns list for new dlines */
372    DLINK_FOREACH_SAFE(node, node_next, unknown_list.head)
373    {
374      struct Client *client_p = node->data;
# Line 389 | Line 377 | check_conf_klines(void)
377                                       client_p->connection->aftype, NULL, NULL, 1)))
378      {
379        conf_try_ban(client_p, conf);
380 <      continue; /* and go examine next fd/client_p */
380 >      continue;  /* and go examine next Client */
381      }
382    }
383   }
# Line 405 | Line 393 | check_conf_klines(void)
393   void
394   conf_try_ban(struct Client *client_p, struct MaskItem *conf)
395   {
396 <  const char *user_reason = NULL;  /* What is sent to user */
409 <  const char *type_string = NULL;
410 <  const char dline_string[] = "D-line";
411 <  const char kline_string[] = "K-line";
412 <  const char gline_string[] = "G-line";
413 <  const char xline_string[] = "X-line";
396 >  char ban_type = '\0';
397  
398    switch (conf->type)
399    {
# Line 423 | Line 406 | conf_try_ban(struct Client *client_p, st
406          return;
407        }
408  
409 <      type_string = kline_string;
409 >      ban_type = 'K';
410        break;
411      case CONF_DLINE:
412        if (find_conf_by_address(NULL, &client_p->connection->ip, CONF_EXEMPT,
413                                 client_p->connection->aftype, NULL, NULL, 1))
414          return;
415 <      type_string = dline_string;
415 >      ban_type = 'D';
416        break;
417 <    case CONF_GLINE:
418 <      if (IsExemptKline(client_p) ||
436 <          IsExemptGline(client_p))
417 >    case CONF_XLINE:
418 >      if (IsExemptXline(client_p))
419        {
420          sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
421 <                             "GLINE over-ruled for %s, client is %sline_exempt",
422 <                             get_client_name(client_p, HIDE_IP), IsExemptKline(client_p) ? "k" : "g");
421 >                             "XLINE over-ruled for %s, client is xline_exempt",
422 >                             get_client_name(client_p, HIDE_IP));
423          return;
424        }
425 <
444 <      type_string = gline_string;
445 <      break;
446 <    case CONF_XLINE:
447 <      type_string = xline_string;
425 >      ban_type = 'X';
426        ++conf->count;
427        break;
428      default:
# Line 452 | Line 430 | conf_try_ban(struct Client *client_p, st
430        break;
431    }
432  
433 <  user_reason = conf->reason ? conf->reason : type_string;
434 <
457 <  sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s active for %s",
458 <                       type_string, get_client_name(client_p, HIDE_IP));
433 >  sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%c-line active for %s",
434 >                       ban_type, get_client_name(client_p, HIDE_IP));
435  
436    if (IsClient(client_p))
437 <    sendto_one_numeric(client_p, &me, ERR_YOUREBANNEDCREEP, user_reason);
437 >    sendto_one_numeric(client_p, &me, ERR_YOUREBANNEDCREEP, conf->reason);
438  
439 <  exit_client(client_p, user_reason);
439 >  exit_client(client_p, conf->reason);
440   }
441  
442   /* update_client_exit_stats()
# Line 651 | Line 627 | exit_one_client(struct Client *source_p,
627  
628      if (MyConnect(source_p))
629      {
630 <      /* Clean up invitefield */
655 <      DLINK_FOREACH_SAFE(node, node_next, source_p->connection->invited.head)
656 <        del_invite(node->data, source_p);
657 <
630 >      clear_invites_client(source_p);
631        del_all_accepts(source_p);
632      }
633    }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)