]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_signon.c
Backed out changeset c04f6578869c
[irc/rqf/shadowircd.git] / modules / m_signon.c
index 16b13ccf5b9cbaf78e228e71d155ae4806904136..efcb84d9854568c17594d18498d10bcac532d453 100644 (file)
@@ -26,7 +26,6 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $Id: m_signon.c 1192 2006-04-21 16:21:02Z jilles $
  */
 
 #include "stdinc.h"
 #include "msg.h"
 #include "parse.h"
 #include "modules.h"
-#include "sprintf_irc.h"
 #include "whowas.h"
 #include "monitor.h"
 #include "s_stats.h"
 #include "snomask.h"
-#include "irc_string.h"
+#include "match.h"
 #include "s_user.h"
 
 static int me_svslogin(struct Client *, struct Client *, int, const char **);
@@ -163,41 +161,41 @@ me_svslogin(struct Client *client_p, struct Client *source_p,
 
        if(clean_nick(parv[2]))
        {
-               strlcpy(nick, parv[2], NICKLEN + 1);
+               rb_strlcpy(nick, parv[2], NICKLEN + 1);
                valid |= NICK_VALID;
        }
        else if(*target_p->name)
-               strlcpy(nick, target_p->name, NICKLEN + 1);
+               rb_strlcpy(nick, target_p->name, NICKLEN + 1);
        else
                strcpy(nick, "*");
 
        if(clean_username(parv[3]))
        {
-               strlcpy(user, parv[3], USERLEN + 1);
+               rb_strlcpy(user, parv[3], USERLEN + 1);
                valid |= USER_VALID;
        }
        else
-               strlcpy(user, target_p->username, USERLEN + 1);
+               rb_strlcpy(user, target_p->username, USERLEN + 1);
 
        if(clean_host(parv[4]))
        {
-               strlcpy(host, parv[4], HOSTLEN + 1);
+               rb_strlcpy(host, parv[4], HOSTLEN + 1);
                valid |= HOST_VALID;
        }
        else
-               strlcpy(host, target_p->host, HOSTLEN + 1);
+               rb_strlcpy(host, target_p->host, HOSTLEN + 1);
 
        if(*parv[5] == '*')
        {
                if(target_p->user)
-                       strlcpy(login, target_p->user->suser, NICKLEN + 1);
+                       rb_strlcpy(login, target_p->user->suser, NICKLEN + 1);
                else
                        login[0] = '\0';
        }
        else if(!strcmp(parv[5], "0"))
                login[0] = '\0';
        else
-               strlcpy(login, parv[5], NICKLEN + 1);
+               rb_strlcpy(login, parv[5], NICKLEN + 1);
 
        /* Login (mostly) follows nick rules. */
        if(*login && !clean_nick(login))
@@ -215,7 +213,7 @@ me_svslogin(struct Client *client_p, struct Client *source_p,
                kill_client_serv_butone(NULL, exist_p, "%s (Nickname regained by services)",
                                        me.name);
 
-               snprintf(buf, sizeof(buf), "Killed (%s (Nickname regained by services))",
+               rb_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) {
@@ -251,13 +249,13 @@ me_svslogin(struct Client *client_p, struct Client *source_p,
                if(valid & HOST_VALID)
                        strcpy(target_p->preClient->spoofhost, host);
 
-               strlcpy(user_p->suser, login, NICKLEN + 1);
+               rb_strlcpy(user_p->suser, login, NICKLEN + 1);
        }
        else
        {
                char note[NICKLEN + 10];
 
-               send_signon(NULL, target_p, nick, user, host, CurrentTime, login);
+               send_signon(NULL, target_p, nick, user, host, rb_current_time(), login);
 
                rb_snprintf(note, NICKLEN + 10, "Nick: %s", target_p->name);
                rb_note(target_p->localClient->F, note);
@@ -276,7 +274,7 @@ ms_signon(struct Client *client_p, struct Client *source_p,
 
        if(!clean_nick(parv[1]))
        {
-               ServerStats->is_kill++;
+               ServerStats.is_kill++;
                sendto_realops_snomask(SNO_DEBUG, L_ALL,
                                "Bad Nick from SIGNON: %s From: %s(via %s)",
                                parv[1], source_p->servptr->name, client_p->name);
@@ -294,7 +292,7 @@ ms_signon(struct Client *client_p, struct Client *source_p,
 
        if(!clean_username(parv[2]) || !clean_host(parv[3]))
        {
-               ServerStats->is_kill++;
+               ServerStats.is_kill++;
                sendto_realops_snomask(SNO_DEBUG, L_ALL,
                                "Bad user@host from SIGNON: %s@%s From: %s(via %s)",
                                parv[2], parv[3], source_p->servptr->name, client_p->name);
@@ -317,7 +315,7 @@ ms_signon(struct Client *client_p, struct Client *source_p,
        else if(*parv[5] != '*')
        {
                if (clean_nick(parv[5]))
-                       strlcpy(login, parv[5], NICKLEN + 1);
+                       rb_strlcpy(login, parv[5], NICKLEN + 1);
                else
                        return 0;
        }
@@ -338,13 +336,13 @@ ms_signon(struct Client *client_p, struct Client *source_p,
                                                     source_p->name, target_p->name, target_p->from->name,
                                                     client_p->name);
                
-                               ServerStats->is_kill++;
+                               ServerStats.is_kill++;
                                sendto_one_numeric(target_p, ERR_NICKCOLLISION,
                                                   form_str(ERR_NICKCOLLISION), target_p->name);
                
                                kill_client_serv_butone(NULL, source_p, "%s (Nick change collision)", me.name);
                
-                               ServerStats->is_kill++;
+                               ServerStats.is_kill++;
                
                                kill_client_serv_butone(NULL, target_p, "%s (Nick change collision)", me.name);
                
@@ -373,7 +371,7 @@ ms_signon(struct Client *client_p, struct Client *source_p,
                                                                     source_p->name, target_p->name,
                                                                     target_p->from->name, client_p->name);
                
-                                       ServerStats->is_kill++;
+                                       ServerStats.is_kill++;
                
                                        sendto_one_numeric(target_p, ERR_NICKCOLLISION,
                                                           form_str(ERR_NICKCOLLISION), target_p->name);
@@ -410,7 +408,7 @@ ms_signon(struct Client *client_p, struct Client *source_p,
                                        kill_client_serv_butone(client_p, target_p, 
                                                        "%s (Nick collision)", me.name);
                
-                                       ServerStats->is_kill++;
+                                       ServerStats.is_kill++;
                
                                        target_p->flags |= FLAGS_KILLED;
                                        (void) exit_client(client_p, target_p, &me, "Nick collision");
@@ -432,9 +430,6 @@ send_signon(struct Client *client_p, struct Client *target_p,
        sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s SIGNON %s %s %s %ld %s",
                        use_id(target_p), nick, user, host,
                        (long) target_p->tsinfo, *login ? login : "0");
-       sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s SIGNON %s %s %s %ld %s",
-                       target_p->name, nick, user, host,
-                       (long) target_p->tsinfo, *login ? login : "0");
 
        strcpy(target_p->user->suser, login);