srvx-commits Mailing List for srvx IRC Services (Page 79)
Brought to you by:
entrope
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(80) |
Sep
(51) |
Oct
(94) |
Nov
(132) |
Dec
(85) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(163) |
Feb
(96) |
Mar
(70) |
Apr
(182) |
May
(173) |
Jun
(73) |
Jul
(101) |
Aug
(101) |
Sep
(71) |
Oct
(76) |
Nov
(58) |
Dec
(60) |
2003 |
Jan
(61) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(7) |
Jun
(22) |
Jul
(81) |
Aug
(41) |
Sep
(34) |
Oct
(41) |
Nov
(16) |
Dec
(28) |
2004 |
Jan
(7) |
Feb
|
Mar
(3) |
Apr
(15) |
May
(11) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2005 |
Jan
(13) |
Feb
(6) |
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2009 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
(2) |
Feb
(3) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2025 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Entrope <en...@us...> - 2001-10-20 22:27:39
|
Update of /cvsroot/srvx/services/src/srvx In directory usw-pr-cvs1:/tmp/cvs-serv4390/src/srvx Modified Files: compat.c Log Message: fix ANSI header file checks in compat.c Index: compat.c =================================================================== RCS file: /cvsroot/srvx/services/src/srvx/compat.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** compat.c 2001/10/20 18:47:05 1.1 --- compat.c 2001/10/20 22:27:36 1.2 *************** *** 6,12 **** #include "config.h" ! #ifdef HAVE_ERRNO_H ! # include <errno.h> ! #endif #ifdef TIME_WITH_SYS_TIME # include <sys/time.h> --- 6,14 ---- #include "config.h" ! #include <errno.h> ! #include <stddef.h> ! #include <string.h> ! #include <stdlib.h> ! #include <ctype.h> #ifdef TIME_WITH_SYS_TIME # include <sys/time.h> *************** *** 22,49 **** # include <sys/timeb.h> #endif - #ifdef HAVE_STDDEF_H - # include <stddef.h> - #else - # ifndef NULL - # define NULL ((void *)0) - # endif - #endif - #ifdef HAVE_STRING_H - # include <string.h> - #else - # ifdef HAVE_STRINGS_H - # include <strings.h> - # endif - #endif #ifdef HAVE_MEMORY_H # include <memory.h> - #endif - #if defined(HAVE_MALLOC_H) && !defined(HAVE_STDLIB_H) - # include <malloc.h> - #else - # include <stdlib.h> - #endif - #ifdef HAVE_CTYPE_H - # include <ctype.h> #endif --- 24,29 ---- |
From: Entrope <en...@us...> - 2001-10-20 22:25:23
|
Update of /cvsroot/srvx/services/src/utils In directory usw-pr-cvs1:/tmp/cvs-serv4025/src/utils Modified Files: Makefile.am Log Message: fix path for srvx core directory Index: Makefile.am =================================================================== RCS file: /cvsroot/srvx/services/src/utils/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Makefile.am 2001/10/20 18:47:05 1.1 --- Makefile.am 2001/10/20 22:25:20 1.2 *************** *** 3,5 **** EXTRA_PROGRAMS = checkdb ! checkdb_SOURCES = checkdb.c ../core/recdb.c ../core/recdb.h ../core/dict-hash.c ../core/dict.h ../core/log.h ../core/saxdb.c ../core/saxdb.h --- 3,5 ---- EXTRA_PROGRAMS = checkdb ! checkdb_SOURCES = checkdb.c ../srvx/recdb.c ../srvx/recdb.h ../srvx/dict-hash.c ../srvx/dict.h ../srvx/log.h ../srvx/saxdb.c ../srvx/saxdb.h |
From: Miles P. <pet...@us...> - 2001-10-20 20:57:30
|
Update of /cvsroot/srvx/services In directory usw-pr-cvs1:/tmp/cvs-serv14815 Modified Files: configure.ac Log Message: check for ctype.h (compat.c uses it for tolower()) Index: configure.ac =================================================================== RCS file: /cvsroot/srvx/services/configure.ac,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** configure.ac 2001/10/20 18:47:06 1.15 --- configure.ac 2001/10/20 20:57:26 1.16 *************** *** 86,90 **** dnl Would rather not bail on headers, BSD has alot of the functions elsewhere. -Jedi ! AC_CHECK_HEADERS(arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h pthread.h sys/resource.h sys/timeb.h sys/times.h sys/select.h sys/param.h sys/poll.h sys/socket.h sys/time.h sys/types.h unistd.h getopt.h memory.h regex.h alloca.h dlfcn.h libintl.h,,) dnl portability stuff, hurray! -Jedi --- 86,90 ---- dnl Would rather not bail on headers, BSD has alot of the functions elsewhere. -Jedi ! AC_CHECK_HEADERS(arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h pthread.h sys/resource.h sys/timeb.h sys/times.h sys/select.h sys/param.h sys/poll.h sys/socket.h sys/time.h sys/types.h unistd.h getopt.h memory.h regex.h alloca.h dlfcn.h libintl.h ctype.h,,) dnl portability stuff, hurray! -Jedi |
From: Entrope <en...@us...> - 2001-10-20 19:23:15
|
Update of /cvsroot/srvx/services/src/modules In directory usw-pr-cvs1:/tmp/cvs-serv26126/src/modules Modified Files: authserv.h authserv.c Log Message: implement delmask temporarily kludge to compile Index: authserv.h =================================================================== RCS file: /cvsroot/srvx/services/src/modules/authserv.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** authserv.h 2001/10/20 18:47:05 1.1 --- authserv.h 2001/10/20 19:23:12 1.2 *************** *** 72,75 **** --- 72,76 ---- struct handle_info *smart_get_handle_info(struct user *bot, struct user *source, const unsigned char *name); int authserv_addmask(struct user *user, struct user *bot, struct handle_info *hi, const char *mask); + int authserv_delmask(struct user *source, struct user *bot, struct handle_info *hi, const char *del_mask); /* auth_funcs are called when a user gets a new handle_info. They are Index: authserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/modules/authserv.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** authserv.c 2001/10/20 18:47:05 1.1 --- authserv.c 2001/10/20 19:23:12 1.2 *************** *** 60,63 **** --- 60,73 ---- } cfg; + #define NEED_CHANNEL() do { if (!channel) { \ + send_message(source, bot, MSG_INVALID_CHANNEL); \ + return; } } while (0) + #define MIN_PARMS(N, NEEDCHAN) do { \ + if (argc < N) { \ + send_message(source, bot, MSG_MISSING_PARAMS, argv[0]); \ + return; } \ + if (NEEDCHAN) NEED_CHANNEL(); } \ + while (0) + /********************/ /* INTERNAL HELPERS */ *************** *** 284,287 **** --- 294,320 ---- } + int + authserv_delmask(struct user *source, struct user *bot, struct handle_info *hi, const char *del_mask) + { + unsigned int i; + + for (i=0; i<hi->masks->used; i++) { + if (!strcmp(del_mask, hi->masks->list[i])) { + char *old_mask = hi->masks->list[i]; + if (hi->masks->used == 1) { + send_message(source, bot, N_("You may not delete your last hostmask.")); + return 0; + } + hi->masks->list[i] = hi->masks->list[--hi->masks->used]; + send_message(source, bot, N_("Hostmask %s deleted."), old_mask); + log(NS_LOG, LOG_OTHER, N_("'%s' deleted mask '%s' from handle '%s'.\n"), source->nick, old_mask, hi->handle); + free(old_mask); + return 1; + } + } + send_message(source, bot, N_("Unable to find mask to be deleted.")); + return 0; + } + /*******************/ /* MODULE COMMANDS */ *************** *** 355,362 **** (void)channel; ! if (argc < 3) { ! send_message(source, bot, MSG_MISSING_PARAMS, argv[0]); ! return; ! } if (!(target = GetUser(argv[1]))) { send_message(source, bot, MSG_NICK_UNKNOWN, argv[1]); --- 388,392 ---- (void)channel; ! MIN_PARMS(3, 0); if (!(target = GetUser(argv[1]))) { send_message(source, bot, MSG_NICK_UNKNOWN, argv[1]); *************** *** 389,394 **** MODULE_COMMAND(cmd_delmask) { ! (void)source; (void)bot; (void)channel; (void)argc; (void)argv; ! /* TODO: implement cmd_delmask */ } --- 419,425 ---- MODULE_COMMAND(cmd_delmask) { ! (void)channel; ! MIN_PARMS(2, 0); ! authserv_delmask(source, bot, source->handle_info, argv[1]); } *************** *** 583,586 **** --- 614,619 ---- module_define_command(authserv_module, cmds+ii); } + /* TODO: remove when okay */ (void)authserv_apply_flags; + /* TODO: remove when okay */ (void)authserv_set_flag_level; /* TODO: finish authserv's mod_init */ return 0; |
From: Entrope <en...@us...> - 2001-10-20 18:54:25
|
I'm not going to approve the 270 KB message that is just files getting moved around, so you'll have to "cvs update" to see the fun for yourself. -- Entrope |
From: Entrope <en...@us...> - 2001-10-20 18:51:35
|
Update of /cvsroot/srvx/services/src/srvx In directory usw-pr-cvs1:/tmp/cvs-serv19729/src/srvx Removed Files: gline.db sockcheck.db Log Message: remove two files accidentally committed --- gline.db DELETED --- --- sockcheck.db DELETED --- |
From: Entrope <en...@us...> - 2001-10-20 18:47:09
|
Update of /cvsroot/srvx/services In directory usw-pr-cvs1:/tmp/cvs-serv18865 Modified Files: configure.ac autogen.sh Log Message: rearrange files in src/ so they go into one of three subdirectories (srvx/, modules/, utils/) Index: configure.ac =================================================================== RCS file: /cvsroot/srvx/services/configure.ac,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** configure.ac 2001/10/10 19:11:02 1.14 --- configure.ac 2001/10/20 18:47:06 1.15 *************** *** 7,13 **** AC_INIT([srvx],[1.1.0]) AC_REVISION([$Id$]) ! AC_CONFIG_SRCDIR(src/main.c) AC_CANONICAL_TARGET() ! AM_CONFIG_HEADER(src/config.h) AM_INIT_AUTOMAKE(srvx, 1.1.0) --- 7,13 ---- AC_INIT([srvx],[1.1.0]) AC_REVISION([$Id$]) ! AC_CONFIG_SRCDIR(src/srvx/main.c) AC_CANONICAL_TARGET() ! AM_CONFIG_HEADER(src/srvx/config.h) AM_INIT_AUTOMAKE(srvx, 1.1.0) *************** *** 233,236 **** AC_SUBST(export_dynamic_flag_spec) ! AC_CONFIG_FILES([po/Makefile.in po/Makefile intl/Makefile docs/Makefile src/Makefile Makefile]) AC_OUTPUT --- 233,236 ---- AC_SUBST(export_dynamic_flag_spec) ! AC_CONFIG_FILES([po/Makefile.in po/Makefile intl/Makefile docs/Makefile src/Makefile src/srvx/Makefile src/modules/Makefile src/utils/Makefile Makefile]) AC_OUTPUT Index: autogen.sh =================================================================== RCS file: /cvsroot/srvx/services/autogen.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** autogen.sh 2001/09/27 21:58:08 1.6 --- autogen.sh 2001/10/20 18:47:06 1.7 *************** *** 3,6 **** aclocal autoheader -Wall ! automake -a --gnu Makefile src/Makefile docs/Makefile autoconf -Wall --- 3,6 ---- aclocal autoheader -Wall ! automake -a --gnu Makefile src/Makefile src/srvx/Makefile src/modules/Makefile src/utils/Makefile docs/Makefile autoconf -Wall |
From: Entrope <en...@us...> - 2001-10-20 18:47:09
|
Update of /cvsroot/srvx/services/po In directory usw-pr-cvs1:/tmp/cvs-serv18865/po Modified Files: POTFILES.in Log Message: rearrange files in src/ so they go into one of three subdirectories (srvx/, modules/, utils/) Index: POTFILES.in =================================================================== RCS file: /cvsroot/srvx/services/po/POTFILES.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** POTFILES.in 2001/09/26 02:34:25 1.1 --- POTFILES.in 2001/10/20 18:47:06 1.2 *************** *** 2,23 **** # Copyright 2001 srvx Development Team # Files with mostly error or logging messages ! src/compat.c ! src/conf.c ! src/getopt.c ! src/gline.c ! src/hash.c ! src/main.c ! src/modules.c ! src/proto_bahamut.c ! src/proto_ircu_p10.c ! src/recdb.c ! src/saxdb.c ! src/service.c ! src/sockcheck.c ! src/uplink.c # Files with user-visible messages (in addition to logging or error messages) ! src/log.c ! src/mod_common.c ! src/rules.c ! src/tools.c src/messages.h --- 2,25 ---- # Copyright 2001 srvx Development Team # Files with mostly error or logging messages ! src/srvx/compat.c ! src/srvx/conf.c ! src/srvx/getopt.c ! src/srvx/gline.c ! src/srvx/hash.c ! src/srvx/main.c ! src/srvx/modules.c ! src/srvx/recdb.c ! src/srvx/saxdb.c ! src/srvx/service.c ! src/srvx/sockcheck.c ! src/srvx/uplink.c # Files with user-visible messages (in addition to logging or error messages) ! src/srvx/log.c ! src/srvx/rules.c ! src/srvx/tools.c src/messages.h + # Files in modules + src/modules/proto_bahamut.c + src/modules/proto_ircu_p10.c + src/modules/mod_common.c + src/modules/authserv.c |
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv18865/src Modified Files: Makefile.am Removed Files: uplink.h uplink.c tools.h tools.c timeq.h timeq.c sockcheck.h sockcheck.c service.h service.c saxdb.h saxdb.c rules.h rules.c recdb.h recdb.c proto_ircu_p10.c proto_bahamut.c proto.h proto.def proto.c policer.h policer.c modules.h modules.c mod_common.h mod_common.c messages.h md5.c main.c log.h log.c heap.h heap.c hash.h hash.c gline.h gline.c getopt1.c getopt.h getopt.c dict.h dict-splay.c dict-hash.c config.h.in conf.h conf.c compat.h compat.c common.h checkdb.c authserv.h authserv.c Log Message: rearrange files in src/ so they go into one of three subdirectories (srvx/, modules/, utils/) Index: Makefile.am =================================================================== RCS file: /cvsroot/srvx/services/src/Makefile.am,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -r1.44 -r1.45 *** Makefile.am 2001/10/15 14:32:58 1.44 --- Makefile.am 2001/10/20 18:47:06 1.45 *************** *** 1,57 **** ! LIBS = @INTLLIBS@ @LIBS@ ! AM_CFLAGS = -DPKGLIBDIR="\"$(pkglibdir)\"" -rdynamic ! ! bin_PROGRAMS = srvx ! lib_LTLIBRARIES = libmod_common.la \ ! libauthserv.la \ ! libproto_bahamut.la libproto_ircu_p10.la ! EXTRA_PROGRAMS = checkdb pwcracker ! ! srvx_LDFLAGS = $(export_dynamic_flag_spec) ! srvx_SOURCES = \ ! compat.c compat.h \ ! conf.c conf.h \ ! dict-splay.c dict.h \ ! getopt.c getopt.h \ ! getopt1.c getopt.h \ ! gline.c gline.h \ ! hash.c hash.h \ ! heap.c heap.h \ ! log.c log.h \ ! main.c messages.h common.h \ ! md5.c \ ! modules.c modules.h \ ! policer.c policer.h \ ! proto.c proto.h proto.def \ ! recdb.c recdb.h \ ! rules.c rules.h \ ! saxdb.c saxdb.h \ ! service.c service.h \ ! sockcheck.c sockcheck.h \ ! timeq.c timeq.h \ ! tools.c tools.h \ ! uplink.c uplink.h ! ! libauthserv_la_SOURCES = \ ! authserv.c authserv.h ! ! libmod_common_la_SOURCES = \ ! mod_common.c mod_common.h ! ! libproto_bahamut_la_SOURCES = \ ! proto_bahamut.c ! ! libproto_ircu_p10_la_SOURCES = \ ! proto_ircu_p10.c ! ! checkdb_SOURCES = checkdb.c recdb.c recdb.h dict-hash.c dict.h log.h saxdb.c saxdb.h ! pwcracker_SOURCES = pwcracker.c recdb.c recdb.h dict-splay.c dict.h log.h md5.c ! ! LINT = lclint ! LINTOPTS = +showscan +posixlib -boolops -predboolint -noeffect ! LINT_FILES = compat.c conf.c getopt.c getopt1.c gline.c hash.c heap.c log.c main.c md5.c modules.c policer.c proto.c recdb.c rules.c saxdb.c service.c timeq.c ! LINT_FILES += dict-splay.c # or dict-hash.c ! LINT_FILES += proto_bahamut.c # or proto_ircu_p10.c ! LINT_FILES += mod_common.c authserv.c ! lint: $(LINT_FILES) ! $(LINT) $(LINTOPTS) $^ --- 1 ---- ! SUBDIRS = srvx modules utils --- uplink.h DELETED --- --- uplink.c DELETED --- --- tools.h DELETED --- --- tools.c DELETED --- --- timeq.h DELETED --- --- timeq.c DELETED --- --- sockcheck.h DELETED --- --- sockcheck.c DELETED --- --- service.h DELETED --- --- service.c DELETED --- --- saxdb.h DELETED --- --- saxdb.c DELETED --- --- rules.h DELETED --- --- rules.c DELETED --- --- recdb.h DELETED --- --- recdb.c DELETED --- --- proto_ircu_p10.c DELETED --- --- proto_bahamut.c DELETED --- --- proto.h DELETED --- --- proto.def DELETED --- --- proto.c DELETED --- --- policer.h DELETED --- --- policer.c DELETED --- --- modules.h DELETED --- --- modules.c DELETED --- --- mod_common.h DELETED --- --- mod_common.c DELETED --- --- messages.h DELETED --- --- md5.c DELETED --- --- main.c DELETED --- --- log.h DELETED --- --- log.c DELETED --- --- heap.h DELETED --- --- heap.c DELETED --- --- hash.h DELETED --- --- hash.c DELETED --- --- gline.h DELETED --- --- gline.c DELETED --- --- getopt1.c DELETED --- --- getopt.h DELETED --- --- getopt.c DELETED --- --- dict.h DELETED --- --- dict-splay.c DELETED --- --- dict-hash.c DELETED --- --- config.h.in DELETED --- --- conf.h DELETED --- --- conf.c DELETED --- --- compat.h DELETED --- --- compat.c DELETED --- --- common.h DELETED --- --- checkdb.c DELETED --- --- authserv.h DELETED --- --- authserv.c DELETED --- |
From: Entrope <en...@us...> - 2001-10-20 18:47:08
|
Update of /cvsroot/srvx/services/src/modules In directory usw-pr-cvs1:/tmp/cvs-serv18865/src/modules Added Files: proto_ircu_p10.c proto_bahamut.c mod_common.h mod_common.c authserv.h authserv.c Makefile.am Log Message: rearrange files in src/ so they go into one of three subdirectories (srvx/, modules/, utils/) --- NEW FILE --- /* proto_ircu_p10.c - ircu2 P10 protocol handling * Copyright 2000-2001 srvx Development Team * * 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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" [...1838 lines suppressed...] old = *j; *j = 0; if (IsChannelName(target_list)) { struct channel *chan = GetChannel(target_list); if (chan) { if (cf) cf(chan, data); } else { if (nc) nc(target_list, data); } } else { struct user *user = GetUserN(target_list); if (user) { if (uf) uf(user, data); } else { if (nu) nu(target_list, data); } } target_list = j+1; } while (old == ','); } --- NEW FILE --- /* proto_bahamut.c - Bahamut protocol handling * Copyright 2001 srvx Development Team * * 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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" [...1494 lines suppressed...] old = *j; *j = 0; if (IsChannelName(target_list)) { struct channel *chan = GetChannel(target_list); if (chan) { if (cf) cf(chan, data); } else { if (nc) nc(target_list, data); } } else { struct user *user = GetUser(target_list); if (user) { if (uf) uf(user, data); } else { if (nu) nu(target_list, data); } } target_list = j+1; } while (old == ','); } --- NEW FILE --- /* mod_common.h - Common service commands * Copyright 2001 srvx Development Team * * 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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if !defined(COMMON_H) #define COMMON_H #include "dict.h" #include "modules.h" #define COMMON_MAJOR 0 #define COMMON_MINOR 0 #define COMMON_REVISION 0 #define COMMON_VERSION MAKE_VERSION(COMMON_MAJOR, COMMON_MINOR, COMMON_REVISION) struct service_common { dict_t help; /* help index */ }; #endif --- NEW FILE --- /* mod_common.c - Common service commands * Copyright 2001 srvx Development Team * * 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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include <stdlib.h> #include "authserv.h" #include "hash.h" #include "messages.h" #include "proto.h" #include "recdb.h" #include "service.h" #include "tools.h" #include "mod_common.h" static struct module *mod_common_module; /* Basic approach for help files: * * Each module's "raw" help file contains a set of help topics, which * correspond to one command exported by the module. Each of these * topics contains sub-topics, including a default topic (usually * covering the command itself). For each command bound to the * service template, look up the appropriate module's raw help entry, * and prefix the contents of that topic with the bound command name. * For instance, the following might be in mod_authserv_admin.help: * "oset" { * "" "This command lets opers set stuff."; * "options" "blah blah blah"; * }; * If "oset" were bound to "oper-set" in the service template, it * would result in the following help bindings: * "oper-set" "This command lets opers set stuff."; * "oper-set options" "blah blah blah"; * * There are also "miscellaneous" help entries, like "help nemesis". * These are read first and thus get the highest priority. */ static void common_readhelp(struct user *bot, struct user *user) { /* TODO: implement common_readhelp */ (void)bot; (void)user; } /*******************/ /* MODULE COMMANDS */ /*******************/ static MODULE_COMMAND(cmd_help) { const char *topic, *data; struct service_common *sc; (void)channel; sc = NULL; if (!sc->help) { send_message(source, bot, N_("Helpfile missing.")); return; } if (argc < 2) { topic = "<index>"; } else { unsplit_string(argv+1, argc-1); topic = argv[1]; } if (!(data = dict_find(sc->help, topic, NULL))) { send_message(source, bot, N_("No help on that topic.")); return; } send_message(source, bot, "%s", data); } static MODULE_COMMAND(cmd_readhelp) { struct timeval start, stop; (void)channel; (void)argc; (void)argv; gettimeofday(&start, NULL); common_readhelp(bot, source); gettimeofday(&stop, NULL); stop.tv_sec -= start.tv_sec; stop.tv_usec -= start.tv_usec; if (stop.tv_usec < 0) { stop.tv_sec -= 1; stop.tv_usec += 1000000; } send_message(source, bot, N_("Loaded help files for $b%s$b in "FMT_TIME_T".%06lu seconds."), bot->nick, stop.tv_sec, stop.tv_usec); } static MODULE_COMMAND(cmd_timecmd) { struct timeval start, stop; unsplit_string(argv+1, argc-1); gettimeofday(&start, NULL); service_chanmsg(bot, source, channel, argv[1]); gettimeofday(&stop, NULL); stop.tv_sec -= start.tv_sec; stop.tv_usec -= start.tv_usec; if (stop.tv_usec < 0) { stop.tv_sec -= 1; stop.tv_usec += 1000000; } send_message(source, bot, N_("Command $b%s$b finished in "FMT_TIME_T".%06lu seconds."), argv[1], stop.tv_sec, stop.tv_usec); } static MODULE_COMMAND(cmd_write) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_write */ } static struct module_dependency hash_dependency = { "hash", MAKE_VERSION(HASH_MAJOR, HASH_MINOR, 0), MAKE_VERSION(HASH_MAJOR, -1, -1) }; static struct module_command cmds[] = { { "help", 0, NULL, cmd_help, NULL }, { "readhelp", 1 << REQUIRE_AUTHED, NULL, cmd_readhelp, "(umode +o)" }, { "timecmd", 1 << REQUIRE_AUTHED, NULL, cmd_timecmd, "(umode +o)" }, { "write", 1 << REQUIRE_AUTHED, NULL, cmd_write, "(umode +o)" }, { NULL, 0, 0, NULL, NULL } }; LIB_LOAD_FUNC(mod_init) { struct module_deplist deps; unsigned int nn; /* Register module */ module_deplist_init(&deps); module_deplist_append(&deps, &hash_dependency); mod_common_module = module_register("mod_common", COMMON_VERSION, &deps, lib); if (!mod_common_module) return 1; /* Register commands */ for (nn=0; cmds[nn].name; nn++) { module_define_command(mod_common_module, cmds+nn); } /* Success! */ return 0; } --- NEW FILE --- /* authserv.h - Authentication service * Copyright 2001 srvx Development Team * * 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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if !defined(AUTHSERV_H) #define AUTHSERV_H #include <sys/types.h> #include "common.h" #define AUTHSERV_MAJOR 0 #define AUTHSERV_MINOR 0 #define AUTHSERV_REVISION 0 #define AUTHSERV_VERSION MAKE_VERSION(AUTHSERV_MAJOR, AUTHSERV_MINOR, AUTHSERV_REVISION) /* HI_FLAG_* go into handle_info.flags */ #define HI_FLAG_OPER_SUSPENDED 0x00000001 #define HI_FLAG_USE_PRIVMSG 0x00000002 #define HI_FLAG_HELPER 0x00000004 #define HI_FLAG_HELPING 0x00000008 #define HI_FLAG_SUSPENDED 0x00000010 #define HI_FLAG_MIRC_COLOR 0x00000020 #define HI_FLAG_FROZEN 0x00000040 #define HI_FLAG_NODELETE 0x00000080 /* Flag characters for the above. First char is LSB, etc. */ #define HANDLE_FLAGS "Sphgscfn" /* HI_STYLE_* go into handle_info.userlist_style */ #define HI_STYLE_DEF 'd' #define HI_STYLE_ZOOT 'Z' #define HI_DEFAULT_FLAGS HI_FLAG_MIRC_COLOR #define HI_DEFAULT_STYLE HI_STYLE_DEF #define HANDLE_FLAGGED(hi, tok) ((hi)->flags & HI_FLAG_##tok) #define HANDLE_SET_FLAG(hi, tok) ((hi)->flags |= HI_FLAG_##tok) #define HANDLE_TOGGLE_FLAG(hi, tok) ((hi)->flags ^= HI_FLAG_##tok) #define HANDLE_CLEAR_FLAG(hi, tok) ((hi)->flags &= ~HI_FLAG_##tok) #define IsHelping(user) (user->handle_info && HANDLE_FLAGGED(user->handle_info, HELPING)) struct handle_info { struct nick_info *nicks; /* linked list of owned nicks */ struct string_list *masks; struct user *users; struct chanList *channels; unsigned long flags; unsigned int opserv_level; unsigned int screen_width; time_t registered, lastseen; char handle[31]; char passwd[MD5_CRYPT_LENGTH+1]; char info[MAXLEN]; char userlist_style; }; struct handle_info *get_handle_info(const char *handle); struct handle_info *smart_get_handle_info(struct user *bot, struct user *source, const unsigned char *name); int authserv_addmask(struct user *user, struct user *bot, struct handle_info *hi, const char *mask); /* auth_funcs are called when a user gets a new handle_info. They are * called after it has been determined that the user may authenticate * under the new handle, but *before* their handle_info is changed -- * so user->handle_info still points to their previous handle (if they * were previously authenticated). */ typedef void (*auth_func_t)(struct user *user, struct handle_info *new_handle); void reg_auth_func(auth_func_t func); /* unreg_funcs are called right before a handle is unregistered. * `user' is the person who caused the handle to be unregistered (either a * client authed to the handle, or an oper). */ typedef void (*unreg_func_t)(struct user *user, struct handle_info *handle); void reg_unreg_func(unreg_func_t func); #endif --- NEW FILE --- /* authserv.c - Authentication service * Copyright 2001 srvx Development Team * * 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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include <assert.h> #include <ctype.h> #include <stdlib.h> #include "dict.h" #include "hash.h" #include "log.h" #include "messages.h" #include "modules.h" #include "proto.h" #include "recdb.h" #include "rules.h" #include "tools.h" #include "authserv.h" #define MODMSG_PASSWORD_INVALID "Incorrect password; please try again." /********************/ /* STATIC VARIABLES */ /********************/ /* "Other" variables */ static struct module *authserv_module; static dict_t handle_dict; /* contains struct handle_info* */ static dict_t allow_auth_dict; /* contains struct handle_info* */ /* static dict_t authserv_opt_dict; * contains option_func_t*/ static const unsigned char *handle_flags = HANDLE_FLAGS; static unsigned char handle_inverse_flags[256]; static unsigned int flag_access_levels[32]; /* Callback lists */ static auth_func_t *auth_func_list; static unsigned int auth_func_used, auth_func_size; static unreg_func_t *unreg_func_list; static unsigned int unreg_func_used, unreg_func_size; /* Configuration */ static struct { dict_t weak_password_dict; unsigned int password_min_length, password_min_lower, password_min_upper, password_min_other; } cfg; /********************/ /* INTERNAL HELPERS */ /********************/ static char * canonicalize_hostmask(char *mask) { char *out = mask, *temp; if ((temp = strchr(mask, '!'))) { temp++; while (*temp) *out++ = *temp++; *out++ = 0; } return mask; } static int authserv_apply_flags(struct user *bot, struct user *source, struct handle_info *hi, const unsigned char *flags) { unsigned int n, add = 1, pos; for (n=0; flags[n]; n++) { switch (flags[n]) { case '+': add = 1; break; case '-': add = 0; break; default: if (!(pos = handle_inverse_flags[flags[n]])) { send_message(source, bot, N_("$b%c$b is not a valid handle flag."), flags[n]); return 0; } if (source->handle_info->opserv_level < flag_access_levels[pos-1]) { /* cheesy avoidance of looking up the flag name.. */ send_message(source, bot, MSG_SETTING_PRIVILEGED, "That flag"); return 0; } if (add) hi->flags |= 1 << (pos - 1); else hi->flags &= ~(1 << (pos - 1)); break; } } return 1; } static int authserv_set_flag_level(const char *key, void *data, void *extra) { struct record_data *rd = data; int pos = handle_inverse_flags[(unsigned char)key[0]]; (void)extra; if (pos) { flag_access_levels[pos - 1] = strtoul(GET_RECORD_QSTRING(rd), NULL, 0); } return 0; } static int valid_user_for(struct user *user, struct handle_info *hi) { unsigned int i; int res = 0; if (hi->masks->used) { for (i=0; !res && i<hi->masks->used; i++) { /* Maybe it'd just be simpler to require the *! at the * start of the hostmask. For future thought, anyway. */ if (user_matches_glob(user, hi->masks->list[i], 0)) res = 1; } } else { /* if they have no masks, let them pass */ res = 1; } if (!res && (dict_find(allow_auth_dict, user->nick, NULL) == hi)) { res = 2; } return res; } static const unsigned char * is_insecure_password(const unsigned char *handle, const unsigned char *pass) { unsigned int i, len; unsigned int cnt_other = 0, cnt_upper = 0, cnt_lower = 0; len = strlen(pass); if (len < cfg.password_min_length) return N_("it is too short"); if (!strcasecmp(pass, handle)) return N_("it is the same as your handle"); dict_find(cfg.weak_password_dict, pass, &i); if (i) return N_("it is in the dictionary"); for (i=0; i<len; i++) { if (isupper(pass[i])) cnt_upper++; else if (islower(pass[i])) cnt_lower++; else cnt_other++; } if (cnt_lower < cfg.password_min_lower) return N_("it has too few lower-case letters"); if (cnt_upper < cfg.password_min_upper) return N_("it has too few upper-case letters"); if (cnt_other < cfg.password_min_other) return N_("it has too few non-letter characters"); return NULL; } static void set_user_handle_info(struct user *user, struct handle_info *hi) { unsigned int n; struct handle_info *old_info; if (user->handle_info) { struct user *other; /* remove from next_authed linked list */ if (user->handle_info->users == user) { user->handle_info->users = user->next_authed; } else { for (other = user->handle_info->users; other->next_authed != user; other = other->next_authed) ; other->next_authed = user->next_authed; } user->handle_info->lastseen = now; if (HANDLE_FLAGGED(user->handle_info, HELPER)) { userList_remove(&curr_helpers, user); } } old_info = user->handle_info; user->handle_info = hi; for (n=0; n<auth_func_used; n++) auth_func_list[n](user, old_info); if (hi) { user->next_authed = hi->users; hi->users = user; hi->lastseen = now; if (HANDLE_FLAGGED(hi, HELPER)) { userList_append(&curr_helpers, user); } } else { user->next_authed = NULL; } } /**********************/ /* EXPORTED FUNCTIONS */ /**********************/ void reg_auth_func(auth_func_t func) { if (auth_func_used == auth_func_size) { if (auth_func_list) { auth_func_size <<= 1; auth_func_list = realloc(auth_func_list, auth_func_size*sizeof(auth_func_list[0])); } else { auth_func_size = 8; auth_func_list = malloc(auth_func_size*sizeof(auth_func_list[0])); } assert(auth_func_list != NULL); } auth_func_list[auth_func_used++] = func; } void reg_unreg_func(unreg_func_t func) { if (unreg_func_used == unreg_func_size) { if (unreg_func_list) { unreg_func_size <<= 1; unreg_func_list = realloc(unreg_func_list, unreg_func_size*sizeof(unreg_func_list[0])); } else { unreg_func_size = 8; unreg_func_list = malloc(unreg_func_size*sizeof(unreg_func_list[0])); } assert(unreg_func_list != NULL); } unreg_func_list[unreg_func_used++] = func; } struct handle_info * get_handle_info(const char *handle) { return dict_find(handle_dict, handle, NULL); } struct handle_info * smart_get_handle_info(struct user *bot, struct user *source, const unsigned char *name) { struct handle_info *hi; struct user *target; switch (*name) { case '*': if (!(hi = get_handle_info(++name))) { send_message(source, bot, MSG_HANDLE_UNKNOWN, name); return 0; } return hi; default: if (!(target = GetUser(name))) { send_message(source, bot, MSG_NICK_UNKNOWN, name); return 0; } if (!(hi = target->handle_info)) { send_message(source, bot, MSG_USER_AUTHENTICATE, target->nick); return 0; } return hi; } } int authserv_addmask(struct user *source, struct user *bot, struct handle_info *hi, const char *mask) { unsigned int i; char *new_mask; new_mask = canonicalize_hostmask(strdup(mask)); for (i=0; i<hi->masks->used; i++) { if (!strcasecmp(new_mask, hi->masks->list[i])) { send_message(source, bot, N_("$b%s$b is already a hostmask in your handle."), new_mask); free(new_mask); return 0; } } string_list_append(hi->masks, new_mask); send_message(source, bot, N_("Hostmask $b%s$b added."), new_mask); log(NS_LOG, LOG_OTHER, "'%s' added new mask '%s' to handle '%s'.\n", source->nick, new_mask, hi->handle); return 1; } /*******************/ /* MODULE COMMANDS */ /*******************/ MODULE_COMMAND(cmd_auth) { const unsigned char *passwd, *reason; struct handle_info *hi; (void)channel; if (argc == 3) { hi = dict_find(handle_dict, argv[1], NULL); passwd = argv[2]; } else if (argc == 2) { hi = get_handle_info(source->nick); passwd = argv[1]; } else { send_message(source, bot, MSG_MISSING_PARAMS, argv[0]); return; } if (!hi) { send_message(source, bot, N_("Handle not found -- did you register yet?")); return; } if (!valid_user_for(source, hi)) { send_message(source, bot, N_("Your hostmask is not valid.")); log(NS_LOG, LOG_OTHER, N_(IDENT_FORMAT" did not have a matching host for handle '%s'.\n"), IDENT_DATA(source), hi->handle); return; } if (!checkpass(passwd, hi->passwd)) { send_message(source, bot, MODMSG_PASSWORD_INVALID); log(NS_LOG, LOG_OTHER, N_(IDENT_FORMAT" had the wrong password for handle '%s'.\n"), IDENT_DATA(source), hi->handle); return; } if (HANDLE_FLAGGED(hi, SUSPENDED)) { send_message(source, bot, N_("Your handle has been suspended, and cannot be used.")); log(NS_LOG, LOG_OTHER, N_(IDENT_FORMAT" tried to auth to suspended handle '%s'.\n"), IDENT_DATA(source), hi->handle); return; } if ((reason = is_insecure_password(hi->handle, passwd))) { send_message(source, bot, N_("WARNING: You are using a password that is considered weak (easy to guess): %s. It is STRONGLY recommended you change it using the $bPASS$b command."), reason); } dict_remove(allow_auth_dict, source->nick); HANDLE_CLEAR_FLAG(hi, FROZEN); set_user_handle_info(source, hi); send_message(source, bot, N_("I recognize you.")); log(NS_LOG, LOG_INFO, N_(IDENT_FORMAT" was authenticated to handle '%s'.\n"), IDENT_DATA(source), hi->handle); } MODULE_COMMAND(cmd_addmask) { (void)channel; if (argc < 2) { char *mask = generate_hostmask(source, GENMASK_OMITNICK); authserv_addmask(source, bot, source->handle_info, mask); free(mask); } else { if (is_gline(argv[1])) { authserv_addmask(source, bot, source->handle_info, argv[1]); } else { send_message(source, bot, N_("$b%s$b is an invalid hostmask."), argv[1]); } } } MODULE_COMMAND(cmd_allowauth) { struct user *target; struct handle_info *hi; (void)channel; if (argc < 3) { send_message(source, bot, MSG_MISSING_PARAMS, argv[0]); return; } if (!(target = GetUser(argv[1]))) { send_message(source, bot, MSG_NICK_UNKNOWN, argv[1]); return; } if (!strcasecmp(argv[2], "none")) hi = NULL; else if (!(hi = get_handle_info(argv[2]))) { send_message(source, bot, MSG_HANDLE_UNKNOWN, argv[2]); return; } if (hi) { if (hi->opserv_level > source->handle_info->opserv_level) { send_message(source, bot, MSG_USER_OUTRANKED, hi->handle); return; } dict_insert(allow_auth_dict, target->nick, hi); send_message(source, bot, N_("User $b%s$b may now authenticate to handle $b%s$b."), target->nick, hi->handle); send_message(target, bot, N_("You may now authenticate to handle $b%s$b by typing $b/msg $n auth %s password$b (using your password)."), hi->handle, hi->handle); log(NS_LOG, LOG_INFO, "%s allowed "IDENT_FORMAT" to authenticate to handle '%s'.\n", source->handle_info->handle, IDENT_DATA(target), hi->handle); } else { if (dict_remove(allow_auth_dict, target->nick)) { send_message(source, bot, N_("User $b%s$b may now only authenticate to handles with matching hostmasks."), target->nick); log(NS_LOG, LOG_INFO, "%s removed "IDENT_FORMAT"'s authorization to auth without hostmask.", source->handle_info->handle, IDENT_DATA(target)); } else { send_message(source, bot, N_("User $b%s$b did not have any special auth allowance."), target->nick); } } } MODULE_COMMAND(cmd_delmask) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_delmask */ } MODULE_COMMAND(cmd_handleinfo) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_handleinfo */ } MODULE_COMMAND(cmd_password) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_password */ } MODULE_COMMAND(cmd_register) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_register */ } MODULE_COMMAND(cmd_rename) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_rename */ } MODULE_COMMAND(cmd_set) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_set */ } MODULE_COMMAND(cmd_status) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_status */ } MODULE_COMMAND(cmd_unregister) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_unregister */ } MODULE_COMMAND(cmd_userinfo) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_userinfo */ } MODULE_COMMAND(cmd_vacation) { (void)source; (void)bot; (void)channel; (void)argc; (void)argv; /* TODO: implement cmd_vacation */ } /********************/ /* EXPRESSION RULES */ /********************/ EXPR_COMPILE_FUNCTION(rule_authed_comp) { (void)expr; (void)argc; (void)pexpr; /* TODO: implement rule_authed_comp */ return 0; } EXPR_EVAL_FUNCTION(rule_authed_eval) { (void)expr; (void)context; /* TODO: implement rule_authed_eval */ return 0; } EXPR_FREE_FUNCTION(rule_authed_free) { (void)expr; /* TODO: implement rule_authed_free */ } EXPR_COMPILE_FUNCTION(rule_flags_comp) { (void)expr; (void)argc; (void)pexpr; /* TODO: implement rule_flags_comp */ return 0; } EXPR_EVAL_FUNCTION(rule_flags_eval) { (void)expr; (void)context; /* TODO: implement rule_flags_eval */ return 0; } EXPR_FREE_FUNCTION(rule_flags_free) { (void)expr; /* TODO: implement rule_flags_free */ } EXPR_COMPILE_FUNCTION(rule_outranks_comp) { (void)expr; (void)argc; (void)pexpr; /* TODO: implement rule_outranks_comp */ return 0; } EXPR_EVAL_FUNCTION(rule_outranks_eval) { (void)expr; (void)context; /* TODO: implement rule_outranks_eval */ return 0; } EXPR_FREE_FUNCTION(rule_outranks_free) { (void)expr; /* TODO: implement rule_outranks_free */ } EXPR_COMPILE_FUNCTION(rule_oslvl_comp) { (void)expr; (void)argc; (void)pexpr; /* TODO: implement rule_oslvl_comp */ return 0; } EXPR_EVAL_FUNCTION(rule_oslvl_eval) { (void)expr; (void)context; /* TODO: implement rule_oslvl_eval */ return 0; } EXPR_FREE_FUNCTION(rule_oslvl_free) { (void)expr; /* TODO: implement rule_oslvl_free */ } static struct module_command cmds[] = { { "auth", 0, NULL, cmd_auth, NULL }, { "addmask", REQUIRE_AUTHED, NULL, cmd_addmask, NULL }, { "allowauth", 0, NULL, cmd_allowauth, "(umode +o)" }, { "delmask", REQUIRE_AUTHED, NULL, cmd_delmask, NULL }, { "handleinfo", 0, NULL, cmd_handleinfo, NULL }, { "pass", REQUIRE_AUTHED, NULL, cmd_password, NULL }, { "register", 0, NULL, cmd_register, NULL }, { "rename", 0, NULL, cmd_userinfo, "(umode +o)" }, { "set", REQUIRE_AUTHED, NULL, cmd_set, NULL }, { "status", 0, NULL, cmd_status, NULL }, { "unregister", REQUIRE_AUTHED, NULL, cmd_unregister, NULL }, { "userinfo", 0, NULL, cmd_userinfo, NULL }, { "vacation", REQUIRE_AUTHED, NULL, cmd_vacation, NULL }, { NULL, 0, NULL, NULL, NULL } }; static struct expression_operator rules[] = { { "authed", rule_authed_comp, rule_authed_eval, rule_authed_free }, { "flags", rule_flags_comp, rule_flags_eval, rule_flags_free }, { "opserv_level", rule_oslvl_comp, rule_oslvl_eval, rule_oslvl_free }, { "outranks", rule_outranks_comp, rule_outranks_eval, rule_outranks_free }, { NULL, NULL, NULL, NULL } }; LIB_LOAD_FUNC(mod_init) { static struct module_dependency hash_dep = { "hash", MAKE_VERSION(HASH_MAJOR, HASH_MINOR, 0), MAKE_VERSION(HASH_MAJOR, -1, -1) }; struct module_deplist deps; unsigned int ii; /* Register module and stuff */ module_deplist_init(&deps); module_deplist_append(&deps, &hash_dep); authserv_module = module_register("authserv", AUTHSERV_VERSION, &deps, lib); module_deplist_clean(&deps); if (!authserv_module) return 1; /* Set up static variables */ handle_dict = dict_new(); /* Figure out inverse mapping of handle flag bits */ for (ii=0; handle_flags[ii]; ii++) { handle_inverse_flags[handle_flags[ii]] = ii + 1; } /* Register expression rules */ for (ii=0; rules[ii].name; ii++) { expression_register_operator(rules+ii); } /* Register commands */ for (ii=0; cmds[ii].name; ii++) { module_define_command(authserv_module, cmds+ii); } /* TODO: finish authserv's mod_init */ return 0; } --- NEW FILE --- AM_CFLAGS = -I../srvx lib_LTLIBRARIES = libmod_common.la \ libauthserv.la \ libproto_bahamut.la libproto_ircu_p10.la libauthserv_la_SOURCES = \ authserv.c authserv.h libmod_common_la_SOURCES = \ mod_common.c mod_common.h libproto_bahamut_la_SOURCES = \ proto_bahamut.c libproto_ircu_p10_la_SOURCES = \ proto_ircu_p10.c |
From: Entrope <en...@us...> - 2001-10-20 18:47:08
|
Update of /cvsroot/srvx/services/src/utils In directory usw-pr-cvs1:/tmp/cvs-serv18865/src/utils Added Files: checkdb.c Makefile.am Log Message: rearrange files in src/ so they go into one of three subdirectories (srvx/, modules/, utils/) --- NEW FILE --- #include "config.h" #include <ctype.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include "log.h" #include "recdb.h" #include "saxdb.h" #include "tools.h" int bad = 0; /* because saxdb needs struct string_buffer.. */ DEFINE_LIST(string_buffer, char); static long TypeLength(char type) { switch (type) { case 'y': return 365*24*60*60; case 'M': return 31*24*60*60; case 'w': return 7*24*60*60; case 'd': return 24*60*60; case 'h': return 60*60; case 'm': return 60; case 's': return 1; default: return 0; } } unsigned long ParseInterval(const unsigned char *interval) { unsigned long seconds = 0; int partial = 0; unsigned char c; /* process the string, resetting the count if we find a unit character */ while ((c = *interval++)) { if (isdigit(c)) { partial = partial*10 + c - '0'; } else { seconds += TypeLength(c) * partial; partial = 0; } } /* assume the last chunk is seconds (the normal case) */ return seconds + partial; } /* because recdb likes to log stuff.. */ void log(enum log_type lt, enum log_severity ls, char *format, ...) { va_list va; (void)lt; (void)ls; va_start(va, format); vfprintf(stderr, format, va); va_end(va); bad = 1; } int check_record(const char *key, void *data, void *extra) { struct record_data *rd = data; (void)extra; switch (rd->type) { case RECDB_INVALID: fprintf(stdout, "Invalid database record type for key %s\n", key); return 1; case RECDB_QSTRING: case RECDB_STRING_LIST: return 0; case RECDB_OBJECT: return dict_foreach(rd->d.object, check_record, NULL) ? 1 : 0; } return 0; } extern unsigned int lineno; int main(int argc, char *argv[]) { FILE *input; dict_t db; if (argc < 2) { fprintf(stderr, "%s usage: %s dbfile\n", argv[0], argv[0]); return 1; } #if 1 if (argv[1][0] == '-' && argv[1][1] == 0) { input = stdin; } else { input = fopen(argv[1], "r"); if (!input) { perror("fopen"); return 2; } } (void)db; bad = saxdb_read(input, saxdb_alloc()); #else (void)input; db = parse_database(argv[1]); if (dict_foreach(db, check_record, 0)) return 3; #endif if (bad) { fprintf(stdout, "Error %d seen on line %d.\n", bad, lineno); } else { fprintf(stdout, "Database checked okay.\n"); } return 0; } --- NEW FILE --- AM_CFLAGS = -I../srvx EXTRA_PROGRAMS = checkdb checkdb_SOURCES = checkdb.c ../core/recdb.c ../core/recdb.h ../core/dict-hash.c ../core/dict.h ../core/log.h ../core/saxdb.c ../core/saxdb.h |
From: Entrope <en...@us...> - 2001-10-20 18:25:59
|
Update of /cvsroot/srvx/services/src/srvx In directory usw-pr-cvs1:/tmp/cvs-serv15416/src/srvx Log Message: Directory /cvsroot/srvx/services/src/srvx added to the repository |
From: Entrope <en...@us...> - 2001-10-20 18:23:42
|
Update of /cvsroot/srvx/services/src/utils In directory usw-pr-cvs1:/tmp/cvs-serv14874/src/utils Log Message: Directory /cvsroot/srvx/services/src/utils added to the repository |
From: Entrope <en...@us...> - 2001-10-20 18:23:33
|
Update of /cvsroot/srvx/services/src/modules In directory usw-pr-cvs1:/tmp/cvs-serv14831/src/modules Log Message: Directory /cvsroot/srvx/services/src/modules added to the repository |
From: Entrope <en...@us...> - 2001-10-20 17:34:14
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv6274/src Modified Files: Tag: rel-1_0 nickserv.c Log Message: fix security tests for setting handle flags Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.138.2.47 retrieving revision 1.138.2.48 diff -C2 -r1.138.2.47 -r1.138.2.48 *** nickserv.c 2001/09/05 04:43:09 1.138.2.47 --- nickserv.c 2001/10/20 17:34:11 1.138.2.48 *************** *** 1217,1222 **** return 0; } ! if (((hi != user->handle_info) || !add) ! && (user->handle_info->opserv_level < flag_access_levels[pos-1])) { /* cheesy avoidance of looking up the flag name.. */ nickserv_notice(user, MSG_SETTING_PRIVILEGED, "That flag"); --- 1217,1221 ---- return 0; } ! if (user->handle_info->opserv_level < flag_access_levels[pos-1]) { /* cheesy avoidance of looking up the flag name.. */ nickserv_notice(user, MSG_SETTING_PRIVILEGED, "That flag"); |
From: Entrope <en...@us...> - 2001-10-20 02:24:23
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv12480/src Modified Files: proto_bahamut.c Log Message: complete a TODO item for bahamut protocol Index: proto_bahamut.c =================================================================== RCS file: /cvsroot/srvx/services/src/proto_bahamut.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** proto_bahamut.c 2001/10/15 14:35:16 1.20 --- proto_bahamut.c 2001/10/20 02:24:20 1.21 *************** *** 597,602 **** } ! /* TODO: we need callbacks when clients change nicks, so we can fix ! * their entry in their uplink's clients dict. */ static void --- 597,606 ---- } ! static void ! bahamut_nick_change(struct user *user, const char *new_nick) ! { ! dict_remove(SPROTO(user->uplink)->clients, user->nick); ! dict_insert(SPROTO(user->uplink)->clients, new_nick, user); ! } static void *************** *** 1438,1441 **** --- 1442,1446 ---- reg_del_server_func(bahamut_del_server); reg_new_user_func(bahamut_new_user); + reg_nick_change_func(bahamut_nick_change); reg_del_user_func(bahamut_del_user); reg_exit_func(free_parse_misc); |
From: Entrope <en...@us...> - 2001-10-20 02:14:21
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv10762/src Modified Files: rules.c rules.h Log Message: rename register_expression_operator() to expression_register_operator() check for duplicate/shadowing operator registrations Index: rules.c =================================================================== RCS file: /cvsroot/srvx/services/src/rules.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** rules.c 2001/10/13 23:51:33 1.4 --- rules.c 2001/10/20 02:14:18 1.5 *************** *** 15,20 **** * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ --- 15,18 ---- *************** *** 24,27 **** --- 22,26 ---- #include "dict.h" + #include "log.h" #include "rules.h" *************** *** 160,165 **** void ! register_expression_operator(struct expression_operator *oper) { dict_insert(expr_opers, oper->name, oper); } --- 159,168 ---- void ! expression_register_operator(struct expression_operator *oper) { + if (dict_find(expr_opers, oper->name, NULL)) { + log(MAIN_LOG, LOG_ERROR, "Attempted to register expression operator %s when one already existed\n", oper->name); + return; + } dict_insert(expr_opers, oper->name, oper); } *************** *** 270,274 **** op->eval = oper_or_eval; op->free_ = oper_subexpr_free; ! register_expression_operator(op); /* Register AND operator */ op = calloc(1, sizeof(*op)); --- 273,277 ---- op->eval = oper_or_eval; op->free_ = oper_subexpr_free; ! expression_register_operator(op); /* Register AND operator */ op = calloc(1, sizeof(*op)); *************** *** 277,281 **** op->eval = oper_and_eval; op->free_ = oper_subexpr_free; /* same as "or" */ ! register_expression_operator(op); /* Register NOT operator */ op = calloc(1, sizeof(*op)); --- 280,284 ---- op->eval = oper_and_eval; op->free_ = oper_subexpr_free; /* same as "or" */ ! expression_register_operator(op); /* Register NOT operator */ op = calloc(1, sizeof(*op)); *************** *** 284,288 **** op->eval = oper_not_eval; op->free_ = oper_subexpr_free; /* same as "or" */ ! register_expression_operator(op); /* Register TRUE operator */ op = calloc(1, sizeof(*op)); --- 287,291 ---- op->eval = oper_not_eval; op->free_ = oper_subexpr_free; /* same as "or" */ ! expression_register_operator(op); /* Register TRUE operator */ op = calloc(1, sizeof(*op)); *************** *** 291,295 **** op->eval = oper_true_eval; op->free_ = oper_constant_free; ! register_expression_operator(op); /* Register FALSE operator */ op = calloc(1, sizeof(*op)); --- 294,298 ---- op->eval = oper_true_eval; op->free_ = oper_constant_free; ! expression_register_operator(op); /* Register FALSE operator */ op = calloc(1, sizeof(*op)); *************** *** 298,301 **** op->eval = oper_false_eval; op->free_ = oper_constant_free; /* same as "true" */ ! register_expression_operator(op); } --- 301,304 ---- op->eval = oper_false_eval; op->free_ = oper_constant_free; /* same as "true" */ ! expression_register_operator(op); } Index: rules.h =================================================================== RCS file: /cvsroot/srvx/services/src/rules.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** rules.h 2001/10/10 04:00:41 1.2 --- rules.h 2001/10/20 02:14:18 1.3 *************** *** 15,20 **** * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ --- 15,18 ---- *************** *** 58,62 **** void rules_init(void); ! void register_expression_operator(struct expression_operator *oper); struct expression *expression_parse(const unsigned char *string); void expression_free(struct expression *expr); --- 56,60 ---- void rules_init(void); ! void expression_register_operator(struct expression_operator *oper); struct expression *expression_parse(const unsigned char *string); void expression_free(struct expression *expr); |
From: Entrope <en...@us...> - 2001-10-20 01:16:27
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv1263/src Modified Files: hash.h Log Message: add back "handle_info" and "next_authed" fields to struct user Index: hash.h =================================================================== RCS file: /cvsroot/srvx/services/src/hash.h,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -r1.76 -r1.77 *** hash.h 2001/10/15 14:35:15 1.76 --- hash.h 2001/10/20 01:16:24 1.77 *************** *** 87,90 **** --- 87,92 ---- /* pointers to various other bits */ struct service *service; + struct handle_info *handle_info; + struct user *next_authed; }; |
From: Entrope <en...@us...> - 2001-10-20 01:14:43
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv794/src Modified Files: mod_common.c modules.c modules.h service.c Log Message: let modules specify a command's default rule by text as well as by expression struct make module_define_command() internally report any errors include REQUIRE_AUTHED command flag Index: mod_common.c =================================================================== RCS file: /cvsroot/srvx/services/src/mod_common.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** mod_common.c 2001/10/15 14:35:15 1.6 --- mod_common.c 2001/10/20 01:14:40 1.7 *************** *** 130,138 **** static struct module_command cmds[] = { ! { "help", 0, NULL, cmd_help }, ! { "readhelp", 0, NULL, cmd_readhelp }, ! { "timecmd", 0, NULL, cmd_timecmd }, ! { "write", 0, NULL, cmd_write }, ! { NULL, 0, 0, NULL }, }; --- 130,138 ---- static struct module_command cmds[] = { ! { "help", 0, NULL, cmd_help, NULL }, ! { "readhelp", 1 << REQUIRE_AUTHED, NULL, cmd_readhelp, "(umode +o)" }, ! { "timecmd", 1 << REQUIRE_AUTHED, NULL, cmd_timecmd, "(umode +o)" }, ! { "write", 1 << REQUIRE_AUTHED, NULL, cmd_write, "(umode +o)" }, ! { NULL, 0, 0, NULL, NULL } }; *************** *** 148,154 **** if (!mod_common_module) return 1; ! /* Register functions */ for (nn=0; cmds[nn].name; nn++) { ! if (module_define_command(mod_common_module, cmds+nn)) return 2+nn; } --- 148,154 ---- if (!mod_common_module) return 1; ! /* Register commands */ for (nn=0; cmds[nn].name; nn++) { ! module_define_command(mod_common_module, cmds+nn); } Index: modules.c =================================================================== RCS file: /cvsroot/srvx/services/src/modules.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** modules.c 2001/10/15 14:35:15 1.20 --- modules.c 2001/10/20 01:14:40 1.21 *************** *** 28,31 **** --- 28,32 ---- #include "log.h" #include "recdb.h" + #include "rules.h" #include "modules.h" *************** *** 193,202 **** } ! int module_define_command(struct module *mod, struct module_command *cmd) { ! if (dict_find(mod->commands, cmd->name, NULL)) return 1; dict_insert(mod->commands, cmd->name, cmd); - return 0; } --- 194,211 ---- } ! void module_define_command(struct module *mod, struct module_command *cmd) { ! if (dict_find(mod->commands, cmd->name, NULL)) { ! log(MAIN_LOG, LOG_ERROR, "Module %s attempted to insert duplicate command %s\n", mod->name, cmd->name); ! return; ! } ! if (cmd->default_rule_text && !cmd->default_rule) { ! cmd->default_rule = expression_parse(cmd->default_rule_text); ! if (!cmd->default_rule) { ! log(MAIN_LOG, LOG_ERROR, "Parse error for default rule for module %s command %s: %s\n", mod->name, cmd->name, cmd->default_rule_text); ! } ! } dict_insert(mod->commands, cmd->name, cmd); } Index: modules.h =================================================================== RCS file: /cvsroot/srvx/services/src/modules.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** modules.h 2001/10/12 02:03:34 1.9 --- modules.h 2001/10/20 01:14:40 1.10 *************** *** 15,20 **** * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ --- 15,18 ---- *************** *** 60,63 **** --- 58,62 ---- /* In module_command.flags, bit 1<<N corresponds to (enum command_flag)N. */ enum command_flag { + REQUIRE_AUTHED, TAKES_CHANNEL, REQUIRE_CHANNEL, *************** *** 72,75 **** --- 71,75 ---- struct expression *default_rule; MODULE_COMMAND((*function)); + const unsigned char *default_rule_text; }; *************** *** 82,86 **** struct module *module_register(const char *name, modver_t ver, struct module_deplist *deps, struct shared_lib *lib); struct module *module_find_loaded(const char *name); ! int module_define_command(struct module *mod, struct module_command *cmd); void *get_module_symbol(struct module *module, const char *symname); --- 82,86 ---- struct module *module_register(const char *name, modver_t ver, struct module_deplist *deps, struct shared_lib *lib); struct module *module_find_loaded(const char *name); ! void module_define_command(struct module *mod, struct module_command *cmd); void *get_module_symbol(struct module *module, const char *symname); Index: service.c =================================================================== RCS file: /cvsroot/srvx/services/src/service.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** service.c 2001/10/14 19:45:40 1.6 --- service.c 2001/10/20 01:14:40 1.7 *************** *** 128,131 **** --- 128,135 ---- cmd = service_find_command(sinst, argv[0]); } + if ((cmd->base->flags & (1 << REQUIRE_AUTHED)) && !source->handle_info) { + send_message(source, bot, N_("You must authenticate yourself first.")); + return; + } if ((cmd->base->flags & (1 << TAKES_CHANNEL)) && shift) { chan = GetChannel(argv[shift-1]); |
From: Entrope <en...@us...> - 2001-10-20 01:09:41
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv32102/src Modified Files: dict-hash.c dict-splay.c dict.h Log Message: remove references to size_t, which fail when <sys/types.h> not included Index: dict-hash.c =================================================================== RCS file: /cvsroot/srvx/services/src/dict-hash.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dict-hash.c 2001/10/02 16:04:36 1.4 --- dict-hash.c 2001/10/20 01:09:38 1.5 *************** *** 15,20 **** * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ --- 15,18 ---- *************** *** 38,42 **** struct dict { struct dict_node **table; ! size_t used, size; free_f free_keys, free_data; }; --- 36,40 ---- struct dict { struct dict_node **table; ! unsigned int used, size; free_f free_keys, free_data; }; *************** *** 96,100 **** } ! size_t dict_size(dict_t dict) { --- 94,98 ---- } ! unsigned int dict_size(dict_t dict) { *************** *** 117,121 **** dict_foreach(dict_t dict, dict_iterator_f it, void *extra) { ! size_t i; struct dict_node *node; --- 115,119 ---- dict_foreach(dict_t dict, dict_iterator_f it, void *extra) { ! unsigned int i; struct dict_node *node; Index: dict-splay.c =================================================================== RCS file: /cvsroot/srvx/services/src/dict-splay.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** dict-splay.c 2001/10/02 16:04:36 1.3 --- dict-splay.c 2001/10/20 01:09:38 1.4 *************** *** 15,20 **** * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ --- 15,18 ---- *************** *** 37,41 **** free_f free_keys, free_data; struct dict_node *root; ! size_t count; }; --- 35,39 ---- free_f free_keys, free_data; struct dict_node *root; ! unsigned int count; }; *************** *** 54,58 **** * Return number of entries in the dictionary. */ ! size_t dict_size(dict_t dict) { --- 52,56 ---- * Return number of entries in the dictionary. */ ! unsigned int dict_size(dict_t dict) { *************** *** 284,288 **** struct dict_sanity_struct { ! size_t node_count; struct dict_node *bad_node; char error[128]; --- 282,286 ---- struct dict_sanity_struct { ! unsigned int node_count; struct dict_node *bad_node; char error[128]; Index: dict.h =================================================================== RCS file: /cvsroot/srvx/services/src/dict.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** dict.h 2001/10/02 16:04:36 1.7 --- dict.h 2001/10/20 01:09:38 1.8 *************** *** 15,20 **** * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ --- 15,18 ---- *************** *** 34,38 **** void dict_set_free_keys(dict_t dict, free_f free_keys); void dict_set_free_data(dict_t dict, free_f free_data); ! size_t dict_size(dict_t dict); /* if present!=NULL, then *present=1 iff node was found (if node is * not found, return value is NULL, which may be a valid datum) */ --- 32,36 ---- void dict_set_free_keys(dict_t dict, free_f free_keys); void dict_set_free_data(dict_t dict, free_f free_data); ! unsigned int dict_size(dict_t dict); /* if present!=NULL, then *present=1 iff node was found (if node is * not found, return value is NULL, which may be a valid datum) */ |
From: Entrope <en...@us...> - 2001-10-17 01:48:50
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv27453/src Modified Files: Tag: rel-1_0 chanserv.c Log Message: put \n at the end of some log() formats Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.161.2.85 retrieving revision 1.161.2.86 diff -C2 -r1.161.2.85 -r1.161.2.86 *** chanserv.c 2001/10/17 01:46:26 1.161.2.85 --- chanserv.c 2001/10/17 01:48:47 1.161.2.86 *************** *** 1610,1614 **** RUN FOR THE HILLS! WE'RE OUT OF MEMORY! */ chanserv_notice(user, CSMSG_ALLOCATION_ERROR, "a channel record"); ! log(CS_LOG, LOG_ERROR, "Error allocating memory for a channel."); return 0; } --- 1610,1614 ---- RUN FOR THE HILLS! WE'RE OUT OF MEMORY! */ chanserv_notice(user, CSMSG_ALLOCATION_ERROR, "a channel record"); ! log(CS_LOG, LOG_ERROR, "Error allocating memory for a channel.\n"); return 0; } *************** *** 1617,1621 **** { chanserv_notice(user, CSMSG_ALLOCATION_ERROR, "a user record"); ! log(CS_LOG, LOG_ERROR, "Error allocating memory for a user."); unregister_channel(cData); return 0; --- 1617,1621 ---- { chanserv_notice(user, CSMSG_ALLOCATION_ERROR, "a user record"); ! log(CS_LOG, LOG_ERROR, "Error allocating memory for a user.\n"); unregister_channel(cData); return 0; *************** *** 5773,5777 **** if (!new_chan) { chanserv_notice(trans->owner, CSMSG_ALLOCATION_ERROR, "a channel record"); ! log(CS_LOG, LOG_ERROR, "Error allocating memory for a channel."); return; } --- 5773,5777 ---- if (!new_chan) { chanserv_notice(trans->owner, CSMSG_ALLOCATION_ERROR, "a channel record"); ! log(CS_LOG, LOG_ERROR, "Error allocating memory for a channel.\n"); return; } *************** *** 5779,5783 **** if (!add_channel_user(new_chan, trans->owner->handle_info, levelMap[USER_LEVEL_HIGHEST], USER_LEVEL_HIGHEST, now, NULL)) { chanserv_notice(trans->owner, CSMSG_ALLOCATION_ERROR, "a user record"); ! log(CS_LOG, LOG_ERROR, "Error allocating memory for a user."); unregister_channel(new_chan); return; --- 5779,5783 ---- if (!add_channel_user(new_chan, trans->owner->handle_info, levelMap[USER_LEVEL_HIGHEST], USER_LEVEL_HIGHEST, now, NULL)) { chanserv_notice(trans->owner, CSMSG_ALLOCATION_ERROR, "a user record"); ! log(CS_LOG, LOG_ERROR, "Error allocating memory for a user.\n"); unregister_channel(new_chan); return; |
From: Zoot <zo...@us...> - 2001-10-17 01:46:29
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv26915/src Modified Files: Tag: rel-1_0 chanserv.c Log Message: Free data structures in the correct order when a channel is automatically expired, don't automatically voice users in certain cases when they authenticate. Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.161.2.84 retrieving revision 1.161.2.85 diff -C2 -r1.161.2.84 -r1.161.2.85 *** chanserv.c 2001/10/06 21:33:57 1.161.2.84 --- chanserv.c 2001/10/17 01:46:26 1.161.2.85 *************** *** 1434,1437 **** --- 1434,1438 ---- { struct chanData *channel, *next; + struct chanNode *save; char delay[INTERVALLEN], reason[INTERVALLEN + 64]; (void)data; *************** *** 1451,1462 **** if((now - channel->visited) > chanserv_conf.channel_expire_delay) { ! log(CS_LOG, LOG_INFO, "(%s) Channel registration expired.", channel->channel->name); if(!IsSuspended(channel)) { ! DelChannelUser(chanserv, channel->channel, reason, 0); } - - unregister_channel(channel); } } --- 1452,1466 ---- if((now - channel->visited) > chanserv_conf.channel_expire_delay) { ! log(CS_LOG, LOG_INFO, "(%s) Channel registration expired.\n", channel->channel->name); + /* Because we have a chanData * and not a chanNode *, save + the chanNode *, then call unregister_channel(). */ + save = channel->channel; + unregister_channel(channel); + if(!IsSuspended(channel)) { ! DelChannelUser(chanserv, save, reason, 0); } } } *************** *** 4670,4674 **** AddChannelOp(1, &user, cn, chanserv->numeric, 1); } ! else if (GetChannelAccess(channel->channel, user->handle_info)) { AddChannelVoice(1, &user, cn, chanserv->numeric, 1); --- 4674,4678 ---- AddChannelOp(1, &user, cn, chanserv->numeric, 1); } ! else if(channel->user->access == ulPeon) { AddChannelVoice(1, &user, cn, chanserv->numeric, 1); |
From: Entrope <en...@us...> - 2001-10-16 14:41:47
|
Update of /cvsroot/srvx/services In directory usw-pr-cvs1:/tmp/cvs-serv1812 Added Files: Tag: rel-1_0 compile depcomp Log Message: move automake files (compile, depcomp) to project root (for automake 1.5) include global.help in EXTRA_DIST --- NEW FILE --- #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. # Copyright 1999, 2000 Free Software Foundation, Inc. # Written by Tom Tromey <tr...@cy...>. # # 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Usage: # compile PROGRAM [ARGS]... # `-o FOO.o' is removed from the args passed to the actual compile. prog=$1 shift ofile= cfile= args= while test $# -gt 0; do case "$1" in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we do something ugly here. ofile=$2 shift case "$ofile" in *.o | *.obj) ;; *) args="$args -o $ofile" ofile= ;; esac ;; *.c) cfile=$1 args="$args $1" ;; *) args="$args $1" ;; esac shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$prog" $args fi # Name of file we expect compiler to create. cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir $lockdir > /dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir $lockdir; exit 1" 1 2 15 # Run the compile. "$prog" $args status=$? if test -f "$cofile"; then mv "$cofile" "$ofile" fi rmdir $lockdir exit $status --- NEW FILE --- #! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000 Free Software Foundation, Inc. # 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 2, 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva <ol...@dc...>. if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. This file always lives in the current directory. # Also, the AIX compiler puts `$object:' at the start of each line; # $object doesn't have directory information. stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; tru64) # The Tru64 AIX compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. tmpdepfile1="$object.d" tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` if test "$libtool" = yes; then "$@" -Wc,-MD else "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a space and a tab in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. test -z "$dashmflag" && dashmflag=-M ( IFS=" " case " $* " in *" --mode=compile "*) # this is libtool, let us make it quiet for arg do # cycle over the arguments case "$arg" in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) # X makedepend ( shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift;; -*) ;; *) set fnord "$@" "$arg"; shift;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tail +3 "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. ( IFS=" " case " $* " in *" --mode=compile "*) for arg do # cycle over the arguments case $arg in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. ( IFS=" " case " $* " in *" --mode=compile "*) for arg do # cycle over the arguments case $arg in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 |
From: Entrope <en...@us...> - 2001-10-16 14:41:47
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv1812/src Modified Files: Tag: rel-1_0 Makefile.am Removed Files: Tag: rel-1_0 compile depcomp Log Message: move automake files (compile, depcomp) to project root (for automake 1.5) include global.help in EXTRA_DIST Index: Makefile.am =================================================================== RCS file: /cvsroot/srvx/services/src/Makefile.am,v retrieving revision 1.26.2.9 retrieving revision 1.26.2.10 diff -C2 -r1.26.2.9 -r1.26.2.10 *** Makefile.am 2001/08/26 03:43:35 1.26.2.9 --- Makefile.am 2001/10/16 14:41:04 1.26.2.10 *************** *** 4,8 **** noinst_PROGRAMS = srvx EXTRA_PROGRAMS = checkdb globtest pwcracker ! EXTRA_DIST = nickserv.help opserv.help chanserv.help srvx_LIBS = @RX_LIBS@ --- 4,8 ---- noinst_PROGRAMS = srvx EXTRA_PROGRAMS = checkdb globtest pwcracker ! EXTRA_DIST = global.help nickserv.help opserv.help chanserv.help srvx_LIBS = @RX_LIBS@ --- compile DELETED --- --- depcomp DELETED --- |
From: Entrope <en...@us...> - 2001-10-15 14:39:58
|
Update of /cvsroot/srvx/services In directory usw-pr-cvs1:/tmp/cvs-serv5265 Modified Files: srvx.conf.example Log Message: automatically load protocol module Index: srvx.conf.example =================================================================== RCS file: /cvsroot/srvx/services/srvx.conf.example,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** srvx.conf.example 2001/07/15 14:49:09 1.5 --- srvx.conf.example 2001/10/15 14:39:55 1.6 *************** *** 152,160 **** "modules" { ! "path" "/path/to/modules"; ! // allow a module to set its own level - ignoring default_level ! "allow_override" "1"; ! // unless specified by module and override is enable ! // this is also the default level if a module doesnt specify one ! "default_level" "800"; }; --- 152,159 ---- "modules" { ! // The protocol module needs a special hint, since there's more than one.. ! // (You could also put a symlink from libproto.so to libproto_ircu_p10.so) ! "proto" { ! "path" "./.libs/libproto_ircu_p10.so"; ! }; }; |