[IRC-Dev CVS] [CVS] Module ircd-ircdev: Change committed
Brought to you by:
zolty
From: Toni G. <zo...@us...> - 2007-09-20 21:01:16
|
Committer : zolty CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2007-09-20 21:01:04 UTC Modified files: ChangeLog ChangeLog.es configure.ac ircd-patch test.l include/client.h include/crule.h include/msgq.h include/patchlevel.h include/send.h ircd/channel.c ircd/convert-conf.c ircd/crule.c ircd/gline.c ircd/hash.c ircd/ircd.c ircd/ircd_crypt.c ircd/ircd_crypt_native.c ircd/ircd_events.c ircd/ircd_features.c ircd/ircd_log.c ircd/ircd_parser.y ircd/ircd_res.c ircd/ircd_reslib.c ircd/ircd_signal.c ircd/listener.c ircd/m_account.c ircd/m_admin.c ircd/m_asll.c ircd/m_away.c ircd/m_burst.c ircd/m_cap.c ircd/m_clearmode.c ircd/m_connect.c ircd/m_create.c ircd/m_defaults.c ircd/m_destruct.c ircd/m_endburst.c ircd/m_invite.c ircd/m_join.c ircd/m_kick.c ircd/m_kill.c ircd/m_list.c ircd/m_lusers.c ircd/m_mode.c ircd/m_names.c ircd/m_nick.c ircd/m_oper.c ircd/m_part.c ircd/m_pass.c ircd/m_pong.c ircd/m_privs.c ircd/m_rehash.c ircd/m_silence.c ircd/m_stats.c ircd/m_topic.c ircd/m_userhost.c ircd/m_userip.c ircd/m_version.c ircd/m_wallvoices.c ircd/m_who.c ircd/m_whois.c ircd/match.c ircd/motd.c ircd/msgq.c ircd/os_generic.c ircd/s_auth.c ircd/s_bsd.c ircd/s_conf.c ircd/s_debug.c ircd/s_err.c ircd/s_misc.c ircd/s_stats.c ircd/s_user.c ircd/send.c ircd/table_gen.c ircd/umkpasswd.c ircd/uping.c Added files: tools/iauth-test Log message: Cleanup ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.56 ircd-ircdev/ChangeLog:1.57 --- ircd-ircdev/ChangeLog:1.56 Sat Jul 21 16:51:39 2007 +++ ircd-ircdev/ChangeLog Thu Sep 20 14:00:31 2007 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.56 2007/07/21 23:51:39 zolty Exp $ +# $Id: ChangeLog,v 1.57 2007/09/20 21:00:31 zolty Exp $ # # Insert new changes at beginning of the change list. # +2007-09-20 Toni Garc�a <zo...@ir...> 1.0.beta8 + * Cleanup + 2007-07-22 Toni Garc�a <zo...@ir...> 1.0.beta7 * Spambot checking * DelayedJoin fix Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.56 ircd-ircdev/ChangeLog.es:1.57 --- ircd-ircdev/ChangeLog.es:1.56 Sat Jul 21 16:51:39 2007 +++ ircd-ircdev/ChangeLog.es Thu Sep 20 14:00:31 2007 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.56 2007/07/21 23:51:39 zolty Exp $ +# $Id: ChangeLog.es,v 1.57 2007/09/20 21:00:31 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2007-09-20 Toni Garc�a <zo...@ir...> 1.0.beta8 + * Cleanup + 2007-07-22 Toni Garc�a <zo...@ir...> 1.0.beta7 * Chequeo de Spambot * Fix de DelayedJoin Index: ircd-ircdev/configure.ac diff -u ircd-ircdev/configure.ac:1.1 ircd-ircdev/configure.ac:1.2 --- ircd-ircdev/configure.ac:1.1 Sun Apr 22 06:56:17 2007 +++ ircd-ircdev/configure.ac Thu Sep 20 14:00:31 2007 @@ -23,7 +23,7 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl -dnl @(#)$Id: configure.ac,v 1.1 2007/04/22 13:56:17 zolty Exp $ +dnl @(#)$Id: configure.ac,v 1.2 2007/09/20 21:00:31 zolty Exp $ dnl AC_INIT([IRC-Dev IRC Daemon],[1.0.beta],[de...@ir...],[ircd-ircdev]) @@ -44,7 +44,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA]) -AC_REVISION($Revision: 1.1 $) +AC_REVISION($Revision: 1.2 $) AC_CONFIG_SRCDIR([ircd/ircd.c]) AM_INIT_AUTOMAKE([foreign]) @@ -88,8 +88,8 @@ dnl Check out header files AC_HEADER_STDC AC_CHECK_HEADERS([crypt.h poll.h inttypes.h stdint.h sys/devpoll.h \ - sys/epoll.h sys/event.h sys/param.h sys/resource.h \ - sys/socket.h]) + sys/epoll.h sys/event.h sys/param.h sys/resource.h \ + sys/socket.h]) dnl Checks for typedefs, structures, compiler characteristics, etc. AC_C_CONST @@ -100,8 +100,8 @@ AC_TYPE_UID_T unet_CHECK_TYPE_SIZES AC_CHECK_TYPE([struct sockaddr_in6], - [unet_have_sockaddr_in6=yes], - [unet_have_sockaddr_in6=no], + [unet_have_sockaddr_in6=yes], + [unet_have_sockaddr_in6=no], [#include <sys/types.h> #include <netinet/in.h>]) @@ -117,11 +117,11 @@ curl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void ; do for t in int size_t unsigned long "unsigned long" ; do - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> + AC_TRY_COMPILE([#include <sys/types.h> #include <sys/socket.h> -int getpeername (int $arg2 *, $t *);]], [[$t len; - getpeername(0, 0, &len);]])],[curl_cv_socklen_t_equiv="$t" - break],[]) +int getpeername (int $arg2 *, $t *);],[$t len; + getpeername(0, 0, &len);], [curl_cv_socklen_t_equiv="$t" + break]) done done ]) @@ -134,10 +134,6 @@ dnl Checks for library functions. AC_CHECK_FUNCS([kqueue setrlimit getrusage times]) -dnl Do we have restarting syscalls? -dnl XXX Note: this macro has been obsoleted -AC_SYS_RESTARTABLE_SYSCALLS - dnl Figure out non-blocking and signals unet_NONBLOCKING unet_SIGNALS @@ -255,11 +251,11 @@ dnl XXX Should rework this check AC_MSG_CHECKING([whether epoll functions are properly defined]) AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/epoll.h>], - [epoll_create(10);])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_DEFINE([EPOLL_NEED_BODY], 1, - [Define to implement epoll system calls])]) + [epoll_create(10);])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_DEFINE([EPOLL_NEED_BODY], 1, + [Define to implement epoll system calls])]) fi AM_CONDITIONAL(ENGINE_EPOLL, [test x"$unet_cv_enable_epoll" = xyes]) @@ -306,7 +302,7 @@ dnl How to copy one va_list to another? AC_CACHE_CHECK([for va_copy], unet_cv_c_va_copy, [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdarg.h>], - [va_list ap1, ap2; va_copy(ap1, ap2);])], + [va_list ap1, ap2; va_copy(ap1, ap2);])], [unet_cv_c_va_copy="yes"], [unet_cv_c_va_copy="no"])]) @@ -316,7 +312,7 @@ AC_CACHE_CHECK([for __va_copy], unet_cv_c___va_copy, [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdarg.h>], - [va_list ap1, ap2; __va_copy(ap1, ap2);])], + [va_list ap1, ap2; __va_copy(ap1, ap2);])], [unet_cv_c___va_copy="yes"], [unet_cv_c___va_copy="no"])]) @@ -329,7 +325,7 @@ if test -f /etc/resolv.conf; then unet_domain=`awk '/^domain/ { print $2; exit }' /etc/resolv.conf` if test x"$unet_domain" = x; then - unet_domain=`awk '/^search/ { print $2; exit }' /etc/resolv.conf` + unet_domain=`awk '/^search/ { print $2; exit }' /etc/resolv.conf` fi fi @@ -352,7 +348,7 @@ unet_VALUE([maxcon], $unet_maxcon, [Maximum number of connections server will accept], - [max connections], + [max connections], [# Fix up a spurious --with-maxcon if test x"$unet_cv_with_maxcon" = xyes -o x"$unet_cv_with_maxcon" = xno; then unet_cv_with_maxcon=$unet_maxcon @@ -362,7 +358,7 @@ [Maximum number of network connections]) dnl Report configuration -dnl AC_CONFIG_COMMANDS([default-1],[[echo " +dnl AC_OUTPUT_COMMANDS([echo " dnl ircu is now hopefully configured for your system. dnl Host system: $host_os @@ -377,7 +373,7 @@ dnl kqueue() engine: $unet_cv_enable_kqueue dnl /dev/poll engine: $unet_cv_enable_devpoll dnl epoll() engine: $unet_cv_enable_epoll -dnl "]],[[]]) +dnl "]) dnl Output everything... dnl AC_OUTPUT Index: ircd-ircdev/include/client.h diff -u ircd-ircdev/include/client.h:1.21 ircd-ircdev/include/client.h:1.22 --- ircd-ircdev/include/client.h:1.21 Sat Jul 21 16:51:39 2007 +++ ircd-ircdev/include/client.h Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Structures and functions for handling local clients. - * @version $Id: client.h,v 1.21 2007/07/21 23:51:39 zolty Exp $ + * @version $Id: client.h,v 1.22 2007/09/20 21:00:31 zolty Exp $ */ #ifndef INCLUDED_client_h #define INCLUDED_client_h @@ -325,7 +325,6 @@ /** Get client's warning countdown value. */ #define cli_warn_countdown(cli) (cli_connect(cli)->con_warn_countdown) - /** Get number of incoming bytes queued for client. */ #define cli_count(cli) con_count(cli_connect(cli)) /** Get file descriptor for sending in client's direction. */ Index: ircd-ircdev/include/crule.h diff -u ircd-ircdev/include/crule.h:1.6 ircd-ircdev/include/crule.h:1.7 --- ircd-ircdev/include/crule.h:1.6 Sun Apr 22 06:56:19 2007 +++ ircd-ircdev/include/crule.h Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file crule.h * @brief Interfaces and declarations for connection rule checking. - * @version $Id: crule.h,v 1.6 2007/04/22 13:56:19 zolty Exp $ + * @version $Id: crule.h,v 1.7 2007/09/20 21:00:31 zolty Exp $ */ #ifndef INCLUDED_crule_h #define INCLUDED_crule_h @@ -32,7 +32,6 @@ struct CRuleNode; extern int crule_eval(struct CRuleNode* rule); -extern struct CRuleNode* crule_parse(const char* rule); extern char *crule_text(struct CRuleNode *rule); extern struct CRuleNode* crule_make_and(struct CRuleNode *left, Index: ircd-ircdev/include/msgq.h diff -u ircd-ircdev/include/msgq.h:1.7 ircd-ircdev/include/msgq.h:1.8 --- ircd-ircdev/include/msgq.h:1.7 Sat Apr 21 14:17:22 2007 +++ ircd-ircdev/include/msgq.h Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Outbound message queue interface and declarations. - * @version $Id: msgq.h,v 1.7 2007/04/21 21:17:22 zolty Exp $ + * @version $Id: msgq.h,v 1.8 2007/09/20 21:00:31 zolty Exp $ */ #ifndef INCLUDED_msgq_h #define INCLUDED_msgq_h @@ -50,7 +50,7 @@ struct MsgQList { struct Msg *head; /**< First Msg in queue list */ struct Msg *tail; /**< Last Msg in queue list */ - unsigned int sent; /**< Bytes in *head that have already been sent */ + unsigned int sent; /**< Bytes in *head that have already been sent */ }; /** Entire two-priority message queue for a destination. */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.55 ircd-ircdev/include/patchlevel.h:1.56 --- ircd-ircdev/include/patchlevel.h:1.55 Sat Jul 21 16:51:39 2007 +++ ircd-ircdev/include/patchlevel.h Thu Sep 20 14:00:31 2007 @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: patchlevel.h,v 1.55 2007/07/21 23:51:39 zolty Exp $ + * $Id: patchlevel.h,v 1.56 2007/09/20 21:00:31 zolty Exp $ * */ -#define PATCHLEVEL "7" +#define PATCHLEVEL "8" #define RELEASE "1.0.beta" Index: ircd-ircdev/include/send.h diff -u ircd-ircdev/include/send.h:1.10 ircd-ircdev/include/send.h:1.11 --- ircd-ircdev/include/send.h:1.10 Sat Apr 21 14:17:22 2007 +++ ircd-ircdev/include/send.h Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file send.h * @brief Send messages to certain targets. - * @version $Id: send.h,v 1.10 2007/04/21 21:17:22 zolty Exp $ + * @version $Id: send.h,v 1.11 2007/09/20 21:00:31 zolty Exp $ */ #ifndef INCLUDED_send_h #define INCLUDED_send_h @@ -116,7 +116,7 @@ #define SKIP_SERVERS 0x10 /**< skip server links */ /* Send command to all users having a particular flag set */ -extern void sendwallto_group(struct Client *from, int type, +extern void sendwallto_group(struct Client *from, int type, struct Client *one, const char *pattern, ...); Index: ircd-ircdev/ircd-patch diff -u ircd-ircdev/ircd-patch:1.1 ircd-ircdev/ircd-patch:1.2 --- ircd-ircdev/ircd-patch:1.1 Tue Dec 28 03:15:43 2004 +++ ircd-ircdev/ircd-patch Thu Sep 20 14:00:31 2007 @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA -# $Id: ircd-patch,v 1.1 2004/12/28 11:15:43 zolty Exp $ +# $Id: ircd-patch,v 1.2 2007/09/20 21:00:31 zolty Exp $ # # # Experimental centralized patch system for ircu @@ -51,15 +51,15 @@ update_patchlist() { list="" for name in $PLIST ; do - [ -f $MARKS/$name ] && list="$list.$name" + test -f $MARKS/$name && list="$list.$name" done echo "/* This file was automatically generated by ircd-patch */" > $PLIST_FILE echo "#define PATCHLIST \"$list\"" >> $PLIST_FILE echo "Updated $PLIST_FILE" } -[ ! -d $DIFFS ] && (echo "*** Missing $DIFFS, creating it" ; mkdir -p $DIFFS) -[ ! -d $MARKS ] && (echo "*** Missing $MARKS, creating it" ; mkdir -p $MARKS) +test -d $DIFFS || (echo "*** Missing $DIFFS, creating it" ; mkdir -p $DIFFS) +test -d $MARKS || (echo "*** Missing $MARKS, creating it" ; mkdir -p $MARKS) dry_run() { rejects=`patch -p0 -N -t --dry-run $2 < $1 | grep "hunk FAILED" | sed -e 's/.*to file / /;s/\.rej$//'` @@ -69,7 +69,7 @@ patch_list() { echo "Available patches (* marks applied patches):" for name in $PLIST ; do - [ -f $MARKS/$name ] && echo -n " * " || echo -n " " + test -f $MARKS/$name && echo -n " * " || echo -n " " echo $name done echo "Done." @@ -78,11 +78,11 @@ patch_test() { echo "Testing patches:" list="$*" - [ -z "$list" ] && list=$PLIST + test "z$list" = "z" && list=$PLIST for name in $list ; do fname=$DIFFS/$name.diff echo -ne " $name\t" - if [ ! -f $MARKS/$name ] ; then + if test ! -f $MARKS/$name ; then if dry_run "$fname" ; then echo -n " OK" else @@ -106,19 +106,19 @@ patch_add() { name=$1 fname="$DIFFS/$name.diff" - if [ ! -f $fname ]; then + if test ! -f $fname ; then echo "Patch $name ($fname) does not exist" retcode=3 return fi - if [ $force -lt 2 -a -f $MARKS/$name ] ; then + if test $force -lt 2 -a -f $MARKS/$name ; then echo "Patch $name seems already applied" retcode=4 return fi - if [ $force -lt 1 ]; then + if test $force -lt 1 ; then echo -n "Testing $fname... " if ! dry_run $fname ; then echo "Failed (use -f to force)." @@ -143,19 +143,19 @@ patch_del() { name=$1 fname="$DIFFS/$name.diff" - if [ ! -f $fname ]; then + if test ! -f $fname ; then echo "Patch $name ($fname) does not exist" retcode=3 return fi - if [ $force -lt 2 -a ! -f $MARKS/$name ] ; then + if test $force -lt 2 -a ! -f $MARKS/$name ; then echo "Patch $name doesn't seem to be applied" retcode=4 return fi - if [ $force -lt 1 ]; then + if test $force -lt 1 ; then echo -n "Testing $fname... " if ! dry_run $fname -R ; then echo "Failed (use -f to force)." @@ -191,8 +191,8 @@ echo "a patch is already applied." } -while [ "$1" == "-f" ]; do - force=$[$force + 1] +while test "$1" = "-f" ; do + force=`expr $force + 1` shift done Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.32 ircd-ircdev/ircd/channel.c:1.33 --- ircd-ircdev/ircd/channel.c:1.32 Sat Jul 21 16:51:39 2007 +++ ircd-ircdev/ircd/channel.c Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.32 2007/07/21 23:51:39 zolty Exp $ + * @version $Id: channel.c,v 1.33 2007/09/20 21:00:31 zolty Exp $ */ #include "config.h" @@ -82,7 +82,6 @@ set_ban_mask(struct Ban *ban, const char *banstr) { char *sep; - assert(banstr != NULL); ircd_strncpy(ban->banstr, banstr, sizeof(ban->banstr) - 1); sep = strrchr(banstr, '@'); @@ -303,7 +302,7 @@ * on the channel and we want them to contact IRC opers * who then will educate them on the use of Apass/Upass. */ - if (!chptr->mode.apass[0]) /* If no Apass, reset all modes. */ + if (!chptr->mode.apass[0]) /* If no Apass, reset all modes. */ { struct Ban *link, *next; chptr->mode.mode = 0; @@ -319,11 +318,10 @@ if (!feature_bool(FEAT_OPLEVELS)) { destruct_channel(chptr); - destruct_channel(chptr); return 0; } } - if (TStime() - chptr->creationtime < 172800) /* Channel younger than 48 hours? */ + if (TStime() - chptr->creationtime < 172800) /* Channel younger than 48 hours? */ schedule_destruct_event_1m(chptr); /* Get rid of it in approximately 4-5 minutes */ else schedule_destruct_event_48h(chptr); /* Get rid of it in approximately 48 hours */ @@ -452,10 +450,9 @@ hostmask = banlist->banstr + banlist->nu_len + 1; if (!((banlist->flags & BAN_IPMASK) && ipmask_check(&cli_ip(cptr), &banlist->address, banlist->addrbits)) - && match(hostmask, cli_user(cptr)->host) - && !(sr && !match(hostmask, sr))) - continue; - + && match(hostmask, cli_user(cptr)->host) + && !(sr && !match(hostmask, sr))) + continue; /* If an exception matches, no ban can match. */ if (banlist->flags & BAN_EXCEPTION) return NULL; @@ -598,7 +595,7 @@ } return 1; } - + /** Remove a user from a channel * This is the generic entry point for removing a user from a channel, this @@ -719,6 +716,7 @@ #if defined(UNDERNET) /* Discourage using the Apass to get op. They should use the upass. */ + if (IsChannelManager(member) && member->channel->mode.apass[0]) return 0; #endif @@ -1423,9 +1421,9 @@ * Adds an invite for a user to a channel. Limits the number of invites * to FEAT_MAXCHANNELSPERUSER. Does not notify the user. * - * @param[in] cptr The client to be invited. - * @param[in] chptr The channel to be invited to. - * @param[in] inviter The client inviting \a cptr. + * @param[in] cptr The client to be invited. + * @param[in] chptr The channel to be invited to. + * @param[in] inviter The client inviting \a cptr. */ void add_invite(struct Client *cptr, struct Channel *chptr, struct Client *inviter) { @@ -1433,6 +1431,7 @@ struct Invite *inv; int max = feature_int(FEAT_MAXCHANNELSPERUSER); int count = 0; + /* See if the user is already invited. */ while ((inv = *uprev) != NULL) { @@ -1790,32 +1789,32 @@ if ((totalbuflen - IRCD_MAX(9, tmp)) <= 0) /* don't overflow buffer */ MB_TYPE(mbuf, i) |= MODE_SAVE; /* save for later */ else { - char mode_char = 0; #if defined(DDB) || defined(SERVICES) + char mode_char = 0; + switch(MB_TYPE(mbuf, i) & (MODE_OWNER | MODE_CHANOP | MODE_VOICE)) -#else - switch(MB_TYPE(mbuf, i) & (MODE_CHANOP | MODE_VOICE)) -#endif { -#if defined(DDB) || defined(SERVICES) case MODE_OWNER: mode_char = 'q'; break; -#endif case MODE_CHANOP: mode_char = 'o'; break; case MODE_VOICE: mode_char = 'v'; break; - } - bufptr[(*bufptr_i)++] = mode_char; + } + bufptr[(*bufptr_i)++] = mode_char; + + totalbuflen -= IRCD_MAX(9, tmp) + 1; + } + + } else if (MB_TYPE(mbuf, i) & MODE_BAN) { +#else + bufptr[(*bufptr_i)++] = MB_TYPE(mbuf, i) & MODE_CHANOP ? 'o' : 'v'; totalbuflen -= IRCD_MAX(9, tmp) + 1; } -#if defined(UNDERNET) } else if (MB_TYPE(mbuf, i) & (MODE_BAN | MODE_APASS | MODE_UPASS)) { -#else - } else if (MB_TYPE(mbuf, i) & MODE_BAN) { #endif tmp = strlen(MB_STRING(mbuf, i)); @@ -1974,6 +1973,7 @@ #endif /* defined(DDB) */ sendcmdto_channel(app_source, CMD_MODE, mbuf->mb_channel, NULL, SKIP_SERVERS, "%H %s%s%s%s%s%s%s%s", mbuf->mb_channel, +/* TODO-ZOLTAN: Revisar */ /* rembuf_i || rembuf_local_i ? "-" : "", rembuf, rembuf_local, addbuf_i || addbuf_local_i ? "+" : "", @@ -2012,9 +2012,8 @@ } #if defined(UNDERNET) - /* if we're changing oplevels we know the oplevel, pass it on */ - if (mbuf->mb_channel->mode.apass[0] - && (MB_TYPE(mbuf, i) & MODE_CHANOP) + /* if we're changing oplevels and we know the oplevel, pass it on */ + if ((MB_TYPE(mbuf, i) & MODE_CHANOP) && MB_OPLEVEL(mbuf, i) < MAXOPLEVEL) *strptr_i += ircd_snprintf(0, strptr + *strptr_i, BUFSIZE - *strptr_i, " %s%s:%d", @@ -2182,6 +2181,7 @@ mode &= (MODE_ADD | MODE_DEL | MODE_PRIVATE | MODE_SECRET | MODE_MODERATED | MODE_TOPICLIMIT | MODE_INVITEONLY | MODE_NOPRIVMSGS | MODE_REGONLY | #if defined(DDB) || defined(SERVICES) +/* TODO-ZOLTAN: Revisar */ /* MODE_REGCHAN | */ #endif MODE_DELJOINS | MODE_WASDELJOINS); @@ -2615,7 +2615,7 @@ if (!state->mbuf) return; - + /* Skip if this is a burst, we have a key already and the new key is * after the old one alphabetically */ if ((state->flags & MODE_PARSE_BURST) && @@ -2648,8 +2648,7 @@ if (state->flags & MODE_PARSE_SET) { if (state->dir == MODE_DEL) /* remove the old key */ *state->chptr->mode.key = '\0'; - else if (!state->chptr->mode.key[0] - || ircd_strcmp(t_str, state->chptr->mode.key) < 0) + else ircd_strncpy(state->chptr->mode.key, t_str, KEYLEN); } } @@ -2699,7 +2698,7 @@ } else { send_reply(state->sptr, ERR_NOMANAGER, state->chptr->chname, (TStime() - state->chptr->creationtime < 172800) ? - "approximately 4-5 minutes" : "approximately 48 hours"); + "approximately 4-5 minutes" : "approximately 48 hours"); } return; } @@ -2840,6 +2839,7 @@ return; } } + if (state->done & DONE_APASS) /* allow apass to be set only once */ return; state->done |= DONE_APASS; @@ -2885,18 +2885,19 @@ ircd_strncpy(state->chptr->mode.apass, t_str, KEYLEN); /* Make it VERY clear to the user that this is a one-time password */ if (MyUser(state->sptr)) { - send_reply(state->sptr, RPL_APASSWARN_SET, state->chptr->mode.apass); - send_reply(state->sptr, RPL_APASSWARN_SECRET, state->chptr->chname, + send_reply(state->sptr, RPL_APASSWARN_SET, state->chptr->mode.apass); + send_reply(state->sptr, RPL_APASSWARN_SECRET, state->chptr->chname, state->chptr->mode.apass); } /* Give the channel manager level 0 ops. There should not be tested for IsChannelManager here because - on the local server it is impossible to set the apass if one - isn't a channel manager and remote servers might need to sync - the oplevel here: when someone creates a channel (and becomes - channel manager) during a net.break, and only sets the Apass - after the net rejoined, they will have oplevel MAXOPLEVEL on - all remote servers. */ + on the local server it is impossible to set the apass if one + isn't a channel manager and remote servers might need to sync + the oplevel here: when someone creates a channel (and becomes + channel manager) during a net.break, and only sets the Apass + after the net rejoined, they will have oplevel MAXOPLEVEL on + all remote servers. */ + if (state->member) SetOpLevel(state->member, 0); } else { /* remove the old apass */ @@ -3105,7 +3106,6 @@ continue; } else if (ban->flags & BAN_DEL) { /* Deleted a ban? */ char *bandup; - DupString(bandup, ban->banstr); modebuf_mode_string(state->mbuf, MODE_DEL | MODE_BAN, bandup, 1); @@ -3145,7 +3145,6 @@ len -= banlen; } else { char *bandup; - /* add the ban to the buffer */ DupString(bandup, ban->banstr); modebuf_mode_string(state->mbuf, MODE_ADD | MODE_BAN, @@ -3300,7 +3299,7 @@ /* prevent +k users from being deopped */ if (IsChannelService(state->cli_change[i].client)) { if (state->flags & MODE_PARSE_FORCE) /* it was forced */ - sendto_opmask(0, SNO_HACK4, "Deop of +k user on %H by %s", + sendto_opmask(0, SNO_HACK4, "Deop of +k user on %H by %s", state->chptr, (IsServer(state->sptr) ? cli_name(state->sptr) : cli_name((cli_user(state->sptr))->server))); @@ -3327,10 +3326,10 @@ } #if defined(UNDERNET) - /* Forbid deopping other members with an oplevel less than + /* Forbid deopping other members with an oplevel less than * one's own level, and other members with an oplevel the same * as one's own unless both are at MAXOPLEVEL. */ - if (state->sptr != state->cli_change[i].client + if (state->sptr != state->cli_change[i].client && state->member && ((OpLevel(member) < OpLevel(state->member)) || (OpLevel(member) == OpLevel(state->member) @@ -3361,8 +3360,8 @@ SetOpLevel(member, state->cli_change[i].oplevel); else if (!state->member) SetOpLevel(member, MAXOPLEVEL); - else if (!state->chptr->mode.apass[0] || OpLevel(state->member) == MAXOPLEVEL) - SetOpLevel(member, MAXOPLEVEL); + else if (OpLevel(state->member) >= MAXOPLEVEL) + SetOpLevel(member, OpLevel(state->member)); else SetOpLevel(member, OpLevel(state->member) + 1); } @@ -3763,8 +3762,8 @@ * exactly the same logic, albeit somewhat more concise, as was in * the original m_part.c */ - /* got to remove user here */ - if (jbuf->jb_type == JOINBUF_TYPE_PARTALL || is_local) + if (jbuf->jb_type == JOINBUF_TYPE_PARTALL || + is_local) /* got to remove user here */ remove_user_from_channel(jbuf->jb_source, chan); } else { #if defined(UNDERNET) @@ -3785,7 +3784,7 @@ #endif /* send JOIN notification to all servers (CREATE is sent later). */ - if (jbuf->jb_type != JOINBUF_TYPE_CREATE && !IsLocalChannel(chan->chname)) + if (jbuf->jb_type != JOINBUF_TYPE_CREATE && !is_local) { #if defined(DDB) if (flags & CHFL_OWNER) @@ -3808,7 +3807,7 @@ /* send an op, too, if needed */ #if defined(UNDERNET) if (flags & CHFL_CHANOP && (oplevel < MAXOPLEVEL || !MyUser(jbuf->jb_source))) - sendcmdto_channel((chan->mode.apass[0] ? &his : jbuf->jb_source), + sendcmdto_channel((chan->mode.apass[0] ? &his : jbuf->jb_source), CMD_MODE, chan, NULL, SKIP_SERVERS, "%H +o %C", chan, jbuf->jb_source); #elif defined(DDB) Index: ircd-ircdev/ircd/convert-conf.c diff -u ircd-ircdev/ircd/convert-conf.c:1.3 ircd-ircdev/ircd/convert-conf.c:1.4 --- ircd-ircdev/ircd/convert-conf.c:1.3 Thu Apr 26 14:17:11 2007 +++ ircd-ircdev/ircd/convert-conf.c Thu Sep 20 14:00:31 2007 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: convert-conf.c,v 1.3 2007/04/26 21:17:11 zolty Exp $ + * $Id: convert-conf.c,v 1.4 2007/09/20 21:00:31 zolty Exp $ * convert-conf.c - Convert ircu2.10.11 ircd.conf to ircu2.10.12 format. * */ @@ -218,12 +218,12 @@ { for (sl = conn->origins; sl; sl = sl->next) fprintf(stdout, "# %s\n", sl->value); - if (conn->host == NULL + if (conn->host == NULL || conn->password == NULL || conn->class == NULL) { - fprintf(stderr,"H:line missing C:line for %s\n", conn->name); - continue; - } + fprintf(stderr,"H:line missing C:line for %s\n", conn->name); + continue; + } fprintf(stdout, "Connect {\n\tname =\"%s\";\n\thost = \"%s\";\n" Index: ircd-ircdev/ircd/crule.c diff -u ircd-ircdev/ircd/crule.c:1.7 ircd-ircdev/ircd/crule.c:1.8 --- ircd-ircdev/ircd/crule.c:1.7 Sun Apr 22 06:56:20 2007 +++ ircd-ircdev/ircd/crule.c Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ /** * @file * @brief Connection rule parser and checker - * @version $Id: crule.c,v 1.7 2007/04/22 13:56:20 zolty Exp $ + * @version $Id: crule.c,v 1.8 2007/09/20 21:00:31 zolty Exp $ * * by Tony Vencill (Tonto on IRC) <ve...@bg...> * rewritten by Michael Poole <md...@tr...> @@ -43,9 +43,6 @@ #include "s_bsd.h" #include "struct.h" -#include <stdio.h> -#include <stdlib.h> - /** Evaluation function for a connection rule. */ typedef int (*crule_funcptr) (struct CRuleNode *); Index: ircd-ircdev/ircd/gline.c diff -u ircd-ircdev/ircd/gline.c:1.20 ircd-ircdev/ircd/gline.c:1.21 --- ircd-ircdev/ircd/gline.c:1.20 Sat Apr 21 14:17:22 2007 +++ ircd-ircdev/ircd/gline.c Thu Sep 20 14:00:31 2007 @@ -23,7 +23,7 @@ */ /** @file * @brief Implementation of Gline manipulation functions. - * @version $Id: gline.c,v 1.20 2007/04/21 21:17:22 zolty Exp $ + * @version $Id: gline.c,v 1.21 2007/09/20 21:00:31 zolty Exp $ */ #include "config.h" @@ -71,7 +71,6 @@ /** List of BadChan G-lines. */ static struct Gline* BadChanGlineList = 0; - /** Count number of users who match \a mask. * @param[in] mask user\@host or user\@ip mask to check. * @return Count of matching users. @@ -82,7 +81,7 @@ struct Client *acptr; int count = 0; char namebuf[USERLEN + HOSTLEN + 2]; - char ipbuf[USERLEN + 16 + 2]; + char ipbuf[USERLEN + SOCKIPLEN + 2]; for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr)) { if (!IsUser(acptr)) @@ -899,7 +898,7 @@ send_reply(sptr, RPL_STATSGLINE, 'G', gline->gl_user, gline->gl_host ? "@" : "", gline->gl_host ? gline->gl_host : "", - gline->gl_expire + TSoffset, + gline->gl_expire + TSoffset, GlineIsActive(gline) ? '+' : '-', gline->gl_reason); } Index: ircd-ircdev/ircd/hash.c diff -u ircd-ircdev/ircd/hash.c:1.14 ircd-ircdev/ircd/hash.c:1.15 --- ircd-ircdev/ircd/hash.c:1.14 Thu Apr 19 15:53:47 2007 +++ ircd-ircdev/ircd/hash.c Thu Sep 20 14:00:31 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief Hash table management. - * @version $Id: hash.c,v 1.14 2007/04/19 22:53:47 zolty Exp $ + * @version $Id: hash.c,v 1.15 2007/09/20 21:00:31 zolty Exp $ * * This file used to use some very complicated hash function. Now it * uses CRC-32, but effectively remaps each input byte according to a @@ -488,7 +488,6 @@ stats_nickjupes(struct Client* to, const struct StatDesc* sd, char* param) { int i; - for (i = 0; i < JUPEHASHSIZE; i++) if (jupeTable[i][0]) send_reply(to, RPL_STATSJLINE, jupeTable[i]); Index: ircd-ircdev/ircd/ircd.c diff -u ircd-ircdev/ircd/ircd.c:1.28 ircd-ircdev/ircd/ircd.c:1.29 --- ircd-ircdev/ircd/ircd.c:1.28 Thu Apr 26 14:17:11 2007 +++ ircd-ircdev/ircd/ircd.c Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Entry point and other initialization functions for the daemon. - * @version $Id: ircd.c,v 1.28 2007/04/26 21:17:11 zolty Exp $ + * @version $Id: ircd.c,v 1.29 2007/09/20 21:00:31 zolty Exp $ */ #include "config.h" @@ -211,8 +211,8 @@ *--------------------------------------------------------------------------*/ /** Handle out-of-memory condition. */ static void outofmemory(void) { - Debug((DEBUG_FATAL, "Out of memory")); - server_panic("Out of Memory"); + Debug((DEBUG_FATAL, "Out of memory: restarting server...")); + server_restart("Out of Memory"); } @@ -228,11 +228,11 @@ sprintf(buff, "%5d\n", (int)getpid()); if (write(thisServer.pid_fd, buff, strlen(buff)) == -1) log_write(LS_SYSTEM, L_WARNING, 0, "Error writing to pid file %s: %m", - feature_str(FEAT_PPATH)); + feature_str(FEAT_PPATH)); return; } log_write(LS_SYSTEM, L_WARNING, 0, "Error opening pid file %s: %m", - feature_str(FEAT_PPATH)); + feature_str(FEAT_PPATH)); } /** Try to create the PID file. @@ -262,7 +262,7 @@ static void try_connections(struct Event* ev) { struct ConfItem* aconf; struct ConfItem** pconf; - time_t next = 0; + time_t next; struct Jupe* ajupe; int hold; int done; @@ -746,8 +746,8 @@ debug_init(thisServer.bootopt & BOOT_TTY); if (check_pid()) { - log_write(LS_SYSTEM, L_CRIT, 0, - "Failed to acquire PID file lock after fork"); + log_write(LS_SYSTEM, L_CRIT, 0, + "Failed to acquire PID file lock after fork"); return 2; } Index: ircd-ircdev/ircd/ircd_crypt.c diff -u ircd-ircdev/ircd/ircd_crypt.c:1.7 ircd-ircdev/ircd/ircd_crypt.c:1.8 --- ircd-ircdev/ircd/ircd_crypt.c:1.7 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/ircd_crypt.c Thu Sep 20 14:00:31 2007 @@ -22,7 +22,7 @@ /** * @file * @brief Core password encryption routines. - * @version $Id: ircd_crypt.c,v 1.7 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: ircd_crypt.c,v 1.8 2007/09/20 21:00:31 zolty Exp $ * * This is a new look crypto API for ircu, it can handle different * password formats by the grace of magic tokens at the beginning of the @@ -43,6 +43,7 @@ * * -- blessed be, hikari. */ + #include "config.h" #include "ircd_crypt.h" #include "ircd_alloc.h" Index: ircd-ircdev/ircd/ircd_crypt_native.c diff -u ircd-ircdev/ircd/ircd_crypt_native.c:1.6 ircd-ircdev/ircd/ircd_crypt_native.c:1.7 --- ircd-ircdev/ircd/ircd_crypt_native.c:1.6 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/ircd_crypt_native.c Thu Sep 20 14:00:31 2007 @@ -22,10 +22,10 @@ /** * @file * @brief Native crypt() function routines - * @version $Id: ircd_crypt_native.c,v 1.6 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: ircd_crypt_native.c,v 1.7 2007/09/20 21:00:31 zolty Exp $ * * Routines for handling passwords encrypted with the system's native crypt() - * function (typically a DES encryption routine, but can be anything nowdays). + * function (typically a DES encryption routine, but can be anything nowadays). * */ #define _XOPEN_SOURCE 600 Index: ircd-ircdev/ircd/ircd_events.c diff -u ircd-ircdev/ircd/ircd_events.c:1.10 ircd-ircdev/ircd/ircd_events.c:1.11 --- ircd-ircdev/ircd/ircd_events.c:1.10 Thu Apr 26 14:17:11 2007 +++ ircd-ircdev/ircd/ircd_events.c Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of event loop mid-layer. - * @version $Id: ircd_events.c,v 1.10 2007/04/26 21:17:11 zolty Exp $ + * @version $Id: ircd_events.c,v 1.11 2007/09/20 21:00:31 zolty Exp $ */ #include "config.h" @@ -172,7 +172,7 @@ gen->gh_flags |= GEN_ERROR; Debug((DEBUG_LIST, "Generating event type %s for generator %p (%s)", - event_to_name(type), gen, gen_flags(gen->gh_flags))); + event_to_name(type), gen, gen_flags(gen->gh_flags))); ev.ev_next = NULL; ev.ev_prev_p = NULL; @@ -291,7 +291,7 @@ return; Debug((DEBUG_LIST, "Generating event type %s for generator %p (%s)", - event_to_name(type), gen, gen_flags(gen->gh_flags))); + event_to_name(type), gen, gen_flags(gen->gh_flags))); if ((ptr = evInfo.events_free)) evInfo.events_free = ptr->ev_next; /* pop one off the freelist */ Index: ircd-ircdev/ircd/ircd_features.c diff -u ircd-ircdev/ircd/ircd_features.c:1.20 ircd-ircdev/ircd/ircd_features.c:1.21 --- ircd-ircdev/ircd/ircd_features.c:1.20 Sat Jul 21 16:51:39 2007 +++ ircd-ircdev/ircd/ircd_features.c Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of configurable feature support. - * @version $Id: ircd_features.c,v 1.20 2007/07/21 23:51:39 zolty Exp $ + * @version $Id: ircd_features.c,v 1.21 2007/09/20 21:00:31 zolty Exp $ */ #include "config.h" @@ -909,7 +909,7 @@ for (i = 0; features[i].type; i++) { struct FeatureDesc *feat = &features[i]; - switch (feat_type(feat)) { + switch (feat_type(feat)) { case FEAT_NONE: /* you're on your own */ break; Index: ircd-ircdev/ircd/ircd_log.c diff -u ircd-ircdev/ircd/ircd_log.c:1.16 ircd-ircdev/ircd/ircd_log.c:1.17 --- ircd-ircdev/ircd/ircd_log.c:1.16 Thu Apr 26 14:17:11 2007 +++ ircd-ircdev/ircd/ircd_log.c Thu Sep 20 14:00:31 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief IRC logging implementation. - * @version $Id: ircd_log.c,v 1.16 2007/04/26 21:17:11 zolty Exp $ + * @version $Id: ircd_log.c,v 1.17 2007/09/20 21:00:31 zolty Exp $ */ #include "config.h" @@ -181,7 +181,7 @@ }; /** Modifiable static information. */ -static struct logInfo_s{ +static struct logInfo_s { struct LogFile *filelist; /**< list of log files */ struct LogFile *freelist; /**< list of free'd log files */ int facility; /**< default facility */ Index: ircd-ircdev/ircd/ircd_parser.y diff -u ircd-ircdev/ircd/ircd_parser.y:1.27 ircd-ircdev/ircd/ircd_parser.y:1.28 --- ircd-ircdev/ircd/ircd_parser.y:1.27 Thu Apr 26 12:17:31 2007 +++ ircd-ircdev/ircd/ircd_parser.y Thu Sep 20 14:00:31 2007 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_parser.y,v 1.27 2007/04/26 19:17:31 zolty Exp $ + * $Id: ircd_parser.y,v 1.28 2007/09/20 21:00:31 zolty Exp $ * */ %{ @@ -63,6 +63,7 @@ #define MAX_STRINGS 80 /* Maximum number of feature params. */ #define USE_IPV4 (1 << 16) #define USE_IPV6 (1 << 17) + extern struct LocalConf localConf; extern struct DenyConf* denyConfList; extern struct CRuleConf* cruleConfList; @@ -258,7 +259,6 @@ } %% - /* Blocks in the config file... */ blocks: blocks block | block; block: adminblock | generalblock | classblock | connectblock | Index: ircd-ircdev/ircd/ircd_res.c diff -u ircd-ircdev/ircd/ircd_res.c:1.15 ircd-ircdev/ircd/ircd_res.c:1.16 --- ircd-ircdev/ircd/ircd_res.c:1.15 Thu Apr 26 12:17:31 2007 +++ ircd-ircdev/ircd/ircd_res.c Thu Sep 20 14:00:31 2007 @@ -41,7 +41,7 @@ */ /** @file * @brief IRC resolver functions. - * @version $Id: ircd_res.c,v 1.15 2007/04/26 19:17:31 zolty Exp $ + * @version $Id: ircd_res.c,v 1.16 2007/09/20 21:00:31 zolty Exp $ */ #include "client.h" #include "ircd_alloc.h" @@ -489,8 +489,8 @@ } /** Send a query to look up the address for a name. - * @param[in] callback Callback function to call upon completion. - * @param[in] ctx Context information to pass to \a callback. + * @param[in] callback Function to call upon completion. + * @param[in] ctx Context data to pass to \a callback. * @param[in] name Hostname to look up. * @param[in] request DNS lookup structure (may be NULL). * @param[in] type Preferred request type. @@ -522,7 +522,8 @@ } /** Send a query to look up the name for an address. - * @param[in] query Callback information. + * @param[in] callback Callback function to call upon completion. + * @param[in] ctx Context information to pass to \a callback. * @param[in] addr Address to look up. * @param[in] request DNS lookup structure (may be NULL). */ Index: ircd-ircdev/ircd/ircd_reslib.c diff -u ircd-ircdev/ircd/ircd_reslib.c:1.5 ircd-ircdev/ircd/ircd_reslib.c:1.6 --- ircd-ircdev/ircd/ircd_reslib.c:1.5 Thu Apr 26 12:17:31 2007 +++ ircd-ircdev/ircd/ircd_reslib.c Thu Sep 20 14:00:31 2007 @@ -122,7 +122,7 @@ /** @file * @brief DNS resolver library functions. - * @version $Id: ircd_reslib.c,v 1.5 2007/04/26 19:17:31 zolty Exp $ + * @version $Id: ircd_reslib.c,v 1.6 2007/09/20 21:00:31 zolty Exp $ */ /** Array of nameserver addresses. */ @@ -458,7 +458,8 @@ const unsigned char *src, char *dst, size_t dstsiz) { unsigned char tmp[NS_MAXCDNAME]; - int n; + int n; + if ((n = irc_ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1) return(-1); if (irc_ns_name_ntop((char*)tmp, (char*)dst, dstsiz) == -1) Index: ircd-ircdev/ircd/ircd_signal.c diff -u ircd-ircdev/ircd/ircd_signal.c:1.7 ircd-ircdev/ircd/ircd_signal.c:1.8 --- ircd-ircdev/ircd/ircd_signal.c:1.7 Thu Apr 26 14:17:11 2007 +++ ircd-ircdev/ircd/ircd_signal.c Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Signal handlers for ircu. - * @version $Id: ircd_signal.c,v 1.7 2007/04/26 21:17:11 zolty Exp $ + * @version $Id: ircd_signal.c,v 1.8 2007/09/20 21:00:31 zolty Exp $ */ #include "config.h" @@ -248,15 +248,6 @@ signal_add(&sig_int, sigint_callback, 0, SIGINT); signal_add(&sig_term, sigterm_callback, 0, SIGTERM); signal_add(&sig_chld, sigchld_callback, 0, SIGCHLD); - -#ifdef HAVE_RESTARTABLE_SYSCALLS - /* - * At least on Apollo sr10.1 it seems continuing system calls - * after signal is the default. The following 'siginterrupt' - * should change that default to interrupting calls. - */ - siginterrupt(SIGALRM, 1); -#endif } /** Kill and clean up all child processes. */ Index: ircd-ircdev/ircd/listener.c diff -u ircd-ircdev/ircd/listener.c:1.12 ircd-ircdev/ircd/listener.c:1.13 --- ircd-ircdev/ircd/listener.c:1.12 Sun Apr 22 06:56:20 2007 +++ ircd-ircdev/ircd/listener.c Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation for handling listening sockets. - * @version $Id: listener.c,v 1.12 2007/04/22 13:56:20 zolty Exp $ + * @version $Id: listener.c,v 1.13 2007/09/20 21:00:31 zolty Exp $ */ #include "config.h" @@ -489,7 +489,7 @@ * Enable the server to clear out other connections before * continuing to accept() new connections. */ - if (fd > maxclients - 1) + if (fd >= maxclients) { ++ServerStats->is_ref; send(fd, "ERROR :All connections in use\r\n", 32, 0); Index: ircd-ircdev/ircd/m_account.c diff -u ircd-ircdev/ircd/m_account.c:1.12 ircd-ircdev/ircd/m_account.c:1.13 --- ircd-ircdev/ircd/m_account.c:1.12 Sun Apr 22 06:56:20 2007 +++ ircd-ircdev/ircd/m_account.c Thu Sep 20 14:00:31 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for ACCOUNT command. - * @version $Id: m_account.c,v 1.12 2007/04/22 13:56:20 zolty Exp $ + * @version $Id: m_account.c,v 1.13 2007/09/20 21:00:31 zolty Exp $ */ #include "config.h" @@ -41,6 +41,7 @@ #include <string.h> /** Handle an ACCOUNT message from a server connection. + * * \a parv has the following elements: * \li \a parv[1] is the numnick of the client to act on * \li \a parv[2] is the account name Index: ircd-ircdev/ircd/m_admin.c diff -u ircd-ircdev/ircd/m_admin.c:1.7 ircd-ircdev/ircd/m_admin.c:1.8 --- ircd-ircdev/ircd/m_admin.c:1.7 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_admin.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for ADMIN command. - * @version $Id: m_admin.c,v 1.7 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_admin.c,v 1.8 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -108,8 +108,6 @@ * \a parv has the following elements: * \li \a parv[1] is the server name being interrogated. * - * parv[0] = sender prefix - * parv[1] = servername * See @ref m_functions for discussion of the arguments. * @param[in] cptr Client that sent us the message. * @param[in] sptr Original source of message. Index: ircd-ircdev/ircd/m_asll.c diff -u ircd-ircdev/ircd/m_asll.c:1.5 ircd-ircdev/ircd/m_asll.c:1.6 --- ircd-ircdev/ircd/m_asll.c:1.5 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_asll.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for ASLL command. - * @version $Id: m_asll.c,v 1.5 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_asll.c,v 1.6 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -62,7 +62,6 @@ return 0; } - /** Handle an ASLL message from a server. * * In the "outbound" direction, \a parv has the following elements: Index: ircd-ircdev/ircd/m_away.c diff -u ircd-ircdev/ircd/m_away.c:1.8 ircd-ircdev/ircd/m_away.c:1.9 --- ircd-ircdev/ircd/m_away.c:1.8 Sat Apr 21 14:17:23 2007 +++ ircd-ircdev/ircd/m_away.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for AWAY command. - * @version $Id: m_away.c,v 1.8 2007/04/21 21:17:23 zolty Exp $ + * @version $Id: m_away.c,v 1.9 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -104,7 +104,7 @@ if (user_set_away(cli_user(sptr), away_message)) { - if (!was_away) + if (!was_away) sendcmdto_serv(sptr, CMD_AWAY, cptr, ":%s", away_message); send_reply(sptr, RPL_NOWAWAY); } Index: ircd-ircdev/ircd/m_burst.c diff -u ircd-ircdev/ircd/m_burst.c:1.20 ircd-ircdev/ircd/m_burst.c:1.21 --- ircd-ircdev/ircd/m_burst.c:1.20 Sat Jul 21 16:51:39 2007 +++ ircd-ircdev/ircd/m_burst.c Thu Sep 20 14:00:32 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief Handlers for BURST command. - * @version $Id: m_burst.c,v 1.20 2007/07/21 23:51:39 zolty Exp $ + * @version $Id: m_burst.c,v 1.21 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -188,55 +188,51 @@ if (parc < 3) return protocol_violation(sptr,"Too few parameters for BURST"); - if (!IsBurst(sptr)) /* don't allow BURST outside of burst */ - return exit_client_msg(cptr, cptr, &me, "HACK: BURST message outside " - "net.burst from %s", cli_name(sptr)); - if (!(chptr = get_channel(sptr, parv[1], CGT_CREATE))) return 0; /* can't create the channel? */ timestamp = atoi(parv[2]); #if defined(UNDERNET) - if (chptr->creationtime) /* 0 for new (empty) channels, + if (chptr->creationtime) /* 0 for new (empty) channels, i.e. when this server just restarted. */ { - if (parc == 3) /* Zannel BURST? */ + if (parc == 3) /* Zannel BURST? */ { /* An empty channel without +A set, will cause a BURST message - with exactly 3 parameters (because all modes have been reset). - If the timestamp on such channels is only a few seconds older - from our own, then we ignore this burst: we do not deop our - own side. - Likewise, we expect the other (empty) side to copy our timestamp - from our own BURST message, even though it is slightly larger. - - The reason for this is to allow people to join an empty - non-A channel (a zannel) during a net.split, and not be - deopped when the net reconnects (with another zannel). When - someone joins a split zannel, their side increments the TS by one. - If they cycle a few times then we still don't have a reason to - deop them. Theoretically I see no reason not to accept ANY timestamp, - but to be sure, we only accept timestamps that are just a few - seconds off (one second for each time they cycled the channel). */ + with exactly 3 parameters (because all modes have been reset). + If the timestamp on such channels is only a few seconds older + from our own, then we ignore this burst: we do not deop our + own side. + Likewise, we expect the other (empty) side to copy our timestamp + from our own BURST message, even though it is slightly larger. + + The reason for this is to allow people to join an empty + non-A channel (a zannel) during a net.split, and not be + deopped when the net reconnects (with another zannel). When + someone joins a split zannel, their side increments the TS by one. + If they cycle a few times then we still don't have a reason to + deop them. Theoretically I see no reason not to accept ANY timestamp, + but to be sure, we only accept timestamps that are just a few + seconds off (one second for each time they cycled the channel). */ /* Don't even deop users who cycled four times during the net.break. */ if (timestamp < chptr->creationtime && chptr->creationtime <= timestamp + 4 && - chptr->users != 0) /* Only do this when WE have users, so that - if we do this the BURST that we sent has - parc > 3 and the other side will use the - test below: */ - timestamp = chptr->creationtime; /* Do not deop our side. */ + chptr->users != 0) /* Only do this when WE have users, so that + if we do this the BURST that we sent has + parc > 3 and the other side will use the + test below: */ + timestamp = chptr->creationtime; /* Do not deop our side. */ } else if (chptr->creationtime < timestamp && timestamp <= chptr->creationtime + 4 && - chptr->users == 0) + chptr->users == 0) { /* If one side of the net.junction does the above timestamp = chptr->creationtime, then the other - side must do this: */ - chptr->creationtime = timestamp; /* Use the same TS on both sides. */ + side must do this: */ + chptr->creationtime = timestamp; /* Use the same TS on both sides. */ } /* In more complex cases, we might still end up with a creationtime desync of a few seconds, but that should @@ -490,7 +486,7 @@ current_mode = (current_mode & ~CHFL_DELAYED) | CHFL_CHANOP; do { level_increment = 10 * level_increment + *ptr++ - '0'; - } while(IsDigit(*ptr)); + } while (IsDigit(*ptr)); oplevel += level_increment; } #else @@ -651,7 +647,6 @@ /* remove ban from channel */ if (lp->flags & (BAN_OVERLAPPED | BAN_BURST_WIPEOUT)) { char *bandup; - DupString(bandup, lp->banstr); modebuf_mode_string(mbuf, MODE_DEL | MODE_BAN, bandup, 1); Index: ircd-ircdev/ircd/m_cap.c diff -u ircd-ircdev/ircd/m_cap.c:1.6 ircd-ircdev/ircd/m_cap.c:1.7 --- ircd-ircdev/ircd/m_cap.c:1.6 Thu Apr 26 12:17:31 2007 +++ ircd-ircdev/ircd/m_cap.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Capability negotiation commands - * @version $Id: m_cap.c,v 1.6 2007/04/26 19:17:31 zolty Exp $ + * @version $Id: m_cap.c,v 1.7 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -47,7 +47,7 @@ struct capabilities { enum Capab cap; /**< Capability identifier. */ char *capstr; /**< Capability id string. */ - unsigned long flags; /**< Bitset of CAPFL_* flags. */ + unsigned long flags; /**< Bitset of CAPFL_* flags. */ char *name; /**< Long capability name. */ int namelen; /**< Length of capability name string. */ }; @@ -228,7 +228,6 @@ { if (IsUnknown(sptr)) /* registration hasn't completed; suspend it... */ auth_cap_start(cli_auth(sptr)); - return send_caplist(sptr, 0, 0, "LS"); /* send list of capabilities */ } Index: ircd-ircdev/ircd/m_clearmode.c diff -u ircd-ircdev/ircd/m_clearmode.c:1.13 ircd-ircdev/ircd/m_clearmode.c:1.14 --- ircd-ircdev/ircd/m_clearmode.c:1.13 Sat Apr 21 14:17:23 2007 +++ ircd-ircdev/ircd/m_clearmode.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for CLEARMODE command. - * @version $Id: m_clearmode.c,v 1.13 2007/04/21 21:17:23 zolty Exp $ + * @version $Id: m_clearmode.c,v 1.14 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -122,7 +122,6 @@ if (del_mode & MODE_BAN) { for (link = chptr->banlist; link; link = next) { char *bandup; - next = link->next; DupString(bandup, link->banstr); @@ -190,7 +189,7 @@ } /** Handle a CLEARMODE message from a server. - * + * * \a parv has the following elements: * \li \a parv[1] is the channel to affect * \li \a parv[2] is the channel modes to clear Index: ircd-ircdev/ircd/m_connect.c diff -u ircd-ircdev/ircd/m_connect.c:1.9 ircd-ircdev/ircd/m_connect.c:1.10 --- ircd-ircdev/ircd/m_connect.c:1.9 Sat Apr 21 14:17:23 2007 +++ ircd-ircdev/ircd/m_connect.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for CONNECT command. - * @version $Id: m_connect.c,v 1.9 2007/04/21 21:17:23 zolty Exp $ + * @version $Id: m_connect.c,v 1.10 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -170,7 +170,6 @@ * * See @ref m_functions for discussion of the arguments. * @param[in] cptr Client that sent us the message. - * @param[in] cptr Client that sent us the message. * @param[in] sptr Original source of message. * @param[in] parc Number of arguments. * @param[in] parv Argument vector. Index: ircd-ircdev/ircd/m_create.c diff -u ircd-ircdev/ircd/m_create.c:1.11 ircd-ircdev/ircd/m_create.c:1.12 --- ircd-ircdev/ircd/m_create.c:1.11 Sat Apr 21 14:17:23 2007 +++ ircd-ircdev/ircd/m_create.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for CREATE command. - * @version $Id: m_create.c,v 1.11 2007/04/21 21:17:23 zolty Exp $ + * @version $Id: m_create.c,v 1.12 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -121,33 +121,32 @@ /* Check if we need to bounce a mode */ if (TStime() - chanTS > TS_LAG_TIME || (chptr->creationtime && chanTS > chptr->creationtime && - /* Accept CREATE for zannels. This is only really necessary on a network - with servers prior to 2.10.12.02: we just accept their TS and ignore - the fact that it was a zannel. The influence of this on a network - that is completely 2.10.12.03 or higher is neglectable: Normally - a server only sends a CREATE after first sending a DESTRUCT. Thus, - by receiving a CREATE for a zannel one of three things happened: - 1. The DESTRUCT was sent during a net.break; this could mean that - our zannel is at the verge of expiring too, it should have been - destructed. It is correct to copy the newer TS now, all modes - already have been reset, so it will be as if it was destructed - and immediately recreated. In order to avoid desyncs of modes, - we don't accept a CREATE for channels that have +A set. - 2. The DESTRUCT passed, then someone created the channel on our - side and left it again. In this situation we have a near - simultaneous creation on two servers; the person on our side - already left within the time span of a message propagation. - already left within the time span of a message propagation. - The channel will therefore be less than 48 hours old and no - 'protection' is necessary. + /* Accept CREATE for zannels. This is only really necessary on a network + with servers prior to 2.10.12.02: we just accept their TS and ignore + the fact that it was a zannel. The influence of this on a network + that is completely 2.10.12.03 or higher is neglectable: Normally + a server only sends a CREATE after first sending a DESTRUCT. Thus, + by receiving a CREATE for a zannel one of three things happened: + 1. The DESTRUCT was sent during a net.break; this could mean that + our zannel is at the verge of expiring too, it should have been + destructed. It is correct to copy the newer TS now, all modes + already have been reset, so it will be as if it was destructed + and immediately recreated. In order to avoid desyncs of modes, + we don't accept a CREATE for channels that have +A set. + 2. The DESTRUCT passed, then someone created the channel on our + side and left it again. In this situation we have a near + simultaneous creation on two servers; the person on our side + already left within the time span of a message propagation. + The channel will therefore be less than 48 hours old and no + 'protection' is necessary. 3. The source server sent the CREATE while linking, before it got the BURST for our zannel. If this happens, we should reset the channel back to the old timestamp. This can be distinguished from case #1 by checking IsBurstOrBurstAck(cli_user(sptr)->server). - */ + */ #if defined(UNDERNET) - !(chptr->users == 0 && !chptr->mode.apass[0]))) { + !(chptr->users == 0 && !chptr->mode.apass[0]))) { #else !(chptr->users == 0))) { #endif Index: ircd-ircdev/ircd/m_defaults.c diff -u ircd-ircdev/ircd/m_defaults.c:1.6 ircd-ircdev/ircd/m_defaults.c:1.7 --- ircd-ircdev/ircd/m_defaults.c:1.6 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_defaults.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief - * @version $Id: m_defaults.c,v 1.6 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_defaults.c,v 1.7 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -38,6 +38,7 @@ /** Inform a client he is not opered. * \a parv is ignored. + * * See @ref m_functions for discussion of the arguments. * @param[in] cptr Client that sent us the message. * @param[in] sptr Original source of message. Index: ircd-ircdev/ircd/m_destruct.c diff -u ircd-ircdev/ircd/m_destruct.c:1.9 ircd-ircdev/ircd/m_destruct.c:1.10 --- ircd-ircdev/ircd/m_destruct.c:1.9 Sat Apr 21 14:17:23 2007 +++ ircd-ircdev/ircd/m_destruct.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for DESTRUCT command. - * @version $Id: m_destruct.c,v 1.9 2007/04/21 21:17:23 zolty Exp $ + * @version $Id: m_destruct.c,v 1.10 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -119,11 +119,11 @@ /* Don't pass on DESTRUCT messages for channels that are not empty, but instead send a BURST msg upstream. */ if (chptr->users > 0) { -#if 1 /* Once all servers are 2.10.12, this can be used too. +#if 0 /* Once all servers are 2.10.12, this can be used too. Until then we have to use CREATE and MODE to - get the message accross, because older server do - not accept a BURST outside the net.burst. */ - send_channel_modes(cptr, chptr); + get the message accross, because older server do + not accept a BURST outside the net.burst. */ + send_channel_modes(cptr, chptr); #else /* This happens when a JOIN and DESTRUCT crossed, ie: @@ -138,7 +138,7 @@ server1 ----------------- server2 DESTRUCT--> <-- DESTRUCT <-- CREATE - + in both cases, when the DESTRUCT arrives on server2 we need to send synchronizing messages upstream (to server1). Since sending two CREATEs Index: ircd-ircdev/ircd/m_endburst.c diff -u ircd-ircdev/ircd/m_endburst.c:1.8 ircd-ircdev/ircd/m_endburst.c:1.9 --- ircd-ircdev/ircd/m_endburst.c:1.8 Sat Apr 21 14:17:23 2007 +++ ircd-ircdev/ircd/m_endburst.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for END OF BURST command. - * @version $Id: m_endburst.c,v 1.8 2007/04/21 21:17:23 zolty Exp $ + * @version $Id: m_endburst.c,v 1.9 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -75,7 +75,6 @@ /* Count through channels... */ for (chan = GlobalChannelList; chan; chan = next_chan) { next_chan = chan->next; - if (!chan->members && (chan->mode.mode & MODE_BURSTADDED)) { /* Newly empty channel, schedule it for removal. */ chan->mode.mode &= ~MODE_BURSTADDED; Index: ircd-ircdev/ircd/m_invite.c diff -u ircd-ircdev/ircd/m_invite.c:1.18 ircd-ircdev/ircd/m_invite.c:1.19 --- ircd-ircdev/ircd/m_invite.c:1.18 Sat Apr 21 14:17:23 2007 +++ ircd-ircdev/ircd/m_invite.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for INVITE command. - * @version $Id: m_invite.c,v 1.18 2007/04/21 21:17:23 zolty Exp $ + * @version $Id: m_invite.c,v 1.19 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -132,7 +132,7 @@ } #if 0 -/* TODO-ZOLTAN COMPROBARLO */ +/* TODO-ZOLTAN: COMPROBARLO */ if (!IsLocalChannel(chptr->chname) || MyConnect(acptr)) { if (feature_bool(FEAT_ANNOUNCE_INVITES)) { /* Announce to channel operators. */ @@ -156,7 +156,7 @@ * \a parv has the following elements: * \li \a parv[1] is the nickname of the client to invite * \li \a parv[2] is the name of the channel to invite \a parv[1] to - * \li \a parv[3] (optional) is the channel's timestam + * \li \a parv[3] (optional) is the channel's timestamp * * - INVITE now is accepted only if who does it is chanop (this of course * implies that channel must exist and he must be on it). Index: ircd-ircdev/ircd/m_join.c diff -u ircd-ircdev/ircd/m_join.c:1.20 ircd-ircdev/ircd/m_join.c:1.21 --- ircd-ircdev/ircd/m_join.c:1.20 Sat Jul 21 16:51:39 2007 +++ ircd-ircdev/ircd/m_join.c Thu Sep 20 14:00:32 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for JOIN command. - * @version $Id: m_join.c,v 1.20 2007/07/21 23:51:39 zolty Exp $ + * @version $Id: m_join.c,v 1.21 2007/09/20 21:00:32 zolty Exp $ */ #include "config.h" @@ -122,6 +122,7 @@ chanlist = last0(cptr, sptr, parv[1]); /* find last "JOIN 0" */ keys = parv[2]; /* remember where keys are */ + for (name = ircd_strtok(&p, chanlist, ","); name; name = ircd_strtok(&p, 0, ",")) { char *key = 0; @@ -280,10 +281,10 @@ if (err) { switch(err) { case ERR_NEEDREGGEDNICK: - send_reply(sptr, - ERR_NEEDREGGEDNICK, - chptr->chname, - feature_str(F... [truncated message content] |