示例#1
0
文件: m_nick.c 项目: mdharris/ircd
/* check_clean_user()
 * 
 * input	- pointer to client sending data
 *              - nickname
 *              - username to check
 *		- origin of NICK
 * output	- none
 * side effects - if username is erroneous, return 1
 */
static int
check_clean_user(struct Client *client_p, char *nick, 
                 char *user, struct Client *server_p)
{
  if (!clean_user_name(user))
  {
    ++ServerStats.is_kill;
    sendto_realops_flags(UMODE_DEBUG, L_ALL,
                         "Bad/Long Username: %s Nickname: %s From: %s(via %s)",
                         user, nick, server_p->name, client_p->name);
    sendto_one(client_p, ":%s KILL %s :%s (Bad Username)",
               me.name, nick, me.name);
    return 1;
  }

  return 0;
}
示例#2
0
/* check_clean_user()
 * 
 * input	- pointer to client sending data
 *              - nickname
 *              - username to check
 *		- origin of NICK
 * output	- none
 * side effects - if username is erroneous, return 1
 */
static int
check_clean_user(struct Client *client_p, char *nick, char *user, char *server)
{
	if(strlen(user) > USERLEN)
	{
		ServerStats->is_kill++;
		sendto_realops_flags(UMODE_DEBUG, L_ALL,
				     "Long Username: %s Nickname: %s From: %s(via %s)",
				     user, nick, server, client_p->name);

		sendto_one(client_p, ":%s KILL %s :%s (Bad Username)", me.name, nick, me.name);

		return 1;
	}

	if(!clean_user_name(user))
		sendto_realops_flags(UMODE_DEBUG, L_ALL,
				     "Bad Username: %s Nickname: %s From: %s(via %s)",
				     user, nick, server, client_p->name);

	return 0;
}