ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/modules/core/m_nick.c
(Generate patch)

Comparing ircd-hybrid/branches/8.2.x/modules/core/m_nick.c (file contents):
Revision 6745 by michael, Tue Nov 10 17:31:38 2015 UTC vs.
Revision 6747 by michael, Tue Nov 10 17:39:53 2015 UTC

# Line 65 | Line 65 | check_clean_nick(struct Client *source_p
65     * The old code did some wacky stuff here, if the nick is invalid, kill it
66     * and don't bother messing at all
67     */
68 <  if (!valid_nickname(nick, 0))
69 <  {
70 <    ++ServerStats.is_kill;
71 <    sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
72 <                         "Bad/long Nick: %s From: %s(via %s)",
73 <                         nick, server_p->name, source_p->from->name);
74 <
75 <    sendto_one(source_p, ":%s KILL %s :%s (Bad Nickname)",
76 <               me.id, nick, me.name);
77 <
78 <    /* Bad nick change */
79 <    if (IsClient(source_p) && !MyConnect(source_p))
80 <    {
81 <      sendto_server(source_p, 0, 0, ":%s KILL %s :%s (Bad Nickname)",
82 <                    me.id, source_p->id, me.name);
83 <      AddFlag(source_p, FLAGS_KILLED);
84 <      exit_client(source_p, "Bad Nickname");
85 <    }
68 >  if (valid_nickname(nick, 0))
69 >    return 0;
70 >
71 >  ++ServerStats.is_kill;
72 >  sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
73 >                       "Bad/long Nick: %s From: %s(via %s)",
74 >                       nick, server_p->name, source_p->from->name);
75 >  sendto_one(source_p, ":%s KILL %s :%s (Bad Nickname)",
76 >             me.id, nick, me.name);
77  
78 <    return 1;
78 >  /* Bad nick change */
79 >  if (IsClient(source_p) && !MyConnect(source_p))
80 >  {
81 >    sendto_server(source_p, 0, 0, ":%s KILL %s :%s (Bad Nickname)",
82 >                  me.id, source_p->id, me.name);
83 >    AddFlag(source_p, FLAGS_KILLED);
84 >    exit_client(source_p, "Bad Nickname");
85    }
86  
87 <  return 0;
87 >  return 1;
88   }
89  
90   /* check_clean_user()
# Line 105 | Line 102 | check_clean_user(struct Client *source_p
102   {
103    assert(IsServer(source_p));
104  
105 <  if (!valid_username(user, 0))
106 <  {
110 <    ++ServerStats.is_kill;
111 <    sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
112 <                         "Bad/Long Username: %s Nickname: %s From: %s(via %s)",
113 <                         user, nick, server_p->name, source_p->from->name);
114 <    sendto_one(source_p, ":%s KILL %s :%s (Bad Username)",
115 <               me.id, nick, me.name);
116 <    return 1;
117 <  }
105 >  if (valid_username(user, 0))
106 >    return 0;
107  
108 <  return 0;
108 >  ++ServerStats.is_kill;
109 >  sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
110 >                       "Bad/Long Username: %s Nickname: %s From: %s(via %s)",
111 >                       user, nick, server_p->name, source_p->from->name);
112 >  sendto_one(source_p, ":%s KILL %s :%s (Bad Username)",
113 >             me.id, nick, me.name);
114 >  return 1;
115   }
116  
117   /* check_clean_host()
# Line 134 | Line 129 | check_clean_host(struct Client *source_p
129   {
130    assert(IsServer(source_p));
131  
132 <  if (!valid_hostname(host))
133 <  {
139 <    ++ServerStats.is_kill;
140 <    sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
141 <                         "Bad/Long Hostname: %s Nickname: %s From: %s(via %s)",
142 <                         host, nick, server_p->name, source_p->from->name);
143 <    sendto_one(source_p, ":%s KILL %s :%s (Bad Hostname)",
144 <               me.id, nick, me.name);
145 <    return 1;
146 <  }
132 >  if (valid_hostname(host))
133 >    return 0;
134  
135 <  return 0;
135 >  ++ServerStats.is_kill;
136 >  sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
137 >                       "Bad/Long Hostname: %s Nickname: %s From: %s(via %s)",
138 >                       host, nick, server_p->name, source_p->from->name);
139 >  sendto_one(source_p, ":%s KILL %s :%s (Bad Hostname)",
140 >             me.id, nick, me.name);
141 >  return 1;
142   }
143  
144   /* set_initial_nick()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines