]> jfr.im git - solanum.git/commitdiff
Merge pull request #293 from edk0/webirc
authorAaron Jones <redacted>
Tue, 22 Oct 2019 16:17:33 +0000 (16:17 +0000)
committerGitHub <redacted>
Tue, 22 Oct 2019 16:17:33 +0000 (16:17 +0000)
m_webirc: improve TLS handling

extensions/m_webirc.c
extensions/override.c
include/inline/stringops.h
ircd/s_conf.c
tests/Makefile.am

index 94f100f6d4fd981023121d4049ac6d0df2ebc092..04f59c96ae58babd4558e77806dd7f050c38376e 100644 (file)
@@ -64,7 +64,13 @@ struct Message webirc_msgtab = {
 
 mapi_clist_av1 webirc_clist[] = { &webirc_msgtab, NULL };
 
-DECLARE_MODULE_AV2(webirc, NULL, NULL, webirc_clist, NULL, NULL, NULL, NULL, webirc_desc);
+static void new_local_user(void *data);
+mapi_hfn_list_av1 webirc_hfnlist[] = {
+       { "new_local_user", (hookfn) new_local_user },
+       { NULL, NULL }
+};
+
+DECLARE_MODULE_AV2(webirc, NULL, NULL, webirc_clist, NULL, webirc_hfnlist, NULL, NULL, webirc_desc);
 
 /*
  * mr_webirc - webirc message handler
@@ -168,3 +174,13 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
 
        sendto_one(source_p, "NOTICE * :CGI:IRC host/IP set to %s %s", parv[3], parv[4]);
 }
+
+static void
+new_local_user(void *data)
+{
+       struct Client *source_p = data;
+       struct ConfItem *aconf = source_p->localClient->att_conf;
+
+       if (!irccmp(aconf->info.name, "webirc."))
+               exit_client(source_p, source_p, &me, "Cannot log in using a WEBIRC block");
+}
index 2d86f738c8e8e3caced3700fa4e6403447dd03d5..20110a65aa06e373f01c72d552cb8a8759adb812 100644 (file)
@@ -131,8 +131,6 @@ check_umode_change(void *vdata)
                if (changed)
                {
                        update_session_deadline(source_p, NULL);
-                       sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s has enabled oper-override (+p)",
-                                       get_oper_name(source_p));
                }
        }
        else if (changed && !(source_p->umodes & user_modes['p']))
@@ -146,9 +144,6 @@ check_umode_change(void *vdata)
                        if (session_p->client != source_p)
                                continue;
 
-                       sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s has disabled oper-override (+p)",
-                                              get_oper_name(session_p->client));
-
                        rb_dlinkDelete(n, &overriding_opers);
                        rb_free(session_p);
                }
index cf5d98fbbb86eed623c650acda4a3baeea428935..b5616081242f18f419cca93a6bf2fd7a19066562 100644 (file)
@@ -109,7 +109,7 @@ strip_unprintable(char *string)
                        *c2++ = *c;
                        break;
                default:
-                       if (*c < 32)
+                       if ((unsigned char)*c < 32)
                                break;
                        *c2++ = *c;
                        last_non_space = c2;
index 4cbb0d5e61f7bd36e3ede9873b0bf80163d3665a..700b8f7dca80378f88cef915a66efaaa364957b9 100644 (file)
@@ -25,6 +25,7 @@
 #include "stdinc.h"
 #include "ircd_defs.h"
 #include "s_conf.h"
+#include "s_user.h"
 #include "s_newconf.h"
 #include "newconf.h"
 #include "s_serv.h"
@@ -630,6 +631,8 @@ attach_conf(struct Client *client_p, struct ConfItem *aconf)
 bool
 rehash(bool sig)
 {
+       rb_dlink_node *n;
+
        hook_data_rehash hdata = { sig };
 
        if(sig)
@@ -648,6 +651,16 @@ rehash(bool sig)
 
        open_logfiles();
 
+       RB_DLINK_FOREACH(n, local_oper_list.head)
+       {
+               struct Client *oper = n->data;
+               const char *modeparv[4];
+               modeparv[0] = modeparv[1] = oper->name;
+               modeparv[2] = "+";
+               modeparv[3] = NULL;
+               user_mode(oper, oper, 3, modeparv);
+       }
+
        call_hook(h_rehash, &hdata);
        return false;
 }
index 0efb4c7f662b065ca5ff90b04fa1da505bc6e303..842816f53ca3ad05ffad397687b72ca44ff8a06c 100644 (file)
@@ -38,7 +38,6 @@ check-local: $(check_PROGRAMS) \
        ../ssld/ssld \
        ../wsockd/wsockd \
        $(patsubst ../modules/%.c,../modules/.libs/%.so,$(wildcard ../modules/*.c)) \
-       $(patsubst ../modules/core/%.c,../modules/core/.libs/%.so,$(wildcard ../modules/core/*.c)) \
-       $(patsubst ../extensions/%.c,../extensions/.libs/%.so,$(wildcard ../extensions/*.c))
+       $(patsubst ../modules/core/%.c,../modules/core/.libs/%.so,$(wildcard ../modules/core/*.c))
 
        ./runtests -l $(abs_top_srcdir)/tests/TESTS