From a9d2e1b9b4d56b35526af0fa4ac03dc9f21309d3 Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Fri, 14 Apr 2000 16:53:10 +0000 Subject: [PATCH] Author: Kev Log message: Misc. G-line cleanups and fixes; a cleanup in ircd_snprintf.c; run autoconf/autoheader and make depend git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@171 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 15 ++++- config/configure | 157 +++++++++++++++++++++++++++---------------- config/setup.h.in | 3 + include/gline.h | 1 + ircd/Makefile.in | 122 ++++++++++++++++++--------------- ircd/gline.c | 22 ++++-- ircd/ircd_snprintf.c | 12 +++- ircd/m_gline.c | 18 ++--- ircd/m_join.c | 4 +- 9 files changed, 220 insertions(+), 134 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41bc93f..c949d06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2000-04-14 Kevin L. Mitchell + * ircd/m_join.c: look up badchans with GLINE_EXACT + + * ircd/m_gline.c: fix parc count problems; look up existing + G-lines with GLINE_EXACT; only set new lastmod when + activating/deactivating existing glines if old lastmod was not 0 + + * ircd/gline.c: forgot to copy the gline reason over; don't + propagate a gline with 0 lastmod if origin is user; add + GLINE_EXACT to force exact matching of gline mask + + * ircd/ircd_snprintf.c (doprintf): forgot to deal with the zero + flag properly + * ircd/s_conf.c (find_kill): gline_find() takes a char *userhost, but gline_lookup() actually takes a client--d'oh. @@ -451,7 +464,7 @@ # # ChangeLog for ircu2.10.11 # -# $Id: ChangeLog,v 1.82 2000-04-14 14:41:04 kev Exp $ +# $Id: ChangeLog,v 1.83 2000-04-14 16:53:09 kev Exp $ # # Insert new changes at beginning of the change list. # diff --git a/config/configure b/config/configure index 94fe6ff..7863a68 100644 --- a/config/configure +++ b/config/configure @@ -1735,14 +1735,53 @@ cat >> confdefs.h <&6 +echo "configure:1740: checking size of void *" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(void *)); + exit(0); +} +EOF +if { (eval echo configure:1759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_void_p=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_void_p=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6 +cat >> confdefs.h <&6 -echo "configure:1741: checking for int16_t" >&5 +echo "configure:1780: checking for int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1770,12 +1809,12 @@ EOF fi echo $ac_n "checking for u_int16_t""... $ac_c" 1>&6 -echo "configure:1774: checking for u_int16_t" >&5 +echo "configure:1813: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1804,12 +1843,12 @@ fi elif test "$ac_cv_sizeof_short" = 2 ; then echo $ac_n "checking for int16_t""... $ac_c" 1>&6 -echo "configure:1808: checking for int16_t" >&5 +echo "configure:1847: checking for int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1837,12 +1876,12 @@ EOF fi echo $ac_n "checking for u_int16_t""... $ac_c" 1>&6 -echo "configure:1841: checking for u_int16_t" >&5 +echo "configure:1880: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1874,12 +1913,12 @@ else fi if test "$ac_cv_sizeof_int" = 4 ; then echo $ac_n "checking for int32_t""... $ac_c" 1>&6 -echo "configure:1878: checking for int32_t" >&5 +echo "configure:1917: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1907,12 +1946,12 @@ EOF fi echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 -echo "configure:1911: checking for u_int32_t" >&5 +echo "configure:1950: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1941,12 +1980,12 @@ fi elif test "$ac_cv_sizeof_short" = 4 ; then echo $ac_n "checking for int32_t""... $ac_c" 1>&6 -echo "configure:1945: checking for int32_t" >&5 +echo "configure:1984: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1974,12 +2013,12 @@ EOF fi echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 -echo "configure:1978: checking for u_int32_t" >&5 +echo "configure:2017: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2008,12 +2047,12 @@ fi elif test "$ac_cv_sizeof_long" = 4 ; then echo $ac_n "checking for int32_t""... $ac_c" 1>&6 -echo "configure:2012: checking for int32_t" >&5 +echo "configure:2051: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2041,12 +2080,12 @@ EOF fi echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 -echo "configure:2045: checking for u_int32_t" >&5 +echo "configure:2084: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2078,7 +2117,7 @@ else fi echo $ac_n "checking size of size_t""... $ac_c" 1>&6 -echo "configure:2082: checking size of size_t" >&5 +echo "configure:2121: checking size of size_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2086,7 +2125,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2097,7 +2136,7 @@ main() exit(0); } EOF -if { (eval echo configure:2101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_size_t=`cat conftestval` else @@ -2116,7 +2155,7 @@ cat >> confdefs.h <&6 -echo "configure:2120: checking printf format of size_t" >&5 +echo "configure:2159: checking printf format of size_t" >&5 if test "$ac_cv_sizeof_size_t" = 4 ; then echo "$ac_t"""%u"" 1>&6 cat >> confdefs.h <<\EOF @@ -2131,7 +2170,7 @@ EOF fi echo $ac_n "checking size of time_t""... $ac_c" 1>&6 -echo "configure:2135: checking size of time_t" >&5 +echo "configure:2174: checking size of time_t" >&5 if eval "test \"`echo '$''{'unet_cv_sizeof_time_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2139,7 +2178,7 @@ else unet_cv_sizeof_time_t=0 else cat > conftest.$ac_ext < #include @@ -2151,7 +2190,7 @@ main() exit(0); } EOF -if { (eval echo configure:2155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then unet_cv_sizeof_time_t=`cat conftestval` else @@ -2178,7 +2217,7 @@ EOF else echo "$ac_t""$unet_cv_sizeof_time_t" 1>&6 echo $ac_n "checking printf format of time_t""... $ac_c" 1>&6 -echo "configure:2182: checking printf format of time_t" >&5 +echo "configure:2221: checking printf format of time_t" >&5 if test "$unet_cv_sizeof_time_t" = "$ac_cv_sizeof_long" ; then echo "$ac_t"""%lu"" 1>&6 cat >> confdefs.h <<\EOF @@ -2207,17 +2246,17 @@ for ac_hdr in poll.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2211: checking for $ac_hdr" >&5 +echo "configure:2250: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2244,10 +2283,10 @@ fi done if test -z "$unet_cv_func_poll_syscall" ; then echo $ac_n "checking if poll is a system call (please wait)""... $ac_c" 1>&6 -echo "configure:2248: checking if poll is a system call (please wait)" >&5 +echo "configure:2287: checking if poll is a system call (please wait)" >&5 else echo $ac_n "checking if poll is a system call""... $ac_c" 1>&6 -echo "configure:2251: checking if poll is a system call" >&5 +echo "configure:2290: checking if poll is a system call" >&5 fi if eval "test \"`echo '$''{'unet_cv_func_poll_syscall'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2283,7 +2322,7 @@ echo "$ac_t""$unet_cv_func_poll_syscall" 1>&6 echo $ac_n "checking for restartable system calls""... $ac_c" 1>&6 -echo "configure:2287: checking for restartable system calls" >&5 +echo "configure:2326: checking for restartable system calls" >&5 if eval "test \"`echo '$''{'ac_cv_sys_restartable_syscalls'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2291,7 +2330,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sys_restartable_syscalls=yes else @@ -2337,7 +2376,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2341: checking for $ac_word" >&5 +echo "configure:2380: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2367,7 +2406,7 @@ test -n "$AWK" && break done echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:2371: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:2410: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2405,7 +2444,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2409: checking for a BSD compatible install" >&5 +echo "configure:2448: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2458,7 +2497,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:2462: checking whether ln -s works" >&5 +echo "configure:2501: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2483,7 +2522,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2487: checking for $ac_word" >&5 +echo "configure:2526: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RMPROG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2524,7 +2563,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2528: checking for $ac_word" >&5 +echo "configure:2567: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SHPROG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2562,7 +2601,7 @@ test -n "$SHPROG" || SHPROG="/bin/sh" echo $ac_n "checking for set -h""... $ac_c" 1>&6 -echo "configure:2566: checking for set -h" >&5 +echo "configure:2605: checking for set -h" >&5 if eval "test \"`echo '$''{'unet_cv_sys_set_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2581,7 +2620,7 @@ echo "$ac_t""$unet_cv_sys_set_h" 1>&6 echo $ac_n "checking for posix non-blocking""... $ac_c" 1>&6 -echo "configure:2585: checking for posix non-blocking" >&5 +echo "configure:2624: checking for posix non-blocking" >&5 if eval "test \"`echo '$''{'unet_cv_sys_nonblocking_posix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2589,7 +2628,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < #include @@ -2615,7 +2654,7 @@ int main(void) exit(1); } EOF -if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then unet_cv_sys_nonblocking_posix=yes else @@ -2637,7 +2676,7 @@ EOF else echo $ac_n "checking for bsd non-blocking""... $ac_c" 1>&6 -echo "configure:2641: checking for bsd non-blocking" >&5 +echo "configure:2680: checking for bsd non-blocking" >&5 if eval "test \"`echo '$''{'unet_cv_sys_nonblocking_bsd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2645,7 +2684,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < #include @@ -2671,7 +2710,7 @@ int main(void) exit(1); } EOF -if { (eval echo configure:2675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then unet_cv_sys_nonblocking_bsd=yes else @@ -2699,19 +2738,19 @@ EOF fi fi echo $ac_n "checking for posix signals""... $ac_c" 1>&6 -echo "configure:2703: checking for posix signals" >&5 +echo "configure:2742: checking for posix signals" >&5 if eval "test \"`echo '$''{'unet_cv_sys_signal_posix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L) ; return 0; } EOF -if { (eval echo configure:2715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* unet_cv_sys_signal_posix=yes else @@ -2731,7 +2770,7 @@ EOF else echo $ac_n "checking for bsd reliable signals""... $ac_c" 1>&6 -echo "configure:2735: checking for bsd reliable signals" >&5 +echo "configure:2774: checking for bsd reliable signals" >&5 if eval "test \"`echo '$''{'unet_cv_sys_signal_bsd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2739,7 +2778,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < int calls = 0; @@ -2757,7 +2796,7 @@ int main(void) exit (0); } EOF -if { (eval echo configure:2761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then unet_cv_sys_signal_bsd=yes else @@ -2786,20 +2825,20 @@ fi fi echo $ac_n "checking if the compiler understands -pipe""... $ac_c" 1>&6 -echo "configure:2790: checking if the compiler understands -pipe" >&5 +echo "configure:2829: checking if the compiler understands -pipe" >&5 unet_cv_pipe_flags="$ac_cv_prog_gcc" if test "$ac_cv_prog_gcc" = no; then OLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -pipe" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* unet_cv_pipe_flags=yes else @@ -2824,7 +2863,7 @@ fi uname=`uname` echo $ac_n "checking for OS type""... $ac_c" 1>&6 -echo "configure:2828: checking for OS type" >&5 +echo "configure:2867: checking for OS type" >&5 case "$uname" in *inux*) echo "$ac_t""$uname found." 1>&6 diff --git a/config/setup.h.in b/config/setup.h.in index c1a3a39..4302df6 100644 --- a/config/setup.h.in +++ b/config/setup.h.in @@ -85,6 +85,9 @@ /* The number of bytes in a size_t. */ #undef SIZEOF_SIZE_T +/* The number of bytes in a void *. */ +#undef SIZEOF_VOID_P + /* Define if you have the header file. */ #undef HAVE_POLL_H diff --git a/include/gline.h b/include/gline.h index 62c16f7..88f16e3 100644 --- a/include/gline.h +++ b/include/gline.h @@ -52,6 +52,7 @@ struct Gline { #define GLINE_LOCAL 0x0008 #define GLINE_ANY 0x0010 #define GLINE_FORCE 0x0020 +#define GLINE_EXACT 0x0040 #define GLINE_MASK (GLINE_ACTIVE | GLINE_BADCHAN | GLINE_LOCAL) diff --git a/ircd/Makefile.in b/ircd/Makefile.in index 5a29202..24be062 100644 --- a/ircd/Makefile.in +++ b/ircd/Makefile.in @@ -283,20 +283,20 @@ stamp-m: IPcheck.o: IPcheck.c ../include/IPcheck.h ../include/client.h \ ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ - ../include/struct.h ../include/numnicks.h ../include/querycmds.h \ - ../include/ircd_alloc.h ../include/fda.h ../include/s_bsd.h \ + ../include/struct.h ../include/numnicks.h ../include/ircd_alloc.h \ + ../include/fda.h ../include/s_bsd.h ../include/s_debug.h \ ../include/s_user.h ../include/send.h channel.o: channel.c ../include/channel.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_handler.h ../include/gline.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_alloc.h ../include/fda.h ../include/ircd_chattr.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../include/list.h \ - ../include/match.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/querycmds.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \ - ../include/s_user.h ../include/send.h ../include/sprintf_irc.h \ - ../include/support.h ../include/sys.h ../include/whowas.h + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ + ../include/fda.h ../include/ircd_chattr.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/list.h ../include/match.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/querycmds.h ../include/s_bsd.h ../include/s_conf.h \ + ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ + ../include/send.h ../include/sprintf_irc.h ../include/support.h \ + ../include/sys.h ../include/whowas.h class.o: class.c ../include/class.h ../include/client.h \ ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ @@ -318,27 +318,29 @@ gline.o: gline.c ../include/gline.h ../config/config.h \ ../config/setup.h ../include/client.h ../include/dbuf.h \ ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ - ../include/numeric.h ../include/s_bsd.h ../include/s_misc.h \ - ../include/send.h ../include/sys.h + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/match.h ../include/numeric.h \ + ../include/s_bsd.h ../include/s_misc.h ../include/send.h \ + ../include/support.h ../include/msg.h ../include/numnicks.h \ + ../include/sys.h hash.o: hash.c ../include/hash.h ../include/client.h ../include/dbuf.h \ ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \ ../config/config.h ../config/setup.h ../include/ircd_chattr.h \ ../include/ircd_string.h ../include/ircd.h ../include/struct.h \ ../include/send.h ../include/support.h ../include/sys.h ircd.o: ircd.c ../include/ircd.h ../config/config.h ../config/setup.h \ - ../include/struct.h ../include/ircd_defs.h ../include/class.h \ - ../include/client.h ../include/dbuf.h ../include/ircd_handler.h \ - ../include/crule.h ../include/hash.h ../include/ircd_alloc.h \ - ../include/fda.h ../include/ircd_log.h ../include/ircd_signal.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/jupe.h \ - ../include/list.h ../include/listener.h ../include/match.h \ - ../include/numeric.h ../include/numnicks.h ../include/parse.h \ - ../include/res.h ../include/s_auth.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \ - ../include/send.h ../include/sys.h ../include/uping.h \ - ../include/userload.h ../include/version.h ../include/whowas.h \ - ../include/msg.h + ../include/struct.h ../include/ircd_defs.h ../include/IPcheck.h \ + ../include/class.h ../include/client.h ../include/dbuf.h \ + ../include/ircd_handler.h ../include/crule.h ../include/hash.h \ + ../include/ircd_alloc.h ../include/fda.h ../include/ircd_log.h \ + ../include/ircd_signal.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/jupe.h ../include/list.h \ + ../include/listener.h ../include/match.h ../include/numeric.h \ + ../include/numnicks.h ../include/parse.h ../include/res.h \ + ../include/s_auth.h ../include/s_bsd.h ../include/s_conf.h \ + ../include/s_debug.h ../include/s_misc.h ../include/send.h \ + ../include/sys.h ../include/uping.h ../include/userload.h \ + ../include/version.h ../include/whowas.h ../include/msg.h ircd_alloc.o: ircd_alloc.c ../include/ircd_alloc.h ../include/fda.h \ ../include/ircd_string.h ../config/config.h ../config/setup.h \ ../include/ircd_chattr.h ../include/s_debug.h ../include/ircd_defs.h @@ -713,18 +715,18 @@ m_squit.o: m_squit.c ../include/client.h ../include/dbuf.h \ ../include/ircd_string.h ../include/numeric.h ../include/numnicks.h \ ../include/match.h ../include/s_debug.h ../include/s_misc.h \ ../include/s_user.h ../include/send.h -m_stats.o: m_stats.c ../include/channel.h ../config/config.h \ - ../config/setup.h ../include/ircd_defs.h ../include/class.h \ - ../include/client.h ../include/dbuf.h ../include/ircd_handler.h \ - ../include/gline.h ../include/hash.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ - ../include/ircd_chattr.h ../include/ircd_reply.h \ +m_stats.o: m_stats.c ../include/s_stats.h ../include/channel.h \ + ../config/config.h ../config/setup.h ../include/ircd_defs.h \ + ../include/class.h ../include/client.h ../include/dbuf.h \ + ../include/ircd_handler.h ../include/gline.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ + ../include/fda.h ../include/ircd_chattr.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/list.h ../include/listener.h \ ../include/match.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/opercmds.h ../include/s_bsd.h \ ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \ ../include/s_serv.h ../include/s_user.h ../include/send.h \ - ../include/userload.h ../include/s_stats.h + ../include/userload.h m_time.o: m_time.c ../include/client.h ../include/dbuf.h \ ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ @@ -776,7 +778,8 @@ m_version.o: m_version.c ../include/client.h ../include/dbuf.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_debug.h ../include/s_user.h \ - ../include/send.h ../include/version.h + ../include/send.h ../include/supported.h ../include/channel.h \ + ../include/version.h m_wallchops.o: m_wallchops.c ../include/channel.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/client.h \ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ @@ -927,30 +930,39 @@ s_numeric.o: s_numeric.c ../include/s_numeric.h ../include/channel.h \ s_serv.o: s_serv.c ../include/s_serv.h ../include/IPcheck.h \ ../include/channel.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/ircd_handler.h ../include/crule.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ - ../include/fda.h ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/ircd_xopen.h ../include/jupe.h \ - ../include/list.h ../include/msg.h ../include/match.h \ - ../include/numeric.h ../include/numnicks.h ../include/parse.h \ - ../include/querycmds.h ../include/s_bsd.h ../include/s_conf.h \ - ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ - ../include/send.h ../include/sprintf_irc.h ../include/sys.h \ - ../include/userload.h + ../include/ircd_handler.h ../include/crule.h ../include/gline.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_alloc.h ../include/fda.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h \ + ../include/ircd_xopen.h ../include/jupe.h ../include/list.h \ + ../include/msg.h ../include/match.h ../include/numeric.h \ + ../include/numnicks.h ../include/parse.h ../include/querycmds.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ + ../include/s_misc.h ../include/s_user.h ../include/send.h \ + ../include/sprintf_irc.h ../include/sys.h ../include/userload.h +s_stats.o: s_stats.c ../include/s_stats.h ../include/class.h \ + ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/crule.h ../include/ircd.h \ + ../config/config.h ../config/setup.h ../include/struct.h \ + ../include/ircd_chattr.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/listener.h ../include/match.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/s_conf.h ../include/s_user.h ../include/send.h s_user.o: s_user.c ../include/s_user.h ../include/IPcheck.h \ ../include/channel.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/class.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ - ../include/fda.h ../include/ircd_chattr.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../include/list.h \ - ../include/match.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/parse.h ../include/querycmds.h \ - ../include/random.h ../include/s_bsd.h ../include/s_conf.h \ - ../include/s_debug.h ../include/s_misc.h ../include/s_serv.h \ - ../include/send.h ../include/sprintf_irc.h ../include/support.h \ - ../include/supported.h ../include/sys.h ../include/userload.h \ - ../include/version.h ../include/whowas.h + ../include/dbuf.h ../include/ircd_handler.h ../include/gline.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_alloc.h ../include/fda.h ../include/ircd_chattr.h \ + ../include/ircd_log.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/list.h ../include/match.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/parse.h ../include/querycmds.h ../include/random.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ + ../include/s_misc.h ../include/s_serv.h ../include/send.h \ + ../include/sprintf_irc.h ../include/support.h ../include/supported.h \ + ../include/sys.h ../include/userload.h ../include/version.h \ + ../include/whowas.h ../include/handlers.h send.o: send.c ../include/send.h ../include/channel.h \ ../config/config.h ../config/setup.h ../include/ircd_defs.h \ ../include/class.h ../include/client.h ../include/dbuf.h \ diff --git a/ircd/gline.c b/ircd/gline.c index b09d607..1601c5f 100644 --- a/ircd/gline.c +++ b/ircd/gline.c @@ -68,7 +68,8 @@ make_gline(char *userhost, char *reason, time_t expire, time_t lastmod, gline = (struct Gline *)MyMalloc(sizeof(struct Gline)); /* alloc memory */ assert(0 != gline); - gline->gl_expire = expire; /* initialize gline... */ + DupString(gline->gl_reason, reason); /* initialize gline... */ + gline->gl_expire = expire; gline->gl_lastmod = lastmod; gline->gl_flags = flags & GLINE_MASK; @@ -147,7 +148,8 @@ propagate_gline(struct Client *cptr, struct Client *sptr, struct Gline *gline) return; if (IsUser(sptr)) { /* select appropriate source */ - assert(0 != gline->gl_lastmod); + if (!gline->gl_lastmod) + return; sendto_serv_butone(cptr, "%s%s " TOK_GLINE " * %c%s%s%s " TIME_T_FMT " " TIME_T_FMT " :%s", NumNick(sptr), GlineIsActive(gline) ? '+' : '-', gline->gl_user, @@ -353,7 +355,8 @@ gline_find(char *userhost, unsigned int flags) if (gline->gl_expire <= TStime()) gline_free(gline); - else if (match(gline->gl_user, userhost) == 0) + else if ((flags & GLINE_EXACT ? ircd_strcmp(gline->gl_user, userhost) : + match(gline->gl_user, userhost)) == 0) return gline; } } @@ -369,10 +372,17 @@ gline_find(char *userhost, unsigned int flags) if (gline->gl_expire <= TStime()) gline_free(gline); - else if (match(gline->gl_host, host) == 0 && - ((!user && ircd_strcmp(gline->gl_user, "*") == 0) || - match(gline->gl_user, user) == 0)) + else if (flags & GLINE_EXACT) { + if (ircd_strcmp(gline->gl_host, host) == 0 && + ((!user && ircd_strcmp(gline->gl_user, "*") == 0) || + ircd_strcmp(gline->gl_user, user) == 0)) + break; + } else { + if (match(gline->gl_host, host) == 0 && + ((!user && ircd_strcmp(gline->gl_user, "*") == 0) || + match(gline->gl_user, user) == 0)) break; + } } MyFree(t_uh); diff --git a/ircd/ircd_snprintf.c b/ircd/ircd_snprintf.c index 6c9e43d..2cbf741 100644 --- a/ircd/ircd_snprintf.c +++ b/ircd/ircd_snprintf.c @@ -1820,9 +1820,6 @@ doprintf(struct Client *dest, struct BufData *buf_p, const char *fmt, char intbuf[INTBUF_LEN], **table = 0, *tstr; int ibuf_loc = INTBUF_LEN, ilen, zlen = 0, plen = 0, elen = 0; - if (fld_s.prec < 0) /* default precision is 1 */ - fld_s.prec = 1; - if (fld_s.base == BASE_OCTAL) /* select string table to use */ table = octal; else if (fld_s.base == BASE_DECIMAL) @@ -1833,6 +1830,15 @@ doprintf(struct Client *dest, struct BufData *buf_p, const char *fmt, elen = 2; /* account for the length of 0x */ } + if (fld_s.prec < 0) { /* default precision is 1 */ + if ((fld_s.flags & (FLAG_MINUS | FLAG_ZERO)) == FLAG_ZERO && + fld_s.width) { + fld_s.prec = fld_s.width - elen; + fld_s.width = 0; + } else + fld_s.prec = 1; + } + /* If there's a sign flag, account for it */ if (fld_s.flags & (FLAG_PLUS | FLAG_SPACE | INFO_NEGATIVE)) elen++; diff --git a/ircd/m_gline.c b/ircd/m_gline.c index 96761e7..5ba85ac 100644 --- a/ircd/m_gline.c +++ b/ircd/m_gline.c @@ -133,13 +133,13 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) time_t expire_off, lastmod = 0; char *mask = parv[2], *target = parv[1], *reason; - if (parc == 4) { + if (parc == 5) { if (!find_conf_byhost(cptr->confs, sptr->name, CONF_UWORLD)) return need_more_params(sptr, "GLINE"); reason = parv[4]; flags |= GLINE_FORCE; - } else if (parc >= 5) { + } else if (parc > 5) { lastmod = atoi(parv[4]); reason = parv[5]; } else @@ -177,7 +177,7 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) expire_off = atoi(parv[3]); - agline = gline_find(mask, GLINE_ANY); + agline = gline_find(mask, GLINE_ANY | GLINE_EXACT); if (agline) { if (GlineIsLocal(agline) && !(flags & GLINE_LOCAL)) /* global over local */ @@ -241,11 +241,11 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) } #endif - if (parc == 3) { + if (parc == 4) { expire_off = atoi(parv[2]); reason = parv[3]; flags |= GLINE_LOCAL; - } else if (parc >= 4) { + } else if (parc > 4) { target = parv[2]; expire_off = atoi(parv[3]); reason = parv[4]; @@ -279,16 +279,18 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) } } - agline = gline_find(mask, GLINE_ANY); + agline = gline_find(mask, GLINE_ANY | GLINE_EXACT); if (agline) { if (GlineIsLocal(agline) && !(flags & GLINE_LOCAL)) /* global over local */ gline_free(agline); else { if (flags & GLINE_ACTIVE) - return gline_activate(cptr, sptr, agline, TStime()); + return gline_activate(cptr, sptr, agline, + GlineLastMod(agline) ? TStime() : 0); else - return gline_deactivate(cptr, sptr, agline, TStime()); + return gline_deactivate(cptr, sptr, agline, + GlineLastMod(agline) ? TStime() : 0); } } diff --git a/ircd/m_join.c b/ircd/m_join.c index f7b0342..d52a34e 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -202,7 +202,7 @@ int m_join(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) #ifdef BADCHAN struct Gline *gline; - if ((gline = gline_find(name, GLINE_BADCHAN)) && + if ((gline = gline_find(name, GLINE_BADCHAN | GLINE_EXACT)) && GlineIsActive(gline) && !IsAnOper(sptr)) { sendto_one(sptr, err_str(ERR_BADCHANNAME), me.name, parv[0], name); @@ -629,7 +629,7 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) #ifdef BADCHAN struct Gline *gline; - if ((gline = gline_find(name, GLINE_BADCHAN)) && + if ((gline = gline_find(name, GLINE_BADCHAN | GLINE_EXACT)) && GlineIsActive(gline) && !IsAnOper(sptr)) { sendto_one(sptr, err_str(ERR_BADCHANNAME), me.name, parv[0], name); -- 2.20.1