mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-09 21:33:12 +02:00
More fixes and stuff (gline/shun/zline exempt, etc.)
This commit is contained in:
@@ -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
|
||||
===================================
|
||||
|
||||
@@ -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"
|
||||
|
||||
+1
-8
@@ -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
|
||||
/*
|
||||
|
||||
@@ -30,9 +30,6 @@
|
||||
#include "hash.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef ZIP_LINKS
|
||||
#include "zip.h"
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <zlib.h> /* 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);
|
||||
+1
-4
@@ -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
|
||||
|
||||
|
||||
@@ -1360,8 +1360,6 @@ int initconf(opt)
|
||||
{
|
||||
if (*cp == 'S')
|
||||
aconf->options |= CONNECT_SSL;
|
||||
else if (*cp == 'Z')
|
||||
aconf->options |= CONNECT_ZIP;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
+16
-1
@@ -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)
|
||||
|
||||
+2
-6
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user