#include "match.h"
#include "s_user.h"
-static int me_svslogin(struct Client *, struct Client *, int, const char **);
-static int ms_signon(struct Client *, struct Client *, int, const char **);
+static int me_svslogin(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static int ms_signon(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static void send_signon(struct Client *, struct Client *, const char *, const char *, const char *, unsigned int, const char *);
struct Message svslogin_msgtab = {
- "SVSLOGIN", 0, 0, 0, MFLG_SLOW,
+ "SVSLOGIN", 0, 0, 0, 0,
{mg_ignore, mg_ignore, mg_ignore, mg_ignore, {me_svslogin, 6}, mg_ignore}
};
struct Message signon_msgtab = {
- "SIGNON", 0, 0, 0, MFLG_SLOW,
+ "SIGNON", 0, 0, 0, 0,
{mg_ignore, mg_ignore, {ms_signon, 6}, mg_ignore, mg_ignore, mg_ignore}
};
#define USER_VALID 2
#define HOST_VALID 4
-static int
-clean_nick(const char *nick)
-{
- int len = 0;
-
- if(*nick == '-')
- return 0;
-
- /* This is used to check logins, which are often
- * numeric. Don't check for leading digits, if
- * services wants to set someone's nick to something
- * starting with a number, let it try.
- * --gxti
- */
-
- for (; *nick; nick++)
- {
- len++;
- if(!IsNickChar(*nick))
- return 0;
- }
-
- /* nicklen is +1 */
- if(len >= NICKLEN)
- return 0;
-
- return 1;
-}
-
static int
clean_username(const char *username)
{
}
static int
-me_svslogin(struct Client *client_p, struct Client *source_p,
+me_svslogin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
int parc, const char *parv[])
{
struct Client *target_p, *exist_p;
if(!MyClient(target_p) && !IsUnknown(target_p))
return 0;
- if(clean_nick(parv[2]))
+ if(clean_nick(parv[2], 0))
{
rb_strlcpy(nick, parv[2], NICKLEN + 1);
valid |= NICK_VALID;
rb_strlcpy(login, parv[5], NICKLEN + 1);
/* Login (mostly) follows nick rules. */
- if(*login && !clean_nick(login))
+ if(*login && !clean_nick(login, 0))
return 0;
if((exist_p = find_person(nick)) && target_p != exist_p)
"Nick collision due to SVSLOGIN on %s",
nick);
- rb_snprintf(buf, sizeof(buf), "Killed (%s (Nickname regained by services))",
+ snprintf(buf, sizeof(buf), "Killed (%s (Nickname regained by services))",
me.name);
exit_client(NULL, exist_p, &me, buf);
}else if((exist_p = find_client(nick)) && IsUnknown(exist_p) && exist_p != target_p) {
send_signon(NULL, target_p, nick, user, host, rb_current_time(), login);
- rb_snprintf(note, NICKLEN + 10, "Nick: %s", target_p->name);
+ snprintf(note, NICKLEN + 10, "Nick: %s", target_p->name);
rb_note(target_p->localClient->F, note);
}
}
static int
-ms_signon(struct Client *client_p, struct Client *source_p,
+ms_signon(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
int parc, const char *parv[])
{
struct Client *target_p;
int newts, sameuser;
char login[NICKLEN+1];
- if(!clean_nick(parv[1]))
+ if(!clean_nick(parv[1], 0))
{
ServerStats.is_kill++;
sendto_realops_snomask(SNO_DEBUG, L_ALL,
login[0] = '\0';
else if(*parv[5] != '*')
{
- if (clean_nick(parv[5]))
+ if (clean_nick(parv[5], 0))
rb_strlcpy(login, parv[5], NICKLEN + 1);
else
return 0;
change_nick_user_host(target_p, nick, user, host, newts, "Signing %s (%s)", *login ? "in" : "out", nick);
}
-