コード例 #1
0
ファイル: m_nick.c プロジェクト: mdharris/ircd
/* check_clean_host()
 * 
 * input	- pointer to client sending us data
 *              - nickname
 *              - hostname to check
 *		- source name
 * output	- none
 * side effects - if hostname is erroneous, return 1
 */
static int
check_clean_host(struct Client *client_p, char *nick,
                 char *host, struct Client *server_p)
{
  if (!clean_host_name(host))
  {
    ++ServerStats.is_kill;
    sendto_realops_flags(UMODE_DEBUG, L_ALL,
                         "Bad/Long Hostname: %s Nickname: %s From: %s(via %s)",
                         host, nick, server_p->name, client_p->name);
    sendto_one(client_p, ":%s KILL %s :%s (Bad Hostname)",
               me.name, nick, me.name);
    return 1;
  }

  return 0;
}
コード例 #2
0
ファイル: m_nick.c プロジェクト: BackupTheBerlios/shadowircd
/* check_clean_host()
 * 
 * input	- pointer to client sending us data
 *              - nickname
 *              - hostname to check
 *		- source name
 * output	- none
 * side effects - if hostname is erroneous, return 1
 */
static int
check_clean_host(struct Client *client_p, char *nick, char *host, char *server)
{
	if(strlen(host) > HOSTLEN)
	{
		ServerStats->is_kill++;
		sendto_realops_flags(UMODE_DEBUG, L_ALL,
				     "Long Hostname: %s Nickname: %s From: %s(via %s)",
				     host, nick, server, client_p->name);

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

		return 1;
	}

	if(!clean_host_name(host))
		sendto_realops_flags(UMODE_DEBUG, L_ALL,
				     "Bad Hostname: %s Nickname: %s From: %s(via %s)",
				     host, nick, server, client_p->name);

	return 0;
}