]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_svinfo.c
Allow /ojoin !#channel/%#channel, if admin/halfop are enabled.
[irc/rqf/shadowircd.git] / modules / m_svinfo.c
index 10f06eb0826373d875209f621ee3607af187e49a..1adc81da8000494286e3942b2ba41b6b445aac5a 100644 (file)
 #include "stdinc.h"
 #include "client.h"
 #include "common.h"            /* TRUE bleah */
-#include "irc_string.h"
+#include "match.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "send.h"
 #include "s_conf.h"
-#include "s_log.h"
+#include "s_newconf.h"
+#include "logger.h"
 #include "msg.h"
 #include "parse.h"
 #include "modules.h"
@@ -48,7 +49,6 @@ DECLARE_MODULE_AV1(svinfo, NULL, NULL, svinfo_clist, NULL, NULL, "$Revision: 494
 
 /*
  * ms_svinfo - SVINFO message handler
- *      parv[0] = sender prefix
  *      parv[1] = TS_CURRENT for the server
  *      parv[2] = TS_MIN for the server
  *      parv[3] = unused, send 0
@@ -70,33 +70,34 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char
                /* TS version is too low on one of the sides, drop the link */
                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                     "Link %s dropped, wrong TS protocol version (%s,%s)",
-                                    get_server_name(source_p, SHOW_IP), parv[1], parv[2]);
-               snprintf(squitreason, sizeof squitreason, "Incompatible TS version (%s,%s)",
+                                    source_p->name, parv[1], parv[2]);
+               rb_snprintf(squitreason, sizeof squitreason, "Incompatible TS version (%s,%s)",
                                parv[1], parv[2]);
                exit_client(source_p, source_p, source_p, squitreason);
                return 0;
        }
 
        /*
-        * since we're here, might as well set CurrentTime while we're at it
+        * since we're here, might as well set rb_current_time() while we're at it
         */
-       set_time();
+       rb_set_time();
        theirtime = atol(parv[4]);
-       deltat = abs(theirtime - CurrentTime);
+       deltat = abs(theirtime - rb_current_time());
 
        if(deltat > ConfigFileEntry.ts_max_delta)
        {
                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                     "Link %s dropped, excessive TS delta"
                                     " (my TS=%ld, their TS=%ld, delta=%d)",
-                                    get_server_name(source_p, SHOW_IP),
-                                    (long) CurrentTime, (long) theirtime, deltat);
+                                    source_p->name,
+                                    (long) rb_current_time(), (long) theirtime, deltat);
                ilog(L_SERVER,
                     "Link %s dropped, excessive TS delta"
                     " (my TS=%ld, their TS=%ld, delta=%d)",
-                    log_client_name(source_p, SHOW_IP), (long) CurrentTime, (long) theirtime, deltat);
-               snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%d)",
-                               (long) CurrentTime, (long) theirtime, deltat);
+                    log_client_name(source_p, SHOW_IP), (long) rb_current_time(), (long) theirtime, deltat);
+               rb_snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%d)",
+                               (long) rb_current_time(), (long) theirtime, deltat);
+               disable_server_conf_autoconn(source_p->name);
                exit_client(source_p, source_p, source_p, squitreason);
                return 0;
        }
@@ -106,7 +107,7 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char
                sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                     "Link %s notable TS delta"
                                     " (my TS=%ld, their TS=%ld, delta=%d)",
-                                    source_p->name, (long) CurrentTime, (long) theirtime, deltat);
+                                    source_p->name, (long) rb_current_time(), (long) theirtime, deltat);
        }
 
        return 0;