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

Comparing:
ircd-hybrid-7.2/src/s_user.c (file contents), Revision 716 by adx, Sat Jul 15 10:22:58 2006 UTC vs.
ircd-hybrid/trunk/src/s_user.c (file contents), Revision 1646 by michael, Wed Nov 7 21:02:43 2012 UTC

# Line 23 | Line 23
23   */
24  
25   #include "stdinc.h"
26 < #include "tools.h"
26 > #include "list.h"
27   #include "s_user.h"
28   #include "s_misc.h"
29   #include "channel.h"
30   #include "channel_mode.h"
31   #include "client.h"
32 #include "common.h"
32   #include "fdlist.h"
33   #include "hash.h"
34   #include "irc_string.h"
35   #include "sprintf_irc.h"
36   #include "s_bsd.h"
38 #include "irc_getnameinfo.h"
37   #include "ircd.h"
40 #include "list.h"
38   #include "listener.h"
39   #include "motd.h"
40   #include "numeric.h"
41 < #include "s_conf.h"
42 < #include "s_log.h"
41 > #include "conf.h"
42 > #include "log.h"
43   #include "s_serv.h"
47 #include "s_stats.h"
44   #include "send.h"
45   #include "supported.h"
46   #include "whowas.h"
47   #include "memory.h"
48   #include "packet.h"
49 + #include "rng_mt.h"
50   #include "userhost.h"
51   #include "hook.h"
52   #include "s_misc.h"
53 < #include "msg.h"
54 < #include "pcre.h"
53 > #include "parse.h"
54 > #include "watch.h"
55 >
56  
59 int MaxClientCount     = 1;
60 int MaxConnectionCount = 1;
57   struct Callback *entering_umode_cb = NULL;
58   struct Callback *umode_cb = NULL;
63 struct Callback *uid_get_cb = NULL;
59  
60   static char umode_buffer[IRCD_BUFSIZE];
61  
62   static void user_welcome(struct Client *);
63 < static void report_and_set_user_flags(struct Client *, const struct AccessItem *);
63 > static void report_and_set_user_flags(struct Client *, const struct MaskItem *);
64   static int check_xline(struct Client *);
65 < static void introduce_client(struct Client *, struct Client *);
66 < static void *uid_get(va_list);
65 > static void introduce_client(struct Client *);
66 > static const char *uid_get(void);
67  
68   /* Used for building up the isupport string,
69   * used with init_isupport, add_isupport, delete_isupport
# Line 95 | Line 90 | unsigned int user_modes[256] =
90    0,                  /* @ */
91    0,                  /* A */
92    0,                  /* B */
93 <  0,                  /* C */
93 >  UMODE_CCONN_FULL,   /* C */
94    UMODE_DEAF,         /* D */
95    0,                  /* E */
96    0,                  /* F */
97    UMODE_SOFTCALLERID, /* G */
98 <  0,                  /* H */
98 >  UMODE_HIDDEN,       /* H */
99    0,                  /* I */
100    0,                  /* J */
101    0,                  /* K */
# Line 110 | Line 105 | unsigned int user_modes[256] =
105    0,                  /* O */
106    0,                  /* P */
107    0,                  /* Q */
108 <  0,                  /* R */
108 >  UMODE_REGONLY,      /* R */
109    0,                  /* S */
110    0,                  /* T */
111    0,                  /* U */
# Line 130 | Line 125 | unsigned int user_modes[256] =
125    UMODE_CALLERID,     /* g */
126    0,                  /* h */
127    UMODE_INVISIBLE,    /* i */
128 <  0,                  /* j */
128 >  UMODE_REJ,          /* j */
129    UMODE_SKILL,        /* k */
130    UMODE_LOCOPS,       /* l */
131    0,                  /* m */
# Line 138 | Line 133 | unsigned int user_modes[256] =
133    UMODE_OPER,         /* o */
134    0,                  /* p */
135    0,                  /* q */
136 <  UMODE_REJ,          /* r */
136 >  UMODE_REGISTERED,   /* r */
137    UMODE_SERVNOTICE,   /* s */
138    0,                  /* t */
139    UMODE_UNAUTH,       /* u */
# Line 165 | Line 160 | assemble_umode_buffer(void)
160    unsigned int idx = 0;
161    char *umode_buffer_ptr = umode_buffer;
162  
163 <  for (; idx < (sizeof(user_modes) / sizeof(int)); ++idx)
163 >  for (; idx < (sizeof(user_modes) / sizeof(user_modes[0])); ++idx)
164      if (user_modes[idx])
165        *umode_buffer_ptr++ = idx;
166  
# Line 194 | Line 189 | show_lusers(struct Client *source_p)
189      to = source_p->name;
190    }
191  
192 <  if (!ConfigServerHide.hide_servers || IsOper(source_p))
192 >  if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER))
193      sendto_one(source_p, form_str(RPL_LUSERCLIENT),
194                 from, to, (Count.total-Count.invisi),
195                 Count.invisi, dlink_list_length(&global_serv_list));
# Line 214 | Line 209 | show_lusers(struct Client *source_p)
209      sendto_one(source_p, form_str(RPL_LUSERCHANNELS),
210                 from, to, dlink_list_length(&global_channel_list));
211  
212 <  if (!ConfigServerHide.hide_servers || IsOper(source_p))
212 >  if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER))
213    {
214      sendto_one(source_p, form_str(RPL_LUSERME),
215                 from, to, Count.local, Count.myserver);
# Line 235 | Line 230 | show_lusers(struct Client *source_p)
230               from, to, Count.total, Count.max_tot,
231               Count.total, Count.max_tot);
232  
233 <  if (!ConfigServerHide.hide_servers || IsOper(source_p))
233 >  if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER))
234      sendto_one(source_p, form_str(RPL_STATSCONN), from, to,
235 <               MaxConnectionCount, MaxClientCount, Count.totalrestartcount);
235 >               Count.max_loc_con, Count.max_loc_cli, Count.totalrestartcount);
236  
237 <  if (Count.local > MaxClientCount)
238 <    MaxClientCount = Count.local;
237 >  if (Count.local > Count.max_loc_cli)
238 >    Count.max_loc_cli = Count.local;
239  
240 <  if ((Count.local + Count.myserver) > MaxConnectionCount)
241 <    MaxConnectionCount = Count.local + Count.myserver;
240 >  if ((Count.local + Count.myserver) > Count.max_loc_con)
241 >    Count.max_loc_con = Count.local + Count.myserver;
242   }
243  
244   /* show_isupport()
# Line 282 | Line 277 | show_isupport(struct Client *source_p)
277   **         nick from local user or kill him/her...
278   */
279   void
280 < register_local_user(struct Client *client_p, struct Client *source_p,
286 <                    const char *nick, const char *username)
280 > register_local_user(struct Client *source_p)
281   {
282 <  const struct AccessItem *aconf = NULL;
283 <  char ipaddr[HOSTIPLEN];
290 <  dlink_node *ptr = NULL;
291 <  dlink_node *m = NULL;
282 >  const char *id = NULL;
283 >  const struct MaskItem *conf = NULL;
284  
285    assert(source_p != NULL);
286 +  assert(source_p == source_p->from);
287    assert(MyConnect(source_p));
295  assert(source_p->username != username);
288    assert(!source_p->localClient->registration);
289  
290 <  ClearCap(client_p, CAP_TS6);
290 >  ClearCap(source_p, CAP_TS6);
291  
292    if (ConfigFileEntry.ping_cookie)
293    {
294 <    if (!IsPingSent(source_p) &&
303 <       source_p->localClient->random_ping == 0)
294 >    if (!IsPingSent(source_p) && source_p->localClient->random_ping == 0)
295      {
296 <      source_p->localClient->random_ping = (unsigned long)rand();
297 <      sendto_one(source_p, "PING :%lu",
296 >      do
297 >        source_p->localClient->random_ping = genrand_int32();
298 >      while (!source_p->localClient->random_ping);
299 >
300 >      sendto_one(source_p, "PING :%u",
301                   source_p->localClient->random_ping);
302        SetPingSent(source_p);
303        return;
# Line 313 | Line 307 | register_local_user(struct Client *clien
307        return;
308    }
309  
310 <  source_p->localClient->last = CurrentTime;
310 >  source_p->localClient->last_privmsg = CurrentTime;
311    /* Straight up the maximum rate of flooding... */
312    source_p->localClient->allow_read = MAX_FLOOD_BURST;
313  
314 <  if (!execute_callback(client_check_cb, source_p, username))
314 >  if (!check_client(source_p))
315      return;
316  
317    if (valid_hostname(source_p->host) == 0)
# Line 328 | Line 322 | register_local_user(struct Client *clien
322              sizeof(source_p->host));
323    }
324  
325 <  ptr   = source_p->localClient->confs.head;
332 <  aconf = map_to_conf(ptr->data);
325 >  conf = source_p->localClient->confs.head->data;
326  
327    if (!IsGotId(source_p))
328    {
329 <    const char *p = NULL;
329 >    char username[USERLEN + 1];
330 >    const char *p = username;
331      unsigned int i = 0;
332  
333 <    if (IsNeedIdentd(aconf))
333 >    if (IsNeedIdentd(conf))
334      {
335 <      ServerStats->is_ref++;
335 >      ++ServerStats.is_ref;
336        sendto_one(source_p, ":%s NOTICE %s :*** Notice -- You need to install "
337                   "identd to use this server", me.name, source_p->name);
338        exit_client(source_p, &me, "Install identd");
339        return;
340      }
341  
342 <    p = username;
342 >    strlcpy(username, source_p->username, sizeof(username));
343  
344 <    if (!IsNoTilde(aconf))
344 >    if (!IsNoTilde(conf))
345        source_p->username[i++] = '~';
346  
347 <    while (*p && i < USERLEN)
354 <    {
347 >    for (; *p && i < USERLEN; ++p)
348        if (*p != '[')
349          source_p->username[i++] = *p;
357      p++;
358    }
350  
351      source_p->username[i] = '\0';
352    }
353  
354    /* password check */
355 <  if (!EmptyString(aconf->passwd))
355 >  if (!EmptyString(conf->passwd))
356    {
357      const char *pass = source_p->localClient->passwd;
358  
359 <    if (!match_conf_password(pass, aconf))
359 >    if (!match_conf_password(pass, conf))
360      {
361 <      ServerStats->is_ref++;
361 >      ++ServerStats.is_ref;
362        sendto_one(source_p, form_str(ERR_PASSWDMISMATCH),
363                   me.name, source_p->name);
364        exit_client(source_p, &me, "Bad Password");
# Line 381 | Line 372 | register_local_user(struct Client *clien
372     */
373  
374    /* report if user has &^>= etc. and set flags as needed in source_p */
375 <  report_and_set_user_flags(source_p, aconf);
375 >  report_and_set_user_flags(source_p, conf);
376 >
377 >  if (IsDead(source_p))
378 >    return;
379  
380    /* Limit clients -
381     * We want to be able to have servers and F-line clients
# Line 394 | Line 388 | register_local_user(struct Client *clien
388    if ((Count.local >= ServerInfo.max_clients + MAX_BUFFER) ||
389        (Count.local >= ServerInfo.max_clients && !IsExemptLimits(source_p)))
390    {
391 <    sendto_realops_flags(UMODE_FULL, L_ALL,
391 >    sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE,
392                           "Too many clients, rejecting %s[%s].",
393 <                         nick, source_p->host);
394 <    ServerStats->is_ref++;
393 >                         source_p->name, source_p->host);
394 >    ++ServerStats.is_ref;
395      exit_client(source_p, &me, "Sorry, server is full - try later");
396      return;
397    }
# Line 407 | Line 401 | register_local_user(struct Client *clien
401    {
402      char tmpstr2[IRCD_BUFSIZE];
403  
404 <    sendto_realops_flags(UMODE_REJ, L_ALL, "Invalid username: %s (%s@%s)",
405 <                         nick, source_p->username, source_p->host);
406 <    ServerStats->is_ref++;
407 <    ircsprintf(tmpstr2, "Invalid username [%s]", source_p->username);
404 >    sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE,
405 >                         "Invalid username: %s (%s@%s)",
406 >                         source_p->name, source_p->username, source_p->host);
407 >    ++ServerStats.is_ref;
408 >    snprintf(tmpstr2, sizeof(tmpstr2), "Invalid username [%s]",
409 >             source_p->username);
410      exit_client(source_p, &me, tmpstr2);
411      return;
412    }
413  
418  assert(source_p == client_p);
419
414    if (check_xline(source_p))
415      return;
416  
417 <  if (IsDead(client_p))
418 <    return;
425 <
426 <  if (me.id[0])
427 <  {
428 <    const char *id = execute_callback(uid_get_cb, source_p);
429 <
430 <    while (hash_find_id(id) != NULL)
431 <      id = uid_get(NULL);
417 >  while (hash_find_id((id = uid_get())) != NULL)
418 >    ;
419  
420 <    strlcpy(source_p->id, id, sizeof(source_p->id));
421 <    hash_add_id(source_p);
435 <  }
420 >  strlcpy(source_p->id, id, sizeof(source_p->id));
421 >  hash_add_id(source_p);
422  
423 <  irc_getnameinfo((struct sockaddr *)&source_p->localClient->ip,
424 <                  source_p->localClient->ip.ss_len, ipaddr,
425 <                  HOSTIPLEN, NULL, 0, NI_NUMERICHOST);
426 <
427 <  sendto_realops_flags(UMODE_CCONN, L_ALL,
428 <                       "Client connecting: %s (%s@%s) [%s] {%s} [%s]",
429 <                       nick, source_p->username, source_p->host,
423 >  sendto_realops_flags(UMODE_CCONN, L_ALL, SEND_NOTICE,
424 >                       "Client connecting: %s (%s@%s) [%s] {%s} [%s] <%s>",
425 >                       source_p->name, source_p->username, source_p->host,
426 >                       ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
427 >                       "255.255.255.255" : source_p->sockhost,
428 >                       get_client_class(&source_p->localClient->confs),
429 >                       source_p->info, source_p->id);
430 >
431 >  sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, SEND_NOTICE,
432 >                       "CLICONN %s %s %s %s %s %s %s 0 %s",
433 >                       source_p->name, source_p->username, source_p->host,
434                         ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
435 <                       "255.255.255.255" : ipaddr, get_client_class(source_p),
435 >                       "255.255.255.255" : source_p->sockhost,
436 >                       get_client_class(&source_p->localClient->confs),
437 >                       ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
438 >                           "<hidden>" : source_p->localClient->client_host,
439 >                       ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
440 >                           "<hidden>" : source_p->localClient->client_server,
441                         source_p->info);
442  
448  /* If they have died in send_* don't do anything. */
449  if (IsDead(source_p))
450    return;
443  
444    if (ConfigFileEntry.invisible_on_connect)
445    {
446 <    source_p->umodes |= UMODE_INVISIBLE;
447 <    Count.invisi++;
446 >    AddUMode(source_p, UMODE_INVISIBLE);
447 >    ++Count.invisi;
448    }
449  
450    if ((++Count.local) > Count.max_loc)
# Line 460 | Line 452 | register_local_user(struct Client *clien
452      Count.max_loc = Count.local;
453  
454      if (!(Count.max_loc % 10))
455 <      sendto_realops_flags(UMODE_ALL, L_ALL, "New Max Local Clients: %d",
455 >      sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
456 >                           "New Max Local Clients: %d",
457                             Count.max_loc);
458    }
459  
467  SetClient(source_p);
468
469  source_p->servptr = &me;
470  dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);
471
460    /* Increment our total user count here */
461    if (++Count.total > Count.max_tot)
462      Count.max_tot = Count.total;
463 <  Count.totalrestartcount++;
463 >  ++Count.totalrestartcount;
464 >
465 >  assert(source_p->servptr == &me);
466 >  SetClient(source_p);
467 >  dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->client_list);
468  
469    source_p->localClient->allow_read = MAX_FLOOD_BURST;
470  
471 <  if ((m = dlinkFindDelete(&unknown_list, source_p)) != NULL)
472 <  {
473 <    free_dlink_node(m);
474 <    dlinkAdd(source_p, &source_p->localClient->lclient_node, &local_client_list);
483 <  }
484 <  else assert(0);
471 >  assert(dlinkFind(&unknown_list, source_p));
472 >
473 >  dlink_move_node(&source_p->localClient->lclient_node,
474 >                  &unknown_list, &local_client_list);
475  
476    user_welcome(source_p);
477    add_user_host(source_p->username, source_p->host, 0);
478    SetUserHost(source_p);
479  
480 <  introduce_client(client_p, source_p);
480 >  introduce_client(source_p);
481   }
482  
483   /* register_remote_user()
484   *
485 < * inputs       - client_p directly connected client
496 < *              - source_p remote or directly connected client
485 > * inputs       - source_p remote or directly connected client
486   *              - username to register as
487   *              - host name to register as
488   *              - server name
# Line 503 | Line 492 | register_local_user(struct Client *clien
492   *                is introduced by a server.
493   */
494   void
495 < register_remote_user(struct Client *client_p, struct Client *source_p,
495 > register_remote_user(struct Client *source_p,
496                       const char *username, const char *host, const char *server,
497                       const char *realname)
498   {
# Line 513 | Line 502 | register_remote_user(struct Client *clie
502    assert(source_p->username != username);
503  
504    strlcpy(source_p->host, host, sizeof(source_p->host));
516  strlcpy(source_p->info, realname, sizeof(source_p->info));
505    strlcpy(source_p->username, username, sizeof(source_p->username));
506  
507    /*
508     * coming from another server, take the servers word for it
509     */
510 <  source_p->servptr = find_server(server);
510 >  source_p->servptr = hash_find_server(server);
511  
512 <  /* Super GhostDetect:
512 >  /*
513 >   * Super GhostDetect:
514     * If we can't find the server the user is supposed to be on,
515     * then simply blow the user away.        -Taner
516     */
517    if (source_p->servptr == NULL)
518    {
519 <    sendto_realops_flags(UMODE_ALL, L_ALL,
519 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
520                           "No server %s for user %s[%s@%s] from %s",
521                           server, source_p->name, source_p->username,
522                           source_p->host, source_p->from->name);
523 <    kill_client(client_p, source_p, "%s (Server doesn't exist)", me.name);
523 >    kill_client(source_p->from, source_p, "%s (Server doesn't exist)", me.name);
524  
525 <    SetKilled(source_p);
525 >    AddFlag(source_p, FLAGS_KILLED);
526      exit_client(source_p, &me, "Ghosted Client");
527      return;
528    }
529  
530    if ((target_p = source_p->servptr) && target_p->from != source_p->from)
531    {
532 <    sendto_realops_flags(UMODE_DEBUG, L_ALL,
532 >    sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
533                           "Bad User [%s] :%s USER %s@%s %s, != %s[%s]",
534 <                         client_p->name, source_p->name, source_p->username,
534 >                         source_p->from->name, source_p->name, source_p->username,
535                           source_p->host, source_p->servptr->name,
536                           target_p->name, target_p->from->name);
537 <    kill_client(client_p, source_p,
537 >    kill_client(source_p->from, source_p,
538                  "%s (NICK from wrong direction (%s != %s))",
539                  me.name, source_p->servptr->name, target_p->from->name);
540 <    SetKilled(source_p);
540 >    AddFlag(source_p, FLAGS_KILLED);
541      exit_client(source_p, &me, "USER server wrong direction");
542      return;
543    }
544  
545 +  /*
546 +   * If the nick has been introduced by a services server,
547 +   * make it a service as well.
548 +   */
549 +  if (HasFlag(source_p->servptr, FLAGS_SERVICE))
550 +    AddFlag(source_p, FLAGS_SERVICE);
551 +
552    /* Increment our total user count here */
553    if (++Count.total > Count.max_tot)
554      Count.max_tot = Count.total;
555  
560  ++source_p->from->serv->dep_users;
561
556    SetClient(source_p);
557 <  dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);
557 >  dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->client_list);
558    add_user_host(source_p->username, source_p->host, 1);
559    SetUserHost(source_p);
560  
561 <  introduce_client(client_p, source_p);
561 >  introduce_client(source_p);
562   }
563  
564   /* introduce_client()
565   *
566 < * inputs       - client_p
573 < *              - source_p
566 > * inputs       - source_p
567   * output       - NONE
568   * side effects - This common function introduces a client to the rest
569   *                of the net, either from a local client connect or
570   *                from a remote connect.
571   */
572   static void
573 < introduce_client(struct Client *client_p, struct Client *source_p)
573 > introduce_client(struct Client *source_p)
574   {
575    dlink_node *server_node = NULL;
576    static char ubuf[12];
# Line 587 | Line 580 | introduce_client(struct Client *client_p
580    else
581      send_umode(NULL, source_p, 0, SEND_UMODES, ubuf);
582  
583 +  watch_check_hash(source_p, RPL_LOGON);
584 +
585    if (*ubuf == '\0')
586    {
587      ubuf[0] = '+';
588      ubuf[1] = '\0';
589    }
590  
591 <  /* arghhh one could try not introducing new nicks to ll leafs
597 <   * but then you have to introduce them "on the fly" in SJOIN
598 <   * not fun.
599 <   * Its not going to cost much more bandwidth to simply let new
600 <   * nicks just ride on through.
601 <   */
602 <
603 <  /* We now introduce nicks "on the fly" in SJOIN anyway --
604 <   * you _need_ to if you aren't going to burst everyone initially.
605 <   *
606 <   * Only send to non CAP_LL servers, unless we're a lazylink leaf,
607 <   * in that case just send it to the uplink.
608 <   * -davidt
609 <   * rewritten to cope with SIDs .. eww eww eww --is
610 <   */
611 <  if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL) &&
612 <      client_p != uplink)
591 >  DLINK_FOREACH(server_node, serv_list.head)
592    {
593 <    if (IsCapable(uplink, CAP_TS6) && HasID(source_p))
593 >    struct Client *server = server_node->data;
594 >
595 >    if (server == source_p->from)
596 >        continue;
597 >
598 >    if (IsCapable(server, CAP_SVS))
599      {
600 <      sendto_one(uplink, ":%s UID %s %d %lu %s %s %s %s %s :%s",
601 <                 source_p->servptr->id,
602 <                 source_p->name, source_p->hopcount+1,
603 <                 (unsigned long)source_p->tsinfo,
604 <                 ubuf, source_p->username, source_p->host,
605 <                 (MyClient(source_p) && IsIPSpoof(source_p)) ?
606 <                 "0" : source_p->sockhost, source_p->id, source_p->info);
600 >      if (IsCapable(server, CAP_TS6) && HasID(source_p))
601 >        sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s %s :%s",
602 >                   source_p->servptr->id,
603 >                   source_p->name, source_p->hopcount+1,
604 >                   (unsigned long)source_p->tsinfo,
605 >                   ubuf, source_p->username, source_p->host,
606 >                   (MyClient(source_p) && IsIPSpoof(source_p)) ?
607 >                   "0" : source_p->sockhost, source_p->id,
608 >                   source_p->svid,
609 >                   source_p->info);
610 >      else
611 >        sendto_one(server, "NICK %s %d %lu %s %s %s %s %s :%s",
612 >                   source_p->name, source_p->hopcount+1,
613 >                   (unsigned long)source_p->tsinfo,
614 >                   ubuf, source_p->username, source_p->host,
615 >                   source_p->servptr->name, source_p->svid,
616 >                   source_p->info);
617 >
618      }
619      else
620      {
626      sendto_one(uplink, "NICK %s %d %lu %s %s %s %s :%s",
627                 source_p->name, source_p->hopcount+1,
628                 (unsigned long)source_p->tsinfo,
629                 ubuf, source_p->username, source_p->host,
630                 source_p->servptr->name, source_p->info);
631    }
632  }
633  else
634  {
635    DLINK_FOREACH(server_node, serv_list.head)
636    {
637      struct Client *server = server_node->data;
638
639      if (IsCapable(server, CAP_LL) || server == client_p)
640        continue;
641
621        if (IsCapable(server, CAP_TS6) && HasID(source_p))
622          sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s :%s",
623                     source_p->servptr->id,
# Line 673 | Line 652 | valid_hostname(const char *hostname)
652  
653    assert(p != NULL);
654  
655 <  if ('.' == *p || ':' == *p)
655 >  if (*p == '.' || *p == ':')
656      return 0;
657  
658 <  while (*p)
680 <  {
658 >  for (; *p; ++p)
659      if (!IsHostChar(*p))
660        return 0;
683    p++;
684  }
661  
662    return 1;
663   }
# Line 705 | Line 681 | valid_username(const char *username)
681  
682    assert(p != NULL);
683  
684 <  if ('~' == *p)
684 >  if (*p == '~')
685      ++p;
686  
687    /* reject usernames that don't start with an alphanum
# Line 719 | Line 695 | valid_username(const char *username)
695    {
696      if ((*p == '.') && ConfigFileEntry.dots_in_ident)
697      {
698 <      dots++;
723 <
724 <      if (dots > ConfigFileEntry.dots_in_ident)
698 >      if (++dots > ConfigFileEntry.dots_in_ident)
699          return 0;
700 <      if (!IsUserChar(p[1]))
700 >      if (!IsUserChar(*(p + 1)))
701          return 0;
702      }
703      else if (!IsUserChar(*p))
# Line 733 | Line 707 | valid_username(const char *username)
707    return 1;
708   }
709  
710 + /* clean_nick_name()
711 + *
712 + * input        - nickname
713 + *              - whether it's a local nick (1) or remote (0)
714 + * output       - none
715 + * side effects - walks through the nickname, returning 0 if erroneous
716 + */
717 + int
718 + valid_nickname(const char *nickname, const int local)
719 + {
720 +  const char *p = nickname;
721 +  assert(nickname && *nickname);
722 +
723 +  /* nicks can't start with a digit or - or be 0 length */
724 +  /* This closer duplicates behaviour of hybrid-6 */
725 +  if (*p == '-' || (IsDigit(*p) && local) || *p == '\0')
726 +    return 0;
727 +
728 +  for (; *p; ++p)
729 +    if (!IsNickChar(*p))
730 +      return 0;
731 +
732 +  return p - nickname <= NICKLEN;
733 + }
734 +
735   /* report_and_set_user_flags()
736   *
737   * inputs       - pointer to source_p
738 < *              - pointer to aconf for this user
738 > *              - pointer to conf for this user
739   * output       - NONE
740   * side effects - Report to user any special flags
741   *                they are getting, and set them.
742   */
743   static void
744 < report_and_set_user_flags(struct Client *source_p, const struct AccessItem *aconf)
744 > report_and_set_user_flags(struct Client *source_p, const struct MaskItem *conf)
745   {
746    /* If this user is being spoofed, tell them so */
747 <  if (IsConfDoSpoofIp(aconf))
747 >  if (IsConfDoSpoofIp(conf))
748    {
749      sendto_one(source_p,
750                 ":%s NOTICE %s :*** Spoofing your IP. congrats.",
# Line 753 | Line 752 | report_and_set_user_flags(struct Client
752    }
753  
754    /* If this user is in the exception class, Set it "E lined" */
755 <  if (IsConfExemptKline(aconf))
755 >  if (IsConfExemptKline(conf))
756    {
757      SetExemptKline(source_p);
758      sendto_one(source_p,
# Line 764 | Line 763 | report_and_set_user_flags(struct Client
763    /* The else here is to make sure that G line exempt users
764     * do not get noticed twice.
765     */
766 <  else if (IsConfExemptGline(aconf))
766 >  else if (IsConfExemptGline(conf))
767    {
768      SetExemptGline(source_p);
769      sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from G lines.",
770                 me.name, source_p->name);
771    }
772  
773 <  if (IsConfExemptResv(aconf))
773 >  if (IsConfExemptResv(conf))
774    {
775      SetExemptResv(source_p);
776      sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from resvs.",
# Line 779 | Line 778 | report_and_set_user_flags(struct Client
778    }
779  
780    /* If this user is exempt from user limits set it "F lined" */
781 <  if (IsConfExemptLimits(aconf))
781 >  if (IsConfExemptLimits(conf))
782    {
783      SetExemptLimits(source_p);
784      sendto_one(source_p,
# Line 787 | Line 786 | report_and_set_user_flags(struct Client
786                 me.name,source_p->name);
787    }
788  
789 <  /* If this user is exempt from idle time outs */
791 <  if (IsConfIdlelined(aconf))
792 <  {
793 <    SetIdlelined(source_p);
794 <    sendto_one(source_p,
795 <               ":%s NOTICE %s :*** You are exempt from idle limits. congrats.",
796 <               me.name, source_p->name);
797 <  }
798 <
799 <  if (IsConfCanFlood(aconf))
789 >  if (IsConfCanFlood(conf))
790    {
791      SetCanFlood(source_p);
792      sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from flood "
# Line 805 | Line 795 | report_and_set_user_flags(struct Client
795    }
796   }
797  
808 /* do_local_user()
809 *
810 * inputs       -
811 * output       - NONE
812 * side effects -
813 */
814 void
815 do_local_user(const char *nick, struct Client *client_p, struct Client *source_p,
816              const char *username, const char *host, const char *server,
817              const char *realname)
818 {
819  assert(source_p != NULL);
820  assert(source_p->username != username);
821
822  if (source_p == NULL)
823    return;
824
825  if (!IsUnknown(source_p))
826  {
827    sendto_one(source_p, form_str(ERR_ALREADYREGISTRED),
828               me.name, nick);
829    return;
830  }
831
832  source_p->localClient->registration &= ~REG_NEED_USER;
833
834  /*
835   * don't take the clients word for it, ever
836   */
837  source_p->servptr = &me;
838
839  strlcpy(source_p->info, realname, sizeof(source_p->info));
840
841  if (!IsGotId(source_p))
842  {
843    /* save the username in the client
844     * If you move this you'll break ping cookies..you've been warned
845     */
846    strlcpy(source_p->username, username, sizeof(source_p->username));
847  }
848
849  if (!source_p->localClient->registration)
850    /* NICK already received, now I have USER... */
851    register_local_user(client_p, source_p, source_p->name, username);
852 }
853
798   /* change_simple_umode()
799   *
800   * this callback can be hooked to allow special handling of
# Line 870 | Line 814 | change_simple_umode(va_list args)
814    flag = va_arg(args, unsigned int);
815  
816    if (what == MODE_ADD)
817 <    source_p->umodes |= flag;
817 >    AddUMode(source_p, flag);
818    else
819 <    source_p->umodes &= ~flag;
819 >    DelUMode(source_p, flag);
820  
821    return NULL;
822   }
# Line 905 | Line 849 | set_user_mode(struct Client *client_p, s
849  
850    if (IsServer(source_p))
851    {
852 <     sendto_realops_flags(UMODE_ALL, L_ADMIN, "*** Mode for User %s from %s",
852 >     sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
853 >                          "*** Mode for User %s from %s",
854                            parv[1], source_p->name);
855       return;
856    }
857  
858 <  if (source_p != target_p || target_p->from != source_p->from)
858 >  if (source_p != target_p)
859    {
860       sendto_one(source_p, form_str(ERR_USERSDONTMATCH),
861                  me.name, source_p->name);
# Line 923 | Line 868 | set_user_mode(struct Client *client_p, s
868      *m++ = '+';
869  
870      for (i = 0; i < 128; i++)
871 <      if (source_p->umodes & user_modes[i])
871 >      if (HasUMode(source_p, user_modes[i]))
872          *m++ = (char)i;
873      *m = '\0';
874  
# Line 953 | Line 898 | set_user_mode(struct Client *client_p, s
898          case 'o':
899            if (what == MODE_ADD)
900            {
901 <            if (IsServer(client_p) && !IsOper(source_p))
901 >            if (IsServer(client_p) && !HasUMode(source_p, UMODE_OPER))
902              {
903                ++Count.oper;
904                SetOper(source_p);
# Line 964 | Line 909 | set_user_mode(struct Client *client_p, s
909              /* Only decrement the oper counts if an oper to begin with
910               * found by Pat Szuta, Perly , perly@xnet.com
911               */
912 <            if (!IsOper(source_p))
912 >            if (!HasUMode(source_p, UMODE_OPER))
913                break;
914  
915              ClearOper(source_p);
971            source_p->umodes &= ~ConfigFileEntry.oper_only_umodes;
916              Count.oper--;
917  
918              if (MyConnect(source_p))
919              {
920                dlink_node *dm;
921  
922 <              detach_conf(source_p, OPER_TYPE);
923 <              ClearOperFlags(source_p);
922 >              detach_conf(source_p, CONF_OPER);
923 >              ClrOFlag(source_p);
924 >              DelUMode(source_p, ConfigFileEntry.oper_only_umodes);
925  
926                if ((dm = dlinkFindDelete(&oper_list, source_p)) != NULL)
927                  free_dlink_node(dm);
# Line 988 | Line 933 | set_user_mode(struct Client *client_p, s
933          /* we may not get these,
934           * but they shouldnt be in default
935           */
936 +        case 'r':
937          case ' ' :
938          case '\n':
939          case '\r':
# Line 997 | Line 943 | set_user_mode(struct Client *client_p, s
943          default:
944            if ((flag = user_modes[(unsigned char)*m]))
945            {
946 <            if (MyConnect(source_p) && !IsOper(source_p) &&
946 >            if (MyConnect(source_p) && !HasUMode(source_p, UMODE_OPER) &&
947                  (ConfigFileEntry.oper_only_umodes & flag))
948              {
949                badflag = 1;
# Line 1020 | Line 966 | set_user_mode(struct Client *client_p, s
966      sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG),
967                 me.name, source_p->name);
968  
969 <  if ((source_p->umodes & UMODE_NCHANGE) && !IsOperN(source_p))
969 >  if (HasUMode(source_p, UMODE_NCHANGE) && !HasOFlag(source_p, OPER_FLAG_N))
970    {
971 <    sendto_one(source_p, ":%s NOTICE %s :*** You have no admin flag;",
971 >    sendto_one(source_p, ":%s NOTICE %s :*** You have no nchange flag;",
972                 me.name, source_p->name);
973 <    source_p->umodes &= ~UMODE_NCHANGE; /* only tcm's really need this */
973 >    DelUMode(source_p, UMODE_NCHANGE);
974    }
975  
976 <  if (MyConnect(source_p) && (source_p->umodes & UMODE_ADMIN) &&
977 <      !IsOperAdmin(source_p) && !IsOperHiddenAdmin(source_p))
976 >  if (MyConnect(source_p) && HasUMode(source_p, UMODE_ADMIN) &&
977 >      !HasOFlag(source_p, OPER_FLAG_ADMIN))
978    {
979      sendto_one(source_p, ":%s NOTICE %s :*** You have no admin flag;",
980                 me.name, source_p->name);
981 <    source_p->umodes &= ~UMODE_ADMIN;
981 >    DelUMode(source_p, UMODE_ADMIN);
982    }
983  
984 <  if (!(setflags & UMODE_INVISIBLE) && IsInvisible(source_p))
984 >  if (!(setflags & UMODE_INVISIBLE) && HasUMode(source_p, UMODE_INVISIBLE))
985      ++Count.invisi;
986 <  if ((setflags & UMODE_INVISIBLE) && !IsInvisible(source_p))
986 >  if ((setflags & UMODE_INVISIBLE) && !HasUMode(source_p, UMODE_INVISIBLE))
987      --Count.invisi;
988  
989    /*
# Line 1050 | Line 996 | set_user_mode(struct Client *client_p, s
996   /* send_umode()
997   * send the MODE string for user (user) to connection client_p
998   * -avalon
999 + *
1000 + * inputs       - client_p
1001 + *              - source_p
1002 + *              - int old
1003 + *              - sendmask mask of modes to send
1004 + *              - suplied umode_buf
1005 + * output       - NONE
1006   */
1007   void
1008   send_umode(struct Client *client_p, struct Client *source_p,
1009             unsigned int old, unsigned int sendmask, char *umode_buf)
1010   {
1011 +  char *m = umode_buf;
1012    int what = 0;
1013    unsigned int i;
1014    unsigned int flag;
1061  char *m = umode_buf;
1015  
1016    /*
1017     * build a string in umode_buf to represent the change in the user's
# Line 1073 | Line 1026 | send_umode(struct Client *client_p, stru
1026      if (MyClient(source_p) && !(flag & sendmask))
1027        continue;
1028  
1029 <    if ((flag & old) && !(source_p->umodes & flag))
1029 >    if ((flag & old) && !HasUMode(source_p, flag))
1030      {
1031        if (what == MODE_DEL)
1032          *m++ = (char)i;
# Line 1084 | Line 1037 | send_umode(struct Client *client_p, stru
1037          *m++ = (char)i;
1038        }
1039      }
1040 <    else if (!(flag & old) && (source_p->umodes & flag))
1040 >    else if (!(flag & old) && HasUMode(source_p, flag))
1041      {
1042        if (what == MODE_ADD)
1043          *m++ = (char)i;
# Line 1118 | Line 1071 | send_umode_out(struct Client *client_p,
1071    char buf[IRCD_BUFSIZE] = { '\0' };
1072    dlink_node *ptr = NULL;
1073  
1074 <  send_umode(NULL, source_p, old, IsOperHiddenAdmin(source_p) ?
1122 <             SEND_UMODES & ~UMODE_ADMIN : SEND_UMODES, buf);
1074 >  send_umode(NULL, source_p, old, SEND_UMODES, buf);
1075  
1076    if (buf[0])
1077    {
# Line 1128 | Line 1080 | send_umode_out(struct Client *client_p,
1080        struct Client *target_p = ptr->data;
1081  
1082        if ((target_p != client_p) && (target_p != source_p))
1083 <      {
1084 <        if ((!(ServerInfo.hub && IsCapable(target_p, CAP_LL))) ||
1085 <            (target_p->localClient->serverMask &
1134 <             source_p->lazyLinkClientExists))
1135 <          sendto_one(target_p, ":%s MODE %s :%s",
1136 <                     ID_or_name(source_p, target_p),
1137 <                     ID_or_name(source_p, target_p), buf);
1138 <      }
1083 >        sendto_one(target_p, ":%s MODE %s :%s",
1084 >                   ID_or_name(source_p, target_p),
1085 >                   ID_or_name(source_p, target_p), buf);
1086      }
1087    }
1088  
# Line 1183 | Line 1130 | user_welcome(struct Client *source_p)
1130  
1131    if (ConfigFileEntry.short_motd)
1132    {
1133 <    sendto_one(source_p, "NOTICE %s :*** Notice -- motd was last changed at %s",
1134 <               source_p->name, ConfigFileEntry.motd.lastChangedDate);
1133 >    sendto_one(source_p, ":%s NOTICE %s :*** Notice -- motd was last changed at %s",
1134 >               me.name, source_p->name, ConfigFileEntry.motd.lastChangedDate);
1135      sendto_one(source_p,
1136 <               "NOTICE %s :*** Notice -- Please read the motd if you haven't "
1137 <               "read it", source_p->name);
1136 >               ":%s NOTICE %s :*** Notice -- Please read the motd if you haven't "
1137 >               "read it", me.name, source_p->name);
1138      sendto_one(source_p, form_str(RPL_MOTDSTART),
1139                 me.name, source_p->name, me.name);
1140      sendto_one(source_p, form_str(RPL_MOTD),
# Line 1209 | Line 1156 | user_welcome(struct Client *source_p)
1156   static int
1157   check_xline(struct Client *source_p)
1158   {
1159 <  struct ConfItem *conf = NULL;
1159 >  struct MaskItem *conf = NULL;
1160    const char *reason = NULL;
1161  
1162 <  if ((conf = find_matching_name_conf(XLINE_TYPE, source_p->info, NULL, NULL, 0)) ||
1163 <      (conf = find_matching_name_conf(RXLINE_TYPE, source_p->info, NULL, NULL, 0)))
1162 >  if ((conf = find_matching_name_conf(CONF_XLINE, source_p->info, NULL, NULL, 0)) ||
1163 >      (conf = find_matching_name_conf(CONF_RXLINE, source_p->info, NULL, NULL, 0)))
1164    {
1165 <    struct MatchItem *reg = map_to_conf(conf);
1219 <
1220 <    ++reg->count;
1165 >    ++conf->count;
1166  
1167 <    if (reg->reason != NULL)
1168 <      reason = reg->reason;
1167 >    if (conf->reason != NULL)
1168 >      reason = conf->reason;
1169      else
1170        reason = "No Reason";
1171  
1172 <    sendto_realops_flags(UMODE_REJ, L_ALL,
1172 >    sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE,
1173                           "X-line Rejecting [%s] [%s], user %s [%s]",
1174                           source_p->info, reason,
1175                           get_client_name(source_p, HIDE_IP),
1176                           source_p->sockhost);
1177  
1178 <    ServerStats->is_ref++;
1179 <    if (REJECT_HOLD_TIME > 0)
1235 <    {
1236 <      sendto_one(source_p, ":%s NOTICE %s :Bad user info",
1237 <                 me.name, source_p->name);
1238 <      source_p->localClient->reject_delay = CurrentTime + REJECT_HOLD_TIME;
1239 <      SetCaptured(source_p);
1240 <    }
1241 <    else
1242 <      exit_client(source_p, &me, "Bad user info");
1178 >    ++ServerStats.is_ref;
1179 >    exit_client(source_p, &me, "Bad user info");
1180      return 1;
1181    }
1182  
# Line 1250 | Line 1187 | check_xline(struct Client *source_p)
1187   *
1188   * inputs       - pointer to given client to oper
1189   * output       - NONE
1190 < * side effects - Blindly opers up given source_p, using aconf info
1190 > * side effects - Blindly opers up given source_p, using conf info
1191   *                all checks on passwords have already been done.
1192   *                This could also be used by rsa oper routines.
1193   */
1194   void
1195   oper_up(struct Client *source_p)
1196   {
1197 <  unsigned int old = source_p->umodes;
1198 <  const char *operprivs = "";
1262 <  const struct AccessItem *oconf = NULL;
1197 >  const unsigned int old = source_p->umodes;
1198 >  const struct MaskItem *conf = source_p->localClient->confs.head->data;
1199  
1200    assert(source_p->localClient->confs.head);
1265  oconf = map_to_conf((source_p->localClient->confs.head)->data);
1201  
1202    ++Count.oper;
1203    SetOper(source_p);
1204  
1205 <  if (oconf->modes)
1206 <    source_p->umodes |= oconf->modes;
1205 >  if (conf->modes)
1206 >    AddUMode(source_p, conf->modes);
1207    else if (ConfigFileEntry.oper_umodes)
1208 <    source_p->umodes |= ConfigFileEntry.oper_umodes;
1209 <  else
1210 <    source_p->umodes |= (UMODE_SERVNOTICE|UMODE_OPERWALL|
1211 <                         UMODE_WALLOP|UMODE_LOCOPS);
1208 >    AddUMode(source_p, ConfigFileEntry.oper_umodes);
1209 >
1210 >  if (!(old & UMODE_INVISIBLE) && HasUMode(source_p, UMODE_INVISIBLE))
1211 >    ++Count.invisi;
1212 >  if ((old & UMODE_INVISIBLE) && !HasUMode(source_p, UMODE_INVISIBLE))
1213 >    --Count.invisi;
1214  
1215    assert(dlinkFind(&oper_list, source_p) == NULL);
1216    dlinkAdd(source_p, make_dlink_node(), &oper_list);
1217  
1218 <  operprivs = oper_privs_as_string(oconf->port);
1218 >  AddOFlag(source_p, conf->port);
1219  
1220 <  SetOFlag(source_p, oconf->port);
1220 >  if (HasOFlag(source_p, OPER_FLAG_ADMIN))
1221 >    AddUMode(source_p, UMODE_ADMIN);
1222 >  if (!HasOFlag(source_p, OPER_FLAG_N))
1223 >    DelUMode(source_p, UMODE_NCHANGE);
1224  
1225 <  if (IsOperAdmin(source_p) || IsOperHiddenAdmin(source_p))
1226 <    source_p->umodes |= UMODE_ADMIN;
1287 <  if (!IsOperN(source_p))
1288 <    source_p->umodes &= ~UMODE_NCHANGE;
1289 <
1290 <  sendto_realops_flags(UMODE_ALL, L_ALL, "%s (%s@%s) is now an operator",
1291 <                       source_p->name, source_p->username, source_p->host);
1225 >  sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s is now an operator",
1226 >                       get_oper_name(source_p));
1227    send_umode_out(source_p, source_p, old);
1228    sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name);
1294  sendto_one(source_p, ":%s NOTICE %s :*** Oper privs are %s",
1295             me.name, source_p->name, operprivs);
1296  send_message_file(source_p, &ConfigFileEntry.opermotd);
1229   }
1230  
1231   static char new_uid[TOTALSIDUID + 1];     /* allow for \0 */
# Line 1301 | Line 1233 | static char new_uid[TOTALSIDUID + 1];
1233   int
1234   valid_sid(const char *sid)
1235   {
1304
1236    if (strlen(sid) == IRC_MAXSID)
1237      if (IsDigit(*sid))
1238        if (IsAlNum(*(sid + 1)) && IsAlNum(*(sid + 2)))
# Line 1326 | Line 1257 | init_uid(void)
1257  
1258    memset(new_uid, 0, sizeof(new_uid));
1259  
1260 <  if (ServerInfo.sid != NULL)
1330 <  {
1260 >  if (!EmptyString(ServerInfo.sid))
1261      strlcpy(new_uid, ServerInfo.sid, sizeof(new_uid));
1332    strlcpy(me.id, ServerInfo.sid, sizeof(me.id));
1333
1334    hash_add_id(&me);
1335  }
1262  
1263 <  for (i = 0; i < IRC_MAXSID; i++)
1263 >  for (i = 0; i < IRC_MAXSID; ++i)
1264      if (new_uid[i] == '\0')
1265        new_uid[i] = 'A';
1266  
# Line 1347 | Line 1273 | init_uid(void)
1273  
1274    entering_umode_cb = register_callback("entering_umode", NULL);
1275    umode_cb = register_callback("changing_umode", change_simple_umode);
1350  uid_get_cb = register_callback("uid_get", uid_get);
1276   }
1277  
1278   /*
# Line 1390 | Line 1315 | add_one_to_uid(int i)
1315   * output       - new UID is returned to caller
1316   * side effects - new_uid is incremented by one.
1317   */
1318 < static void *
1319 < uid_get(va_list args)
1318 > static const char *
1319 > uid_get(void)
1320   {
1321    add_one_to_uid(TOTALSIDUID - 1);    /* index from 0 */
1322    return new_uid;
# Line 1414 | Line 1339 | init_isupport(void)
1339    add_isupport("DEAF", "D", -1);
1340    add_isupport("KICKLEN", NULL, KICKLEN);
1341    add_isupport("MODES", NULL, MAXMODEPARAMS);
1342 <  add_isupport("NICKLEN", NULL, NICKLEN-1);
1342 >  add_isupport("NICKLEN", NULL, NICKLEN);
1343   #ifdef HALFOPS
1344    add_isupport("PREFIX", "(ohv)@%+", -1);
1345    add_isupport("STATUSMSG", "@%+", -1);
# Line 1457 | Line 1382 | add_isupport(const char *name, const cha
1382      dlinkAddTail(support, &support->node, &support_list);
1383    }
1384  
1385 <  DupString(support->name, name);
1385 >  support->name = xstrdup(name);
1386    if (options != NULL)
1387 <    DupString(support->options, options);
1387 >    support->options = xstrdup(options);
1388    support->number = n;
1389  
1390    rebuild_isupport_message_line();

Diff Legend

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