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/trunk/src/s_user.c (file contents):
Revision 1646 by michael, Wed Nov 7 21:02:43 2012 UTC vs.
Revision 1819 by michael, Fri Apr 12 11:57:26 2013 UTC

# Line 32 | Line 32
32   #include "fdlist.h"
33   #include "hash.h"
34   #include "irc_string.h"
35 #include "sprintf_irc.h"
35   #include "s_bsd.h"
36   #include "ircd.h"
37   #include "listener.h"
# Line 120 | Line 119 | unsigned int user_modes[256] =
119    UMODE_BOTS,         /* b */
120    UMODE_CCONN,        /* c */
121    UMODE_DEBUG,        /* d */
122 <  0,                  /* e */
122 >  UMODE_EXTERNAL,     /* e */
123    UMODE_FULL,         /* f */
124    UMODE_CALLERID,     /* g */
125    0,                  /* h */
# Line 139 | Line 138 | unsigned int user_modes[256] =
138    UMODE_UNAUTH,       /* u */
139    0,                  /* v */
140    UMODE_WALLOP,       /* w */
141 <  UMODE_EXTERNAL,     /* x */
141 >  0,                  /* x */
142    UMODE_SPY,          /* y */
143    UMODE_OPERWALL,     /* z      0x7A */
144    0,0,0,0,0,          /* 0x7B - 0x7F */
# Line 659 | Line 658 | valid_hostname(const char *hostname)
658      if (!IsHostChar(*p))
659        return 0;
660  
661 <  return 1;
661 >  return p - hostname <= HOSTLEN;
662   }
663  
664   /* valid_username()
# Line 847 | Line 846 | set_user_mode(struct Client *client_p, s
846      return;
847    }
848  
850  if (IsServer(source_p))
851  {
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
849    if (source_p != target_p)
850    {
851       sendto_one(source_p, form_str(ERR_USERSDONTMATCH),
# Line 1090 | Line 1081 | send_umode_out(struct Client *client_p,
1081      send_umode(client_p, source_p, old, 0xffffffff, buf);
1082   }
1083  
1084 + void
1085 + user_set_hostmask(struct Client *target_p, const char *hostname)
1086 + {
1087 +  if (!valid_hostname(hostname))
1088 +    return;
1089 +
1090 +  if (IsUserHostIp(target_p))
1091 +    delete_user_host(target_p->username, target_p->host, !MyConnect(target_p));
1092 +
1093 +  strlcpy(target_p->host, hostname, sizeof(target_p->host));
1094 +  SetIPSpoof(target_p);
1095 +
1096 +  add_user_host(target_p->username, target_p->host, !MyConnect(target_p));
1097 +  SetUserHost(target_p);
1098 +
1099 +  if (MyClient(target_p))
1100 +    clear_ban_cache_client(target_p);
1101 + }
1102 +
1103   /* user_welcome()
1104   *
1105   * inputs       - client pointer to client to welcome
# Line 1339 | Line 1349 | init_isupport(void)
1349    add_isupport("DEAF", "D", -1);
1350    add_isupport("KICKLEN", NULL, KICKLEN);
1351    add_isupport("MODES", NULL, MAXMODEPARAMS);
1342  add_isupport("NICKLEN", NULL, NICKLEN);
1352   #ifdef HALFOPS
1353    add_isupport("PREFIX", "(ohv)@%+", -1);
1354    add_isupport("STATUSMSG", "@%+", -1);
# Line 1347 | Line 1356 | init_isupport(void)
1356    add_isupport("PREFIX", "(ov)@+", -1);
1357    add_isupport("STATUSMSG", "@+", -1);
1358   #endif
1350  add_isupport("TOPICLEN", NULL, TOPICLEN);
1359   }
1360  
1361   /*
# Line 1443 | Line 1451 | rebuild_isupport_message_line(void)
1451    {
1452      struct Isupport *support = ptr->data;
1453  
1454 <    p += (n = ircsprintf(p, "%s", support->name));
1454 >    p += (n = sprintf(p, "%s", support->name));
1455      len += n;
1456  
1457      if (support->options != NULL)
1458      {
1459 <      p += (n = ircsprintf(p, "=%s", support->options));
1459 >      p += (n = sprintf(p, "=%s", support->options));
1460        len += n;
1461      }
1462  
1463      if (support->number > 0)
1464      {
1465 <      p += (n = ircsprintf(p, "=%d", support->number));
1465 >      p += (n = sprintf(p, "=%d", support->number));
1466        len += n;
1467      }
1468  

Diff Legend

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