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

Comparing:
ircd-hybrid-7.2/src/s_user.c (file contents), Revision 507 by michael, Sat Mar 4 08:20:28 2006 UTC vs.
ircd-hybrid/trunk/src/s_user.c (file contents), Revision 1618 by michael, Tue Oct 30 21:04:38 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 *);
64   static int check_xline(struct Client *);
65 < static int check_regexp_xline(struct Client *);
66 < static void introduce_client(struct Client *, struct Client *);
72 < 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 96 | 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 111 | 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 131 | 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 139 | 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 166 | 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 195 | 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 215 | 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 236 | 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 283 | 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,
287 <                    const char *nick, const char *username)
280 > register_local_user(struct Client *source_p)
281   {
282 +  const char *id = NULL;
283    const struct AccessItem *aconf = NULL;
290  char ipaddr[HOSTIPLEN];
284    dlink_node *ptr = NULL;
292  dlink_node *m = NULL;
285  
286    assert(source_p != NULL);
287 +  assert(source_p == source_p->from);
288    assert(MyConnect(source_p));
296  assert(source_p->username != username);
289    assert(!source_p->localClient->registration);
290  
291 +  ClearCap(source_p, CAP_TS6);
292 +
293    if (ConfigFileEntry.ping_cookie)
294    {
295 <    if (!IsPingSent(source_p) &&
302 <       source_p->localClient->random_ping == 0)
295 >    if (!IsPingSent(source_p) && source_p->localClient->random_ping == 0)
296      {
297 <      source_p->localClient->random_ping = (unsigned long)rand();
298 <      sendto_one(source_p, "PING :%lu",
297 >      do
298 >        source_p->localClient->random_ping = genrand_int32();
299 >      while (!source_p->localClient->random_ping);
300 >
301 >      sendto_one(source_p, "PING :%u",
302                   source_p->localClient->random_ping);
303        SetPingSent(source_p);
304        return;
# Line 312 | Line 308 | register_local_user(struct Client *clien
308        return;
309    }
310  
311 <  source_p->localClient->last = CurrentTime;
311 >  source_p->localClient->last_privmsg = CurrentTime;
312    /* Straight up the maximum rate of flooding... */
313    source_p->localClient->allow_read = MAX_FLOOD_BURST;
314  
315 <  if (!execute_callback(client_check_cb, source_p, username))
315 >  if (!execute_callback(client_check_cb, source_p, source_p->username))
316      return;
317  
318    if (valid_hostname(source_p->host) == 0)
# Line 332 | Line 328 | register_local_user(struct Client *clien
328  
329    if (!IsGotId(source_p))
330    {
331 <    const char *p = NULL;
331 >    char username[USERLEN + 1];
332 >    const char *p = username;
333      unsigned int i = 0;
334  
335      if (IsNeedIdentd(aconf))
336      {
337 <      ServerStats->is_ref++;
337 >      ++ServerStats.is_ref;
338        sendto_one(source_p, ":%s NOTICE %s :*** Notice -- You need to install "
339                   "identd to use this server", me.name, source_p->name);
340        exit_client(source_p, &me, "Install identd");
341        return;
342      }
343  
344 <    p = username;
344 >    strlcpy(username, source_p->username, sizeof(username));
345  
346      if (!IsNoTilde(aconf))
347        source_p->username[i++] = '~';
348  
349 <    while (*p && i < USERLEN)
353 <    {
349 >    for (; *p && i < USERLEN; ++p)
350        if (*p != '[')
351          source_p->username[i++] = *p;
356      p++;
357    }
352  
353      source_p->username[i] = '\0';
354    }
# Line 366 | Line 360 | register_local_user(struct Client *clien
360  
361      if (!match_conf_password(pass, aconf))
362      {
363 <      ServerStats->is_ref++;
363 >      ++ServerStats.is_ref;
364        sendto_one(source_p, form_str(ERR_PASSWDMISMATCH),
365                   me.name, source_p->name);
366        exit_client(source_p, &me, "Bad Password");
# Line 382 | Line 376 | register_local_user(struct Client *clien
376    /* report if user has &^>= etc. and set flags as needed in source_p */
377    report_and_set_user_flags(source_p, aconf);
378  
379 +  if (IsDead(source_p))
380 +    return;
381 +
382    /* Limit clients -
383     * We want to be able to have servers and F-line clients
384     * connect, so save room for "buffer" connections.
# Line 393 | Line 390 | register_local_user(struct Client *clien
390    if ((Count.local >= ServerInfo.max_clients + MAX_BUFFER) ||
391        (Count.local >= ServerInfo.max_clients && !IsExemptLimits(source_p)))
392    {
393 <    sendto_realops_flags(UMODE_FULL, L_ALL,
393 >    sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE,
394                           "Too many clients, rejecting %s[%s].",
395 <                         nick, source_p->host);
396 <    ServerStats->is_ref++;
395 >                         source_p->name, source_p->host);
396 >    ++ServerStats.is_ref;
397      exit_client(source_p, &me, "Sorry, server is full - try later");
398      return;
399    }
# Line 406 | Line 403 | register_local_user(struct Client *clien
403    {
404      char tmpstr2[IRCD_BUFSIZE];
405  
406 <    sendto_realops_flags(UMODE_REJ, L_ALL, "Invalid username: %s (%s@%s)",
407 <                         nick, source_p->username, source_p->host);
408 <    ServerStats->is_ref++;
409 <    ircsprintf(tmpstr2, "Invalid username [%s]", source_p->username);
406 >    sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE,
407 >                         "Invalid username: %s (%s@%s)",
408 >                         source_p->name, source_p->username, source_p->host);
409 >    ++ServerStats.is_ref;
410 >    snprintf(tmpstr2, sizeof(tmpstr2), "Invalid username [%s]",
411 >             source_p->username);
412      exit_client(source_p, &me, tmpstr2);
413      return;
414    }
415  
416 <  assert(source_p == client_p);
418 <
419 <  /* end of valid user name check */
420 <  if (check_xline(source_p) || check_regexp_xline(source_p))
416 >  if (check_xline(source_p))
417      return;
418  
419 <  if (IsDead(client_p))
420 <    return;
425 <
426 <  if (source_p->id[0] == '\0' && me.id[0])
427 <  {
428 <    char *id = (char *)execute_callback(uid_get_cb, source_p);
429 <    while (hash_find_id(id) != NULL)
430 <      id = uid_get(NULL);
419 >  while (hash_find_id((id = uid_get())) != NULL)
420 >    ;
421  
422 <    strlcpy(source_p->id, id, sizeof(source_p->id));
423 <    hash_add_id(source_p);
434 <  }
435 <
436 <  irc_getnameinfo((struct sockaddr *)&source_p->localClient->ip,
437 <                  source_p->localClient->ip.ss_len, ipaddr,
438 <                  HOSTIPLEN, NULL, 0, NI_NUMERICHOST);
422 >  strlcpy(source_p->id, id, sizeof(source_p->id));
423 >  hash_add_id(source_p);
424  
425 <  sendto_realops_flags(UMODE_CCONN, L_ALL,
426 <                       "Client connecting: %s (%s@%s) [%s] {%s} [%s]",
427 <                       nick, source_p->username, source_p->host,
425 >  sendto_realops_flags(UMODE_CCONN, L_ALL, SEND_NOTICE,
426 >                       "Client connecting: %s (%s@%s) [%s] {%s} [%s] <%s>",
427 >                       source_p->name, source_p->username, source_p->host,
428 >                       ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
429 >                       "255.255.255.255" : source_p->sockhost,
430 >                       get_client_class(source_p),
431 >                       source_p->info, source_p->id);
432 >
433 >  sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, SEND_NOTICE,
434 >                       "CLICONN %s %s %s %s %s %s %s 0 %s",
435 >                       source_p->name, source_p->username, source_p->host,
436                         ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
437 <                       "255.255.255.255" : ipaddr, get_client_class(source_p),
437 >                       "255.255.255.255" : source_p->sockhost,
438 >                       get_client_class(source_p),
439 >                       ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
440 >                           "<hidden>" : source_p->localClient->client_host,
441 >                       ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
442 >                           "<hidden>" : source_p->localClient->client_server,
443                         source_p->info);
444  
447  /* If they have died in send_* don't do anything. */
448  if (IsDead(source_p))
449    return;
445  
446    if (ConfigFileEntry.invisible_on_connect)
447    {
448 <    source_p->umodes |= UMODE_INVISIBLE;
449 <    Count.invisi++;
448 >    AddUMode(source_p, UMODE_INVISIBLE);
449 >    ++Count.invisi;
450    }
451  
452    if ((++Count.local) > Count.max_loc)
# Line 459 | Line 454 | register_local_user(struct Client *clien
454      Count.max_loc = Count.local;
455  
456      if (!(Count.max_loc % 10))
457 <      sendto_realops_flags(UMODE_ALL, L_ALL, "New Max Local Clients: %d",
457 >      sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
458 >                           "New Max Local Clients: %d",
459                             Count.max_loc);
460    }
461  
466  SetClient(source_p);
467
468  source_p->servptr = &me;
469  dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);
470
462    /* Increment our total user count here */
463    if (++Count.total > Count.max_tot)
464      Count.max_tot = Count.total;
465 <  Count.totalrestartcount++;
465 >  ++Count.totalrestartcount;
466 >
467 >  assert(source_p->servptr == &me);
468 >  SetClient(source_p);
469 >  dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->client_list);
470  
471    source_p->localClient->allow_read = MAX_FLOOD_BURST;
472  
473 <  if ((m = dlinkFindDelete(&unknown_list, source_p)) != NULL)
474 <  {
475 <    free_dlink_node(m);
476 <    dlinkAdd(source_p, &source_p->localClient->lclient_node, &local_client_list);
482 <  }
483 <  else assert(0);
473 >  assert(dlinkFind(&unknown_list, source_p));
474 >
475 >  dlink_move_node(&source_p->localClient->lclient_node,
476 >                  &unknown_list, &local_client_list);
477  
478    user_welcome(source_p);
479    add_user_host(source_p->username, source_p->host, 0);
480    SetUserHost(source_p);
481  
482 <  introduce_client(client_p, source_p);
482 >  introduce_client(source_p);
483   }
484  
485   /* register_remote_user()
486   *
487 < * inputs       - client_p directly connected client
495 < *              - source_p remote or directly connected client
487 > * inputs       - source_p remote or directly connected client
488   *              - username to register as
489   *              - host name to register as
490   *              - server name
# Line 502 | Line 494 | register_local_user(struct Client *clien
494   *                is introduced by a server.
495   */
496   void
497 < register_remote_user(struct Client *client_p, struct Client *source_p,
497 > register_remote_user(struct Client *source_p,
498                       const char *username, const char *host, const char *server,
499                       const char *realname)
500   {
# Line 512 | Line 504 | register_remote_user(struct Client *clie
504    assert(source_p->username != username);
505  
506    strlcpy(source_p->host, host, sizeof(source_p->host));
515  strlcpy(source_p->info, realname, sizeof(source_p->info));
507    strlcpy(source_p->username, username, sizeof(source_p->username));
508  
518  /* Increment our total user count here */
519  if (++Count.total > Count.max_tot)
520    Count.max_tot = Count.total;
521
522  source_p->from->serv->dep_users++;
523
509    /*
510     * coming from another server, take the servers word for it
511     */
512 <  source_p->servptr = find_server(server);
512 >  source_p->servptr = hash_find_server(server);
513  
514 <  /* Super GhostDetect:
514 >  /*
515 >   * Super GhostDetect:
516     * If we can't find the server the user is supposed to be on,
517     * then simply blow the user away.        -Taner
518     */
519    if (source_p->servptr == NULL)
520    {
521 <    sendto_realops_flags(UMODE_ALL, L_ALL,
521 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
522                           "No server %s for user %s[%s@%s] from %s",
523                           server, source_p->name, source_p->username,
524                           source_p->host, source_p->from->name);
525 <    kill_client(client_p, source_p, "%s (Server doesn't exist)", me.name);
525 >    kill_client(source_p->from, source_p, "%s (Server doesn't exist)", me.name);
526  
527 <    SetKilled(source_p);
527 >    AddFlag(source_p, FLAGS_KILLED);
528      exit_client(source_p, &me, "Ghosted Client");
529      return;
530    }
531  
532    if ((target_p = source_p->servptr) && target_p->from != source_p->from)
533    {
534 <    sendto_realops_flags(UMODE_DEBUG, L_ALL,
534 >    sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
535                           "Bad User [%s] :%s USER %s@%s %s, != %s[%s]",
536 <                         client_p->name, source_p->name, source_p->username,
536 >                         source_p->from->name, source_p->name, source_p->username,
537                           source_p->host, source_p->servptr->name,
538                           target_p->name, target_p->from->name);
539 <    kill_client(client_p, source_p,
539 >    kill_client(source_p->from, source_p,
540                  "%s (NICK from wrong direction (%s != %s))",
541                  me.name, source_p->servptr->name, target_p->from->name);
542 <    SetKilled(source_p);
542 >    AddFlag(source_p, FLAGS_KILLED);
543      exit_client(source_p, &me, "USER server wrong direction");
544      return;
545    }
546  
547 +  /*
548 +   * If the nick has been introduced by a services server,
549 +   * make it a service as well.
550 +   */
551 +  if (HasFlag(source_p->servptr, FLAGS_SERVICE))
552 +    AddFlag(source_p, FLAGS_SERVICE);
553 +
554 +  /* Increment our total user count here */
555 +  if (++Count.total > Count.max_tot)
556 +    Count.max_tot = Count.total;
557 +
558    SetClient(source_p);
559 <  dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);
559 >  dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->client_list);
560    add_user_host(source_p->username, source_p->host, 1);
561    SetUserHost(source_p);
562  
563 <  introduce_client(client_p, source_p);
563 >  introduce_client(source_p);
564   }
565  
566   /* introduce_client()
567   *
568 < * inputs       - client_p
572 < *              - source_p
568 > * inputs       - source_p
569   * output       - NONE
570   * side effects - This common function introduces a client to the rest
571   *                of the net, either from a local client connect or
572   *                from a remote connect.
573   */
574   static void
575 < introduce_client(struct Client *client_p, struct Client *source_p)
575 > introduce_client(struct Client *source_p)
576   {
577    dlink_node *server_node = NULL;
578    static char ubuf[12];
# Line 586 | Line 582 | introduce_client(struct Client *client_p
582    else
583      send_umode(NULL, source_p, 0, SEND_UMODES, ubuf);
584  
585 +  watch_check_hash(source_p, RPL_LOGON);
586 +
587    if (*ubuf == '\0')
588    {
589      ubuf[0] = '+';
590      ubuf[1] = '\0';
591    }
592  
593 <  /* arghhh one could try not introducing new nicks to ll leafs
596 <   * but then you have to introduce them "on the fly" in SJOIN
597 <   * not fun.
598 <   * Its not going to cost much more bandwidth to simply let new
599 <   * nicks just ride on through.
600 <   */
601 <
602 <  /* We now introduce nicks "on the fly" in SJOIN anyway --
603 <   * you _need_ to if you aren't going to burst everyone initially.
604 <   *
605 <   * Only send to non CAP_LL servers, unless we're a lazylink leaf,
606 <   * in that case just send it to the uplink.
607 <   * -davidt
608 <   * rewritten to cope with SIDs .. eww eww eww --is
609 <   */
610 <  if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL) &&
611 <      client_p != uplink)
593 >  DLINK_FOREACH(server_node, serv_list.head)
594    {
595 <    if (IsCapable(uplink, CAP_TS6) && HasID(source_p))
595 >    struct Client *server = server_node->data;
596 >
597 >    if (server == source_p->from)
598 >        continue;
599 >
600 >    if (IsCapable(server, CAP_SVS))
601      {
602 <      sendto_one(uplink, ":%s UID %s %d %lu %s %s %s %s %s :%s",
603 <                 source_p->servptr->id,
604 <                 source_p->name, source_p->hopcount+1,
605 <                 (unsigned long)source_p->tsinfo,
606 <                 ubuf, source_p->username, source_p->host,
607 <                 (MyClient(source_p) && IsIPSpoof(source_p)) ?
608 <                 "0" : source_p->sockhost, source_p->id, source_p->info);
602 >      if (IsCapable(server, CAP_TS6) && HasID(source_p))
603 >        sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s %s :%s",
604 >                   source_p->servptr->id,
605 >                   source_p->name, source_p->hopcount+1,
606 >                   (unsigned long)source_p->tsinfo,
607 >                   ubuf, source_p->username, source_p->host,
608 >                   (MyClient(source_p) && IsIPSpoof(source_p)) ?
609 >                   "0" : source_p->sockhost, source_p->id,
610 >                   source_p->svid,
611 >                   source_p->info);
612 >      else
613 >        sendto_one(server, "NICK %s %d %lu %s %s %s %s %s :%s",
614 >                   source_p->name, source_p->hopcount+1,
615 >                   (unsigned long)source_p->tsinfo,
616 >                   ubuf, source_p->username, source_p->host,
617 >                   source_p->servptr->name, source_p->svid,
618 >                   source_p->info);
619 >
620      }
621      else
622      {
625      sendto_one(uplink, "NICK %s %d %lu %s %s %s %s :%s",
626                 source_p->name, source_p->hopcount+1,
627                 (unsigned long)source_p->tsinfo,
628                 ubuf, source_p->username, source_p->host,
629                 source_p->servptr->name, source_p->info);
630    }
631  }
632  else
633  {
634    DLINK_FOREACH(server_node, serv_list.head)
635    {
636      struct Client *server = server_node->data;
637
638      if (IsCapable(server, CAP_LL) || server == client_p)
639        continue;
640
623        if (IsCapable(server, CAP_TS6) && HasID(source_p))
624          sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s :%s",
625                     source_p->servptr->id,
# Line 672 | Line 654 | valid_hostname(const char *hostname)
654  
655    assert(p != NULL);
656  
657 <  if ('.' == *p || ':' == *p)
657 >  if (*p == '.' || *p == ':')
658      return 0;
659  
660 <  while (*p)
679 <  {
660 >  for (; *p; ++p)
661      if (!IsHostChar(*p))
662        return 0;
682    p++;
683  }
663  
664    return 1;
665   }
# Line 704 | Line 683 | valid_username(const char *username)
683  
684    assert(p != NULL);
685  
686 <  if ('~' == *p)
686 >  if (*p == '~')
687      ++p;
688  
689    /* reject usernames that don't start with an alphanum
# Line 718 | Line 697 | valid_username(const char *username)
697    {
698      if ((*p == '.') && ConfigFileEntry.dots_in_ident)
699      {
700 <      dots++;
722 <
723 <      if (dots > ConfigFileEntry.dots_in_ident)
700 >      if (++dots > ConfigFileEntry.dots_in_ident)
701          return 0;
702 <      if (!IsUserChar(p[1]))
702 >      if (!IsUserChar(*(p + 1)))
703          return 0;
704      }
705      else if (!IsUserChar(*p))
# Line 732 | Line 709 | valid_username(const char *username)
709    return 1;
710   }
711  
712 + /* clean_nick_name()
713 + *
714 + * input        - nickname
715 + *              - whether it's a local nick (1) or remote (0)
716 + * output       - none
717 + * side effects - walks through the nickname, returning 0 if erroneous
718 + */
719 + int
720 + valid_nickname(const char *nickname, const int local)
721 + {
722 +  const char *p = nickname;
723 +  assert(nickname && *nickname);
724 +
725 +  /* nicks can't start with a digit or - or be 0 length */
726 +  /* This closer duplicates behaviour of hybrid-6 */
727 +  if (*p == '-' || (IsDigit(*p) && local) || *p == '\0')
728 +    return 0;
729 +
730 +  for (; *p; ++p)
731 +    if (!IsNickChar(*p))
732 +      return 0;
733 +
734 +  return p - nickname <= NICKLEN;
735 + }
736 +
737   /* report_and_set_user_flags()
738   *
739   * inputs       - pointer to source_p
# Line 786 | Line 788 | report_and_set_user_flags(struct Client
788                 me.name,source_p->name);
789    }
790  
789  /* If this user is exempt from idle time outs */
790  if (IsConfIdlelined(aconf))
791  {
792    SetIdlelined(source_p);
793    sendto_one(source_p,
794               ":%s NOTICE %s :*** You are exempt from idle limits. congrats.",
795               me.name, source_p->name);
796  }
797
791    if (IsConfCanFlood(aconf))
792    {
793      SetCanFlood(source_p);
# Line 804 | Line 797 | report_and_set_user_flags(struct Client
797    }
798   }
799  
807 /* do_local_user()
808 *
809 * inputs       -
810 * output       - NONE
811 * side effects -
812 */
813 void
814 do_local_user(const char *nick, struct Client *client_p, struct Client *source_p,
815              const char *username, const char *host, const char *server,
816              const char *realname)
817 {
818  assert(source_p != NULL);
819  assert(source_p->username != username);
820
821  if (source_p == NULL)
822    return;
823
824  if (!IsUnknown(source_p))
825  {
826    sendto_one(source_p, form_str(ERR_ALREADYREGISTRED),
827               me.name, nick);
828    return;
829  }
830
831  source_p->localClient->registration &= ~REG_NEED_USER;
832
833  /*
834   * don't take the clients word for it, ever
835   */
836  source_p->servptr = &me;
837
838  strlcpy(source_p->info, realname, sizeof(source_p->info));
839
840  if (!IsGotId(source_p))
841  {
842    /* save the username in the client
843     * If you move this you'll break ping cookies..you've been warned
844     */
845    strlcpy(source_p->username, username, sizeof(source_p->username));
846  }
847
848  if (!source_p->localClient->registration)
849    /* NICK already received, now I have USER... */
850    register_local_user(client_p, source_p, source_p->name, username);
851 }
852
800   /* change_simple_umode()
801   *
802   * this callback can be hooked to allow special handling of
# Line 858 | Line 805 | do_local_user(const char *nick, struct C
805   static void *
806   change_simple_umode(va_list args)
807   {
808 +  struct Client *client_p;
809    struct Client *source_p;
810    int what;
811    unsigned int flag;
812  
813 <  va_arg(args, struct Client *);
813 >  client_p = va_arg(args, struct Client *);
814    source_p = va_arg(args, struct Client *);
815    what = va_arg(args, int);
816    flag = va_arg(args, unsigned int);
817  
818    if (what == MODE_ADD)
819 <    source_p->umodes |= flag;
819 >    AddUMode(source_p, flag);
820    else
821 <    source_p->umodes &= ~flag;
821 >    DelUMode(source_p, flag);
822  
823    return NULL;
824   }
# Line 903 | Line 851 | set_user_mode(struct Client *client_p, s
851  
852    if (IsServer(source_p))
853    {
854 <     sendto_realops_flags(UMODE_ALL, L_ADMIN, "*** Mode for User %s from %s",
854 >     sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
855 >                          "*** Mode for User %s from %s",
856                            parv[1], source_p->name);
857       return;
858    }
859  
860 <  if (source_p != target_p || target_p->from != source_p->from)
860 >  if (source_p != target_p)
861    {
862       sendto_one(source_p, form_str(ERR_USERSDONTMATCH),
863                  me.name, source_p->name);
# Line 921 | Line 870 | set_user_mode(struct Client *client_p, s
870      *m++ = '+';
871  
872      for (i = 0; i < 128; i++)
873 <      if (source_p->umodes & user_modes[i])
873 >      if (HasUMode(source_p, user_modes[i]))
874          *m++ = (char)i;
875      *m = '\0';
876  
# Line 951 | Line 900 | set_user_mode(struct Client *client_p, s
900          case 'o':
901            if (what == MODE_ADD)
902            {
903 <            if (IsServer(client_p) && !IsOper(source_p))
903 >            if (IsServer(client_p) && !HasUMode(source_p, UMODE_OPER))
904              {
905                ++Count.oper;
906                SetOper(source_p);
# Line 962 | Line 911 | set_user_mode(struct Client *client_p, s
911              /* Only decrement the oper counts if an oper to begin with
912               * found by Pat Szuta, Perly , perly@xnet.com
913               */
914 <            if (!IsOper(source_p))
914 >            if (!HasUMode(source_p, UMODE_OPER))
915                break;
916  
917              ClearOper(source_p);
969            source_p->umodes &= ~ConfigFileEntry.oper_only_umodes;
918              Count.oper--;
919  
920              if (MyConnect(source_p))
# Line 974 | Line 922 | set_user_mode(struct Client *client_p, s
922                dlink_node *dm;
923  
924                detach_conf(source_p, OPER_TYPE);
925 <              ClearOperFlags(source_p);
925 >              ClrOFlag(source_p);
926 >              DelUMode(source_p, ConfigFileEntry.oper_only_umodes);
927  
928                if ((dm = dlinkFindDelete(&oper_list, source_p)) != NULL)
929                  free_dlink_node(dm);
# Line 986 | Line 935 | set_user_mode(struct Client *client_p, s
935          /* we may not get these,
936           * but they shouldnt be in default
937           */
938 +        case 'r':
939          case ' ' :
940          case '\n':
941          case '\r':
# Line 995 | Line 945 | set_user_mode(struct Client *client_p, s
945          default:
946            if ((flag = user_modes[(unsigned char)*m]))
947            {
948 <            if (MyConnect(source_p) && !IsOper(source_p) &&
948 >            if (MyConnect(source_p) && !HasUMode(source_p, UMODE_OPER) &&
949                  (ConfigFileEntry.oper_only_umodes & flag))
950              {
951                badflag = 1;
# Line 1018 | Line 968 | set_user_mode(struct Client *client_p, s
968      sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG),
969                 me.name, source_p->name);
970  
971 <  if ((source_p->umodes & UMODE_NCHANGE) && !IsOperN(source_p))
971 >  if (HasUMode(source_p, UMODE_NCHANGE) && !HasOFlag(source_p, OPER_FLAG_N))
972    {
973 <    sendto_one(source_p, ":%s NOTICE %s :*** You have no admin flag;",
973 >    sendto_one(source_p, ":%s NOTICE %s :*** You have no nchange flag;",
974                 me.name, source_p->name);
975 <    source_p->umodes &= ~UMODE_NCHANGE; /* only tcm's really need this */
975 >    DelUMode(source_p, UMODE_NCHANGE);
976    }
977  
978 <  if (MyConnect(source_p) && (source_p->umodes & UMODE_ADMIN) &&
979 <      !IsOperAdmin(source_p) && !IsOperHiddenAdmin(source_p))
978 >  if (MyConnect(source_p) && HasUMode(source_p, UMODE_ADMIN) &&
979 >      !HasOFlag(source_p, OPER_FLAG_ADMIN))
980    {
981      sendto_one(source_p, ":%s NOTICE %s :*** You have no admin flag;",
982                 me.name, source_p->name);
983 <    source_p->umodes &= ~UMODE_ADMIN;
983 >    DelUMode(source_p, UMODE_ADMIN);
984    }
985  
986 <  if (!(setflags & UMODE_INVISIBLE) && IsInvisible(source_p))
986 >  if (!(setflags & UMODE_INVISIBLE) && HasUMode(source_p, UMODE_INVISIBLE))
987      ++Count.invisi;
988 <  if ((setflags & UMODE_INVISIBLE) && !IsInvisible(source_p))
988 >  if ((setflags & UMODE_INVISIBLE) && !HasUMode(source_p, UMODE_INVISIBLE))
989      --Count.invisi;
990  
991    /*
# Line 1048 | Line 998 | set_user_mode(struct Client *client_p, s
998   /* send_umode()
999   * send the MODE string for user (user) to connection client_p
1000   * -avalon
1001 + *
1002 + * inputs       - client_p
1003 + *              - source_p
1004 + *              - int old
1005 + *              - sendmask mask of modes to send
1006 + *              - suplied umode_buf
1007 + * output       - NONE
1008   */
1009   void
1010   send_umode(struct Client *client_p, struct Client *source_p,
1011             unsigned int old, unsigned int sendmask, char *umode_buf)
1012   {
1013 +  char *m = umode_buf;
1014    int what = 0;
1015    unsigned int i;
1016    unsigned int flag;
1059  char *m = umode_buf;
1017  
1018    /*
1019     * build a string in umode_buf to represent the change in the user's
# Line 1071 | Line 1028 | send_umode(struct Client *client_p, stru
1028      if (MyClient(source_p) && !(flag & sendmask))
1029        continue;
1030  
1031 <    if ((flag & old) && !(source_p->umodes & flag))
1031 >    if ((flag & old) && !HasUMode(source_p, flag))
1032      {
1033        if (what == MODE_DEL)
1034          *m++ = (char)i;
# Line 1082 | Line 1039 | send_umode(struct Client *client_p, stru
1039          *m++ = (char)i;
1040        }
1041      }
1042 <    else if (!(flag & old) && (source_p->umodes & flag))
1042 >    else if (!(flag & old) && HasUMode(source_p, flag))
1043      {
1044        if (what == MODE_ADD)
1045          *m++ = (char)i;
# Line 1098 | Line 1055 | send_umode(struct Client *client_p, stru
1055    *m = '\0';
1056  
1057    if (*umode_buf && client_p)
1058 <    sendto_one(client_p, ":%s MODE %s :%s",
1059 <               source_p->name, source_p->name, umode_buf);
1058 >    sendto_one(client_p, ":%s!%s@%s MODE %s :%s",
1059 >               source_p->name, source_p->username,
1060 >               source_p->host, source_p->name, umode_buf);
1061   }
1062  
1063   /* send_umode_out()
# Line 1112 | Line 1070 | void
1070   send_umode_out(struct Client *client_p, struct Client *source_p,
1071                 unsigned int old)
1072   {
1073 <  char buf[IRCD_BUFSIZE];
1073 >  char buf[IRCD_BUFSIZE] = { '\0' };
1074    dlink_node *ptr = NULL;
1075  
1076 <  send_umode(NULL, source_p, old, IsOperHiddenAdmin(source_p) ?
1119 <             SEND_UMODES & ~UMODE_ADMIN : SEND_UMODES, buf);
1076 >  send_umode(NULL, source_p, old, SEND_UMODES, buf);
1077  
1078 <  if (*buf)
1078 >  if (buf[0])
1079    {
1080      DLINK_FOREACH(ptr, serv_list.head)
1081      {
1082        struct Client *target_p = ptr->data;
1083  
1084        if ((target_p != client_p) && (target_p != source_p))
1085 <      {
1086 <        if ((!(ServerInfo.hub && IsCapable(target_p, CAP_LL))) ||
1087 <            (target_p->localClient->serverMask &
1131 <             source_p->lazyLinkClientExists))
1132 <          sendto_one(target_p, ":%s MODE %s :%s",
1133 <                     ID_or_name(source_p, target_p),
1134 <                     ID_or_name(source_p, target_p), buf);
1135 <      }
1085 >        sendto_one(target_p, ":%s MODE %s :%s",
1086 >                   ID_or_name(source_p, target_p),
1087 >                   ID_or_name(source_p, target_p), buf);
1088      }
1089    }
1090  
# Line 1180 | Line 1132 | user_welcome(struct Client *source_p)
1132  
1133    if (ConfigFileEntry.short_motd)
1134    {
1135 <    sendto_one(source_p, "NOTICE %s :*** Notice -- motd was last changed at %s",
1136 <               source_p->name, ConfigFileEntry.motd.lastChangedDate);
1135 >    sendto_one(source_p, ":%s NOTICE %s :*** Notice -- motd was last changed at %s",
1136 >               me.name, source_p->name, ConfigFileEntry.motd.lastChangedDate);
1137      sendto_one(source_p,
1138 <               "NOTICE %s :*** Notice -- Please read the motd if you haven't "
1139 <               "read it", source_p->name);
1138 >               ":%s NOTICE %s :*** Notice -- Please read the motd if you haven't "
1139 >               "read it", me.name, source_p->name);
1140      sendto_one(source_p, form_str(RPL_MOTDSTART),
1141                 me.name, source_p->name, me.name);
1142      sendto_one(source_p, form_str(RPL_MOTD),
# Line 1206 | Line 1158 | user_welcome(struct Client *source_p)
1158   static int
1159   check_xline(struct Client *source_p)
1160   {
1209  struct ConfItem *conf;
1210  struct MatchItem *xconf;
1211  const char *reason;
1212
1213  if ((conf = find_matching_name_conf(XLINE_TYPE, source_p->info,
1214                                      NULL, NULL, 0)) != NULL)
1215  {
1216    xconf = map_to_conf(conf);
1217    xconf->count++;
1218
1219    if (xconf->reason != NULL)
1220      reason = xconf->reason;
1221    else
1222      reason = "No Reason";
1223
1224    sendto_realops_flags(UMODE_REJ, L_ALL,
1225                         "X-line Rejecting [%s] [%s], user %s [%s]",
1226                         source_p->info, reason,
1227                         get_client_name(source_p, HIDE_IP),
1228                         source_p->sockhost);
1229
1230    ServerStats->is_ref++;      
1231    if (REJECT_HOLD_TIME > 0)
1232    {
1233      sendto_one(source_p, ":%s NOTICE %s :Bad user info",
1234                 me.name, source_p->name);
1235      source_p->localClient->reject_delay = CurrentTime + REJECT_HOLD_TIME;
1236      SetCaptured(source_p);
1237    }
1238    else
1239      exit_client(source_p, &me, "Bad user info");
1240    return 1;
1241  }
1242
1243  return 0;
1244 }
1245
1246 static int
1247 check_regexp_xline(struct Client *source_p)
1248 {
1161    struct ConfItem *conf = NULL;
1162    const char *reason = NULL;
1163  
1164 <  if ((conf = find_matching_name_conf(RXLINE_TYPE, source_p->info, NULL, NULL, 0)))
1164 >  if ((conf = find_matching_name_conf(XLINE_TYPE, source_p->info, NULL, NULL, 0)) ||
1165 >      (conf = find_matching_name_conf(RXLINE_TYPE, source_p->info, NULL, NULL, 0)))
1166    {
1167      struct MatchItem *reg = map_to_conf(conf);
1168  
# Line 1260 | Line 1173 | check_regexp_xline(struct Client *source
1173      else
1174        reason = "No Reason";
1175  
1176 <    sendto_realops_flags(UMODE_REJ, L_ALL,
1177 <                         "X-line (REGEX) Rejecting [%s] [%s], user %s [%s]",
1176 >    sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE,
1177 >                         "X-line Rejecting [%s] [%s], user %s [%s]",
1178                           source_p->info, reason,
1179                           get_client_name(source_p, HIDE_IP),
1180                           source_p->sockhost);
1181  
1182 <    ServerStats->is_ref++;
1182 >    ++ServerStats.is_ref;
1183      exit_client(source_p, &me, "Bad user info");
1184      return 1;
1185    }
# Line 1285 | Line 1198 | check_regexp_xline(struct Client *source
1198   void
1199   oper_up(struct Client *source_p)
1200   {
1201 <  unsigned int old = source_p->umodes;
1289 <  const char *operprivs = "";
1201 >  const unsigned int old = source_p->umodes;
1202    const struct AccessItem *oconf = NULL;
1203  
1204    assert(source_p->localClient->confs.head);
# Line 1296 | Line 1208 | oper_up(struct Client *source_p)
1208    SetOper(source_p);
1209  
1210    if (oconf->modes)
1211 <    source_p->umodes |= oconf->modes;
1211 >    AddUMode(source_p, oconf->modes);
1212    else if (ConfigFileEntry.oper_umodes)
1213 <    source_p->umodes |= ConfigFileEntry.oper_umodes;
1214 <  else
1215 <    source_p->umodes |= (UMODE_SERVNOTICE|UMODE_OPERWALL|
1216 <                         UMODE_WALLOP|UMODE_LOCOPS);
1213 >    AddUMode(source_p, ConfigFileEntry.oper_umodes);
1214 >
1215 >  if (!(old & UMODE_INVISIBLE) && HasUMode(source_p, UMODE_INVISIBLE))
1216 >    ++Count.invisi;
1217 >  if ((old & UMODE_INVISIBLE) && !HasUMode(source_p, UMODE_INVISIBLE))
1218 >    --Count.invisi;
1219  
1220    assert(dlinkFind(&oper_list, source_p) == NULL);
1221    dlinkAdd(source_p, make_dlink_node(), &oper_list);
1222  
1223 <  operprivs = oper_privs_as_string(oconf->port);
1223 >  AddOFlag(source_p, oconf->port);
1224  
1225 <  SetOFlag(source_p, oconf->port);
1225 >  if (HasOFlag(source_p, OPER_FLAG_ADMIN))
1226 >    AddUMode(source_p, UMODE_ADMIN);
1227 >  if (!HasOFlag(source_p, OPER_FLAG_N))
1228 >    DelUMode(source_p, UMODE_NCHANGE);
1229  
1230 <  if (IsOperAdmin(source_p) || IsOperHiddenAdmin(source_p))
1231 <    source_p->umodes |= UMODE_ADMIN;
1315 <  if (!IsOperN(source_p))
1316 <    source_p->umodes &= ~UMODE_NCHANGE;
1317 <
1318 <  sendto_realops_flags(UMODE_ALL, L_ALL, "%s (%s@%s) is now an operator",
1319 <                       source_p->name, source_p->username, source_p->host);
1230 >  sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s is now an operator",
1231 >                       get_oper_name(source_p));
1232    send_umode_out(source_p, source_p, old);
1233    sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name);
1322  sendto_one(source_p, ":%s NOTICE %s :*** Oper privs are %s",
1323             me.name, source_p->name, operprivs);
1324  send_message_file(source_p, &ConfigFileEntry.opermotd);
1234   }
1235  
1236 < /*
1237 < * Quick and dirty UID code for new proposed SID on EFnet
1238 < *
1239 < */
1236 > static char new_uid[TOTALSIDUID + 1];     /* allow for \0 */
1237 >
1238 > int
1239 > valid_sid(const char *sid)
1240 > {
1241 >  if (strlen(sid) == IRC_MAXSID)
1242 >    if (IsDigit(*sid))
1243 >      if (IsAlNum(*(sid + 1)) && IsAlNum(*(sid + 2)))
1244 >        return 1;
1245  
1246 < static char new_uid[TOTALSIDUID+1];     /* allow for \0 */
1247 < static void add_one_to_uid(int i);
1246 >  return 0;
1247 > }
1248  
1249   /*
1250   * init_uid()
# Line 1348 | Line 1262 | init_uid(void)
1262  
1263    memset(new_uid, 0, sizeof(new_uid));
1264  
1265 <  if (ServerInfo.sid != NULL)
1266 <  {
1353 <    memcpy(new_uid, ServerInfo.sid, IRCD_MIN(strlen(ServerInfo.sid),
1354 <                                             IRC_MAXSID));
1355 <    memcpy(&me.id, ServerInfo.sid, IRCD_MIN(strlen(ServerInfo.sid),
1356 <                                            IRC_MAXSID));
1357 <    hash_add_id(&me);
1358 <  }
1265 >  if (!EmptyString(ServerInfo.sid))
1266 >    strlcpy(new_uid, ServerInfo.sid, sizeof(new_uid));
1267  
1268 <  for (i = 0; i < IRC_MAXSID; i++)
1268 >  for (i = 0; i < IRC_MAXSID; ++i)
1269      if (new_uid[i] == '\0')
1270        new_uid[i] = 'A';
1271  
1272 <  /* XXX if IRC_MAXUID != 6, this will have to be rewritten */
1272 >  /* NOTE: if IRC_MAXUID != 6, this will have to be rewritten */
1273    /* Yes nenolod, I have known it was off by one ever since I wrote it
1274     * But *JUST* for you, though, it really doesn't look as *pretty*
1275     * -Dianora
1276     */
1277 <  memcpy(new_uid+IRC_MAXSID, "AAAAA@", IRC_MAXUID);
1277 >  memcpy(new_uid + IRC_MAXSID, "AAAAA@", IRC_MAXUID);
1278  
1279    entering_umode_cb = register_callback("entering_umode", NULL);
1280    umode_cb = register_callback("changing_umode", change_simple_umode);
1373  uid_get_cb = register_callback("uid_get", uid_get);
1374 }
1375
1376 /*
1377 * uid_get
1378 *
1379 * inputs       - struct Client *
1380 * output       - new UID is returned to caller
1381 * side effects - new_uid is incremented by one.
1382 */
1383 static void *
1384 uid_get(va_list args)
1385 {
1386  add_one_to_uid(TOTALSIDUID-1);    /* index from 0 */
1387  return ((void *) new_uid);
1281   }
1282  
1283   /*
# Line 1407 | Line 1300 | add_one_to_uid(int i)
1300        new_uid[i] = 'A';
1301        add_one_to_uid(i-1);
1302      }
1303 <    else new_uid[i] = new_uid[i] + 1;
1303 >    else
1304 >      ++new_uid[i];
1305    }
1306    else
1307    {
1308 <    /* XXX if IRC_MAXUID != 6, this will have to be rewritten */
1308 >    /* NOTE: if IRC_MAXUID != 6, this will have to be rewritten */
1309      if (new_uid[i] == 'Z')
1310 <      memcpy(new_uid+IRC_MAXSID, "AAAAAA", IRC_MAXUID);
1310 >      memcpy(new_uid + IRC_MAXSID, "AAAAAA", IRC_MAXUID);
1311      else
1312 <      new_uid[i] = new_uid[i] + 1;
1312 >      ++new_uid[i];
1313    }
1314   }
1315  
1316   /*
1317 + * uid_get
1318 + *
1319 + * inputs       - struct Client *
1320 + * output       - new UID is returned to caller
1321 + * side effects - new_uid is incremented by one.
1322 + */
1323 + static const char *
1324 + uid_get(void)
1325 + {
1326 +  add_one_to_uid(TOTALSIDUID - 1);    /* index from 0 */
1327 +  return new_uid;
1328 + }
1329 +
1330 + /*
1331   * init_isupport()
1332   *
1333   * input        - NONE
# Line 1433 | Line 1341 | init_isupport(void)
1341  
1342    add_isupport("CALLERID", NULL, -1);
1343    add_isupport("CASEMAPPING", CASEMAP, -1);
1344 +  add_isupport("DEAF", "D", -1);
1345    add_isupport("KICKLEN", NULL, KICKLEN);
1346    add_isupport("MODES", NULL, MAXMODEPARAMS);
1347 <  add_isupport("NICKLEN", NULL, NICKLEN-1);
1347 >  add_isupport("NICKLEN", NULL, NICKLEN);
1348   #ifdef HALFOPS
1349    add_isupport("PREFIX", "(ohv)@%+", -1);
1350    add_isupport("STATUSMSG", "@%+", -1);

Diff Legend

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