m_server.c sending mismatched error messages

Rachel Llorenna rachies at gmail.com
Thu Dec 30 22:07:08 EST 2004


In m_server.c:

ms_sid:
  if (strchr(SID_NAME, '.') == NULL || strlen(SID_NAME) > HOSTLEN) {
    sendto_one(client_p, "ERROR :Invalid servername");
    sendto_realops_flags(UMODE_ALL, L_ADMIN,
                         "Link %s cancelled: servername name %s invalid",
                         get_client_name(client_p, SHOW_IP), SID_NAME);
    sendto_realops_flags(UMODE_ALL, L_OPER,
                         "Link %s cancelled: Server/nick collision on %s",
                         get_client_name(client_p, MASK_IP), SID_NAME);
    exit_client(client_p, client_p, client_p, "Nick as Server");
    return;
  }

The error message being sent to admins differs from that being sent to
opers... Perhaps it should just specify that the servername is
invalid, instead of pointing out server/nickname ambiguity.

ms_server:
  if (strchr(name, '.') == NULL)
  {
    /* Server trying to use the same name as a person. Would
     * cause a fair bit of confusion. Enough to make it hellish
     * for a while and servers to send stuff to the wrong place.
     */
    sendto_one(client_p,"ERROR :Nickname %s already exists!", name);
    sendto_realops_flags(UMODE_ALL, L_ADMIN,
			   "Link %s cancelled: Server/nick collision on %s",
		/* inpath */ get_client_name(client_p, HIDE_IP), name);
    sendto_realops_flags(UMODE_ALL, L_OPER,
          "Link %s cancelled: Server/nick collision on %s",
	  get_client_name(client_p, MASK_IP), name);
    exit_client(client_p, client_p, client_p, "Nick as Server");
    return;
  }

Perhaps also the HOSTLEN checking should be moved up into this
section, before checking llines and hlines, for purposes of increasing
efficiency.
-- 
Regards,

Rachel Llorenna (frequency)



More information about the hybrid mailing list