if(rup->suspendreason)
reason = rup->suspendreason->content;
- irc_send("%s GL * +*!%s@%s 3600 :%s\r\n", mynumeric->content, nl->ident,
- IPtostr(nl->p_ipaddr), reason);
+ glinesetbynick(nl, 3600, reason, "chanserv", 0);
chanservwallmessage("Delayed GLINE \"*!%s@%s\" (authed as %s) expires in 60 minute/s (hit %d user%s) (reason: %s)",
nl->ident, IPtostr(nl->p_ipaddr), rup->username, ucount, ucount==1?"":"s", reason);
}
#include "../irc/irc.h"
-
#include "../trusts/trusts.h"
#include "glines.h"
-void glinebynick(nick *np, int duration, char *reason) {
+void glinesetbynick(nick *np, int duration, char *reason, char *creator, int flags) {
irc_send("%s GL * +%s@%s %d %jd :%s", mynumeric->content, istrusted(np)?np->ident:"*", IPtostr(np->p_ipaddr), duration, (intmax_t)getnettime(), reason);
}
-void glinebyhost(char *ident, char *hostname, int duration, char *reason) {
- /* TODO: resolve trustgroup and trustgline */
+void glinesetbynode( patricia_node_t *node, int duration, char *reason, char *creator) {
+ irc_send("%s GL * +*@%s %d %jd :%s", mynumeric->content, IPtostr(node->prefix->sin), duration, (intmax_t)getnettime(), reason);
+}
+
+/**
+ * This should be avoided (where possible) and gline on Nick/IPs instead
+ */
+void glinesetbyhost(char *ident, char *hostname, int duration, char *reason, char *creator) {
irc_send("%s GL * +%s@%s %d %jd :%s", mynumeric->content, ident, hostname, duration, (intmax_t)getnettime(), reason);
}
void unglinebyhost(char *ident, char *hostname, int duration, char *reason) {
- /* TODO: trustungline */
-
irc_send("%s GL * -%s@%s %d %jd :%s", mynumeric->content, ident, hostname, duration, (intmax_t)getnettime(), reason);
}
#ifndef __GLINES_H
#define __GLINES_H
-void glinebynick(nick *, int, char *);
-void glinebyhost(char *, char *, int, char *);
+void glinesetbynick(nick *, int, char *, char *, int);
+void glinesetbynode( patricia_node_t *, int, char *, char *);
+void glinesetbyhost(char *, char *, int, char *, char *);
+
void unglinebyhost(char *, char *, int, char *);
+#define GLINE_FORCE_IDENT 1
+
#endif
#include "../localuser/localuserchannel.h"
#include "../core/nsmalloc.h"
#include "../lib/irc_ipv6.h"
+#include "../glines/glines.h"
MODULE_VERSION("")
/* the purpose of this lastgline stuff is to stop gline spam from one scan */
if (!chp->glineid || (now>=chp->lastgline+SCANTIMEOUT)) {
char buf[512];
+ char reason[200];
const char *ip;
chp->lastgline=now;
loggline(chp, sp->node);
ip = IPtostr(((patricia_node_t *)sp->node)->prefix->sin);
- irc_send("%s GL * +*@%s 1800 %jd :Open Proxy, see http://www.quakenet.org/openproxies.html - ID: %d",
- mynumeric->content,ip,(intmax_t)getnettime(), chp->glineid);
+ snprintf(reason, sizeof(reason), "Open Proxy, see http://www.quakenet.org/openproxies.html - ID: %d", chp->glineid);
+ glinesetbynode( (patricia_node_t *)sp->node, 1800, reason, "proxyscan" );
Error("proxyscan",ERR_DEBUG,"Found open proxy on host %s",ip);
snprintf(buf, sizeof(buf), "proxy-gline %lu %s %s %hu %s", time(NULL), ip, scantostr(sp->type), sp->port, "irc.quakenet.org");
+#include <stdio.h>
#include "proxyscan.h"
#include "../irc/irc.h"
#include "../lib/irc_string.h"
#include "../core/error.h"
+#include "../glines/glines.h"
void proxyscan_newnick(int hooknum, void *arg) {
nick *np=(nick *)arg;
cachehost *chp;
foundproxy *fpp, *nfpp;
extrascan *esp, *espp;
+ char reason[200];
int i;
}
/* set a SHORT gline - if they really have an open proxy the gline will be re-set, with a new ID */
- irc_send("%s GL * +*@%s 600 %jd :Open Proxy, see http://www.quakenet.org/openproxies.html - ID: %d",
- mynumeric->content,IPtostr(np->p_ipaddr),(intmax_t)getnettime(), chp->glineid);
+ snprintf(reason, sizeof(reason), "Open Proxy, see http://www.quakenet.org/openproxies.html - ID: %d", chp->glineid);
+ glinesetbynode(np->ipnode, 600, reason, "proxyscan");
chp->lastscan=time(NULL);
chp->proxies=NULL;
#include "versionscan.h"
#include "../lib/version.h"
+#include "../glines/glines.h"
MODULE_VERSION("")
kcount++;
break;
case VS_GLUSER:
- irc_send("%s GL * +*!%s@%s 3600 :%s\r\n", mynumeric->content, sender->ident, sender->host->name->content, v->data);
+ glinesetbynick(sender, 3600, v->data, versionscan_nick->nick, GLINE_FORCE_IDENT);
gcount++;
break;
case VS_GLHOST:
- irc_send("%s GL * +*!*@%s 3600 :%s\r\n", mynumeric->content, sender->host->name->content, v->data);
+ glinesetbynick(sender, 3600, v->data, versionscan_nick->nick, 0);
gcount++;
break;
default: