From b3587542ba24a02afe2f489be079f2aa57500d6e Mon Sep 17 00:00:00 2001 From: luke Date: Wed, 10 Apr 2002 23:05:27 +0000 Subject: [PATCH] More fixes and stuff (gline/shun/zline exempt, etc.) --- Changes | 15 ++++++++++++++ Config | 46 +++++++++++++++++++++++++++++++++++++++++ include/common.h | 9 +------- include/struct.h | 8 ------- include/zip.h | 54 ------------------------------------------------ src/Makefile | 5 +---- src/s_conf.c | 2 -- src/s_kline.c | 17 ++++++++++++++- src/s_serv.c | 8 ++----- 9 files changed, 81 insertions(+), 83 deletions(-) delete mode 100644 include/zip.h diff --git a/Changes b/Changes index 209b553f5..4bb3194ff 100644 --- a/Changes +++ b/Changes @@ -237,3 +237,18 @@ fixed map bug that allowed you to trivially find a hidden U lined server (hopefully) --Luke =================================== + +rmed zip.c (not used at all.) +and zip.h and anything related to zip +--Luke +=================================== + +E lines now match glines, zlines, shuns +(if you say yes in config) +--Luke +=================================== + +map bug still exists (earlier fix made it +worse)...removed. +--Luke +=================================== diff --git a/Config b/Config index 7672744f0..ce08165cf 100755 --- a/Config +++ b/Config @@ -81,6 +81,7 @@ CRYPT_OPER_PASSWORD="" CRYPT_LINK_PASSWORD="" CRYPT_ILINE_PASSWORD="" CRYPT_XLINE_PASSWORD="" +ENABLE_EXEMPTALL="1" LISTEN_SIZE="5" MAXSENDQLENGTH="3000000" BUFFERPOOL="(9 * MAXSENDQLENGTH)" @@ -1502,6 +1503,45 @@ fi esac done +FOO="" +runonce="" +while [ -z "$FOO" ] ; do +if [ -n "$ENABLE_EXEMPTALL" ] ; then + FOO="Yes" +else + FOO="No" +fi +echo "" +echo "*** NEW ***" +echo "Do you want E: lines (k line exempts) to apply to everything?" +echo "(ie, the E line matches glines, zlines, klines, and shuns instead" +echo " of just klines.)" +echo $n "[$FOO] -> $c" +if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc +else + cc="" + runonce=Yes +fi +if [ -z "$cc" ] ; then + cc=$FOO +fi + case "$cc" in + [Yy]*) + ENABLE_EXEMPTALL="1" + ;; + [Nn]*) + ENABLE_EXEMPTALL="" + ;; + *) + echo "" + echo "You need to enter either Yes or No here..." + echo "" + FOO="" + ;; + esac +done + FOO="" runonce="" while [ -z "$FOO" ] ; do @@ -1851,6 +1891,11 @@ if [ -n "$CRYPT_XLINE_PASSWORD" ] ; then else echo "#undef CRYPT_XLINE_PASSWORD" >> $OPTIONS_H fi +if [ -n "$ENABLE_EXEMPTALL" ] ; then + echo "#define ENABLE_EXEMPTALL 1" >> $OPTIONS_H +else + echo "#undef ENABLE_EXEMPTALL" >> $OPTIONS_H +fi if [ -n "$HUB" ] ; then echo "#define HUB 1" >> $OPTIONS_H else @@ -1896,6 +1941,7 @@ CRYPT_OPER_PASSWORD="$CRYPT_OPER_PASSWORD" CRYPT_LINK_PASSWORD="$CRYPT_LINK_PASSWORD" CRYPT_ILINE_PASSWORD="$CRYPT_ILINE_PASSWORD" CRYPT_XLINE_PASSWORD="$CRYPT_XLINE_PASSWORD" +ENABLE_EXEMPTALL="$ENABLE_EXEMPTALL" LISTEN_SIZE="$LISTEN_SIZE" MAXSENDQLENGTH="$MAXSENDQLENGTH" BUFFERPOOL="$BUFFERPOOL" diff --git a/include/common.h b/include/common.h index 2abeef01c..9bcda54f6 100644 --- a/include/common.h +++ b/include/common.h @@ -208,12 +208,6 @@ extern struct SLink *find_user_link( /* struct SLink *, struct Client * */ ); * you are doing. */ -#ifdef ZIP_LINKS -#define ZIPSTUFF " ZIP" -#else -#define ZIPSTUFF "" -#endif - /* IRCu/Hybrid/Unreal way now :) -Stskeeps */ #define PROTOCTL_CLIENT \ @@ -255,8 +249,7 @@ extern struct SLink *find_user_link( /* struct SLink *, struct Client * */ ); " VL" \ " SJ3" \ " NS" \ - " SJB64" \ - ZIPSTUFF + " SJB64" #ifdef _WIN32 /* diff --git a/include/struct.h b/include/struct.h index 0c019f519..e9eb5a5d3 100644 --- a/include/struct.h +++ b/include/struct.h @@ -30,9 +30,6 @@ #include "hash.h" #include #include -#ifdef ZIP_LINKS -#include "zip.h" -#endif #ifndef _WIN32 #include #include @@ -268,7 +265,6 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */ #define PROTO_SJOIN2 0x10 /* Negotiated SJOIN2 protocol */ #define PROTO_UMODE2 0x20 /* Negotiated UMODE2 protocol */ #define PROTO_NS 0x40 /* Negotiated NS protocol */ -#define PROTO_ZIP 0x80 /* Negotiated ZIP protocol */ #define PROTO_VL 0x100 /* Negotiated VL protocol */ #define PROTO_SJ3 0x200 /* Negotiated SJ3 protocol */ #define PROTO_VHP 0x400 /* Send hostnames in NICKv2 even if not @@ -777,7 +773,6 @@ struct t_vhline { #define LISTENER_SSL 0x000040 #define CONNECT_SSL 0x000001 -#define CONNECT_ZIP 0x000002 struct Client { @@ -821,9 +816,6 @@ struct Client { long sendM; /* Statistics: protocol messages send */ long sendK; /* Statistics: total k-bytes send */ long receiveM; /* Statistics: protocol messages received */ -#ifdef ZIP_LINKS - struct Zdata *zip; /* zip data */ -#endif #ifdef USE_SSL struct SSL *ssl; struct X509 *client_cert; diff --git a/include/zip.h b/include/zip.h deleted file mode 100644 index 4a383fae8..000000000 --- a/include/zip.h +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************ - * IRC - Internet Relay Chat, include/s_zip.h - * Copyright (C) 1992 Darren Reed - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 1, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - * "s_zip.h". - Headers file. - * - * $Id$ - * - */ -#ifndef INCLUDED_s_zip_h -#define INCLUDED_s_zip_h -#include /* z_stream */ -#endif - -struct Client; - -#ifdef ZIP_LINKS -/* the minimum amount of data needed to trigger compression */ -#define ZIP_MINIMUM 4096 - -/* the maximum amount of data to be compressed (can actually be a bit more) */ -#define ZIP_MAXIMUM 8192 /* WARNING: *DON'T* CHANGE THIS!!!! */ - -struct Zdata { - z_stream *in; /* input zip stream data */ - z_stream *out; /* output zip stream data */ - char inbuf[ZIP_MAXIMUM]; /* incoming zipped buffer */ - char outbuf[ZIP_MAXIMUM]; /* outgoing (unzipped) buffer */ - int incount; /* size of inbuf content */ - int outcount; /* size of outbuf content */ -}; - -#endif /* ZIP_LINKS */ - - -extern int zip_init(struct Client *); -extern void zip_free(struct Client *); -extern char *unzip_packet(struct Client *, char *, int *); -extern char *zip_buffer(struct Client *, char *, int *, int); diff --git a/src/Makefile b/src/Makefile index b79707739..06cc51bb0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -29,7 +29,7 @@ OBJS=agent.o aln.o badwords.o bsd.o channel.o class.o cloak.o crule.o dbuf.o dyn s_bsd.o s_conf.o s_debug.o s_err.o s_extra.o s_kline.o \ s_misc.o s_numeric.o s_serv.o s_socks.o $(STRTOUL) ssl.o s_unreal.o \ s_user.o scache.o send.o support.o userload.o version.o webtv.o \ - whowas.o zip.o + whowas.o # OBJS=bsd.o dbuf.o packet.o send.o match.o parse.o support.o channel.o \ # class.o hash.o ircd.o list.o res.o cloak.o s_auth.o s_bsd.o s_conf.o \ @@ -94,9 +94,6 @@ badwords.o: badwords.c $(INCLUDES) aln.o: aln.c $(INCLUDES) $(CC) $(CFLAGS) -c aln.c -zip.o: zip.c $(INCLUDES) - $(CC) $(CFLAGS) -c zip.c - send.o: send.c $(INCLUDES) $(CC) $(CFLAGS) -c send.c diff --git a/src/s_conf.c b/src/s_conf.c index 377d0b748..af4d6b54f 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -1360,8 +1360,6 @@ int initconf(opt) { if (*cp == 'S') aconf->options |= CONNECT_SSL; - else if (*cp == 'Z') - aconf->options |= CONNECT_ZIP; } } break; diff --git a/src/s_kline.c b/src/s_kline.c index 7b521f07b..df012d1bc 100644 --- a/src/s_kline.c +++ b/src/s_kline.c @@ -255,6 +255,7 @@ int find_tkline_match(cptr, xx) int xx; { aTKline *lp; + aConfItem *tmp; char *chost, *cname, *cip; TS nowtime; int is_ip; @@ -287,7 +288,21 @@ int find_tkline_match(cptr, xx) if (points != 1) return -1; - + + /* The mask matched some type of tkl line above, cycle through E lines + * and see if we find a match. If so, they're exempt from everything now, + * not just klines. + */ + +#ifdef ENABLE_EXEMPTALL + for (tmp = conf; tmp; tmp = tmp->next) + if ((tmp->status == CONF_EXCEPT) && tmp->host && tmp->name && + ((match(tmp->host, chost) == 0) || (match(tmp->host,cip) == 0)) && + (!cname || match(tmp->name, cname) == 0) && + (!tmp->port || (tmp->port == cptr->acpt->port))) + return -1; +#endif + if ((lp->type & TKL_KILL) && (xx != 2)) { if (lp->type & TKL_GLOBAL) diff --git a/src/s_serv.c b/src/s_serv.c index 48241f2bc..05ca79b0d 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -2264,10 +2264,6 @@ static void report_configured_links(sptr, mask) optbuf[cnt] = 'S'; cnt++; } - if (options & CONNECT_ZIP) { - optbuf[cnt] = 'Z'; - cnt++; - } optbuf[cnt] = '\0'; } @@ -4827,14 +4823,14 @@ void dump_map(cptr, server, mask, prompt_length, length) for (lp = (Link *) return_servers(); lp; lp = lp->next) { acptr = lp->value.cptr; - if (--cnt == 0) - *p = '`'; if (IsULine(acptr) && HIDE_ULINES && !IsAnOper(cptr)) continue; if (acptr->srvptr != server) continue; if (!acptr->flags & FLAGS_MAP) continue; + if (--cnt == 0) + *p = '`'; dump_map(cptr, acptr, mask, prompt_length + 2, length - 2); }