Thread: [srvx-commits] CVS: services/src modcmd.help,NONE,1.1 modcmd.h,NONE,1.1 modcmd.c,NONE,1.1 tools.c,1.
Brought to you by:
entrope
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv13880/src
Modified Files:
tools.c timeq.h timeq.c sockcheck.c sendmail.c recdb.h recdb.c
proto.h proto-common.c policer.c opserv.help opserv.c
nickserv.help.m4 nickserv.h nickserv.c mini-tools.c messages.h
md5.c main.c log.h log.c ioset.c helpserv.c helpfile.c heap.c
hash.h hash.c globtest.c global.help global.c gline.h gline.c
getopt1.c getopt.c expnhelp.c dict-splay.c conf.h conf.c
compat.h compat.c common.h checkdb.c chanserv.help chanserv.h
chanserv.c Makefile.am
Added Files:
modcmd.help modcmd.h modcmd.c
Removed Files:
alias.h alias.c
Log Message:
#include all ANSI C headers from compat.h
minimize #includes in other files
implement a generic command handler framework, including "free-form" aliases
--- NEW FILE ---
"bind" ("BIND ME");
"help" ("$bHELP$b",
"/msg $S HELP [command]",
"Help will show you the information for the given command.",
"All help files will use the same syntax, with optional parameters listed in [] and required parameters listed in <>.",
"To see what commands are available for use with $S, type /msg $S help index. For help on any specific command or topic, type /msg $S help help command.");
"readhelp" ("$bREADHELP$b",
"/msg $S READHELP [module]",
"Re-reads the module's help file from disk. If no module name is given, default to the current bot.",
"$uSee Also:$u help");
"unbind" ("UNBIND ME");
***** Error reading new file: [Errno 2] No such file or directory: 'modcmd.h'
***** Error reading new file: [Errno 2] No such file or directory: 'modcmd.c'
Index: tools.c
===================================================================
RCS file: /cvsroot/srvx/services/src/tools.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -C2 -r1.108 -r1.109
*** tools.c 21 Jul 2002 02:24:47 -0000 1.108
--- tools.c 30 Jul 2002 02:15:10 -0000 1.109
***************
*** 19,50 ****
*/
! #include "config.h"
! #include <ctype.h>
! #include <stdio.h>
! #include <stdlib.h>
! #include <string.h>
! #include <time.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
- #ifdef HAVE_NETINET_IN_H
- #include <netinet/in.h>
- #endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
- #include "common.h"
- #include "hash.h"
- #include "log.h"
- #include "policer.h"
- #include "recdb.h"
-
#define NUMNICKLOG 6
#define NUMNICKBASE (1 << NUMNICKLOG)
--- 19,37 ----
*/
! #include "hash.h"
! #include "log.h"
! #include "policer.h"
! #include "recdb.h"
!
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#define NUMNICKLOG 6
#define NUMNICKBASE (1 << NUMNICKLOG)
***************
*** 542,549 ****
}
}
-
- /* TODO: glob comparisons - matching a glob against a glob requires
- different code. for now, match_ircglobs is an alias for ircglob.
- */
int
--- 529,532 ----
Index: timeq.h
===================================================================
RCS file: /cvsroot/srvx/services/src/timeq.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** timeq.h 2 Jul 2002 00:01:09 -0000 1.10
--- timeq.h 30 Jul 2002 02:15:11 -0000 1.11
***************
*** 22,31 ****
#define TIMEQ_H
- #include "config.h"
-
- #ifdef HAVE_SYS_TIME_H
- #include <sys/time.h>
- #endif
-
typedef void (*timeq_func)(void *data);
--- 22,25 ----
Index: timeq.c
===================================================================
RCS file: /cvsroot/srvx/services/src/timeq.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** timeq.c 2 Jul 2002 00:01:09 -0000 1.15
--- timeq.c 30 Jul 2002 02:15:11 -0000 1.16
***************
*** 19,25 ****
*/
- #include "config.h"
- #include <stdlib.h>
-
#include "common.h"
#include "heap.h"
--- 19,22 ----
Index: sockcheck.c
===================================================================
RCS file: /cvsroot/srvx/services/src/sockcheck.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -r1.73 -r1.74
*** sockcheck.c 8 Jul 2002 15:45:32 -0000 1.73
--- sockcheck.c 30 Jul 2002 02:15:11 -0000 1.74
***************
*** 19,46 ****
*/
- #include "config.h"
- #include <errno.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
- #ifdef HAVE_SYS_SOCKET_H
- #include <sys/socket.h>
- #endif
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif
-
- #include "common.h"
#include "conf.h"
- #include "dict.h"
#include "gline.h"
#include "ioset.h"
#include "log.h"
- #include "recdb.h"
#include "timeq.h"
#include "sockcheck.h"
/* TODO, 1.2 or later: allow rules like "27374:" "reject:Subseven detected";
--- 19,32 ----
*/
#include "conf.h"
#include "gline.h"
#include "ioset.h"
#include "log.h"
#include "timeq.h"
#include "sockcheck.h"
+
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
/* TODO, 1.2 or later: allow rules like "27374:" "reject:Subseven detected";
Index: sendmail.c
===================================================================
RCS file: /cvsroot/srvx/services/src/sendmail.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** sendmail.c 6 May 2002 23:33:12 -0000 1.2
--- sendmail.c 30 Jul 2002 02:15:11 -0000 1.3
***************
*** 19,41 ****
*/
- #include "config.h"
- #include <errno.h>
- #include <stdio.h>
- #include <stdlib.h>
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
- #ifdef HAVE_SYS_WAIT_H
- #include <sys/wait.h>
- #endif
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif
-
- #include "common.h"
#include "conf.h"
- #include "dict.h"
#include "log.h"
#include "nickserv.h"
dict_t prohibited_addrs, prohibited_masks;
--- 19,29 ----
*/
#include "conf.h"
#include "log.h"
#include "nickserv.h"
+
+ #ifdef HAVE_SYS_WAIT_H
+ #include <sys/wait.h>
+ #endif
dict_t prohibited_addrs, prohibited_masks;
Index: recdb.h
===================================================================
RCS file: /cvsroot/srvx/services/src/recdb.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** recdb.h 3 Jul 2002 02:52:57 -0000 1.20
--- recdb.h 30 Jul 2002 02:15:11 -0000 1.21
***************
*** 22,30 ****
#define _recdb_h
! #include "config.h"
!
! #include <stdio.h>
! #include <string.h>
!
#include "dict.h"
--- 22,26 ----
#define _recdb_h
! #include "common.h"
#include "dict.h"
Index: recdb.c
===================================================================
RCS file: /cvsroot/srvx/services/src/recdb.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** recdb.c 8 Jul 2002 01:35:20 -0000 1.38
--- recdb.c 30 Jul 2002 02:15:11 -0000 1.39
***************
*** 19,35 ****
*/
- #include "config.h"
- #include <ctype.h>
- #include <setjmp.h>
- #include <stdio.h>
- #include <stdlib.h>
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif
-
- #include "dict.h"
#include "recdb.h"
#include "log.h"
! #include "common.h"
/* file format (grammar in Backus-Naur Form):
--- 19,26 ----
*/
#include "recdb.h"
#include "log.h"
!
! #include <setjmp.h>
/* file format (grammar in Backus-Naur Form):
Index: proto.h
===================================================================
RCS file: /cvsroot/srvx/services/src/proto.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -r1.54 -r1.55
*** proto.h 7 Jul 2002 03:23:37 -0000 1.54
--- proto.h 30 Jul 2002 02:15:11 -0000 1.55
***************
*** 94,98 ****
/* Callback notifications for protocol support. */
! typedef void (*chanmsg_func_t) (struct userNode *user, struct chanNode *chan, char *text);
void reg_chanmsg_func(unsigned char prefix, struct userNode *service, chanmsg_func_t handler);
--- 94,98 ----
/* Callback notifications for protocol support. */
! typedef void (*chanmsg_func_t) (struct userNode *user, struct chanNode *chan, char *text, struct userNode *bot);
void reg_chanmsg_func(unsigned char prefix, struct userNode *service, chanmsg_func_t handler);
Index: proto-common.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-common.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** proto-common.c 8 Jul 2002 14:43:59 -0000 1.4
--- proto-common.c 30 Jul 2002 02:15:11 -0000 1.5
***************
*** 19,52 ****
*/
! #include "config.h"
- #include <ctype.h>
- #include <errno.h>
- #include <stdarg.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif
-
- #include "common.h"
- #include "conf.h"
- #include "dict.h"
- #include "gline.h"
- #include "hash.h"
- #include "ioset.h"
- #include "log.h"
- #include "policer.h"
- #include "timeq.h"
int socket_fd = -1;
--- 19,35 ----
*/
! #include "conf.h"
! #include "gline.h"
! #include "ioset.h"
! #include "log.h"
! #include "policer.h"
! #include "timeq.h"
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
int socket_fd = -1;
***************
*** 466,470 ****
}
! static struct {
chanmsg_func_t func;
struct userNode *service;
--- 449,453 ----
}
! static struct chanmsg_func {
chanmsg_func_t func;
struct userNode *service;
***************
*** 483,486 ****
--- 466,470 ----
struct privmsg_desc *pd = data;
struct modeNode *mn;
+ struct chanmsg_func *cf = chanmsg_funcs + pd->text[0];
/* Don't complain if it can't find the modeNode because the channel might
***************
*** 491,497 ****
/* Never send a NOTICE to a channel to one of the services */
! if (!pd->is_notice && chanmsg_funcs[pd->text[0]].func) {
! if (GetUserMode(cn, chanmsg_funcs[pd->text[0]].service)) {
! chanmsg_funcs[pd->text[0]].func(pd->user, cn, pd->text+1);
}
}
--- 475,481 ----
/* Never send a NOTICE to a channel to one of the services */
! if (!pd->is_notice && cf->func) {
! if (GetUserMode(cn, cf->service)) {
! cf->func(pd->user, cn, pd->text+1, cf->service);
}
}
Index: policer.c
===================================================================
RCS file: /cvsroot/srvx/services/src/policer.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** policer.c 8 Jul 2002 15:45:32 -0000 1.18
--- policer.c 30 Jul 2002 02:15:11 -0000 1.19
***************
*** 19,26 ****
*/
- #include "config.h"
- #include <stdlib.h>
- #include <string.h>
-
#include "common.h"
#include "policer.h"
--- 19,22 ----
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -r1.44 -r1.45
*** opserv.help 24 Jul 2002 23:58:50 -0000 1.44
--- opserv.help 30 Jul 2002 02:15:11 -0000 1.45
***************
*** 434,438 ****
" DIE [${level/die}]",
" JUMP [${level/jump}]",
- " READHELP [${level/readhelp}]",
" RECONNECT [${level/reconnect}]",
" RESTART [${level/restart}]",
--- 434,437 ----
***************
*** 447,453 ****
"Causes srvx to connect to the specified uplink.",
"$uSee Also:$u die, reconnect, restart");
- "READHELP" ("$bREADHELP$b",
- "/msg $O READHELP ",
- "Re-reads the $b$O$b help file from disk.");
"RECONNECT" ("$bRECONNECT$b",
"/msg $O RECONNECT ",
--- 446,449 ----
***************
*** 534,540 ****
"Dumps a raw server message into the stream. Unlike $braw$b, $bdump$b checks line syntax before sending it, making it much safer to use then $braw$b. If $bdump$b detects a syntax error in the line, it is not sent. It is $bHIGHLY$b recommended that you use $bdump$b instead of $braw$b.",
"$uSee Also:$u raw");
- "HELP" ("$bHELP$b",
- "/msg $O HELP [topic|command]",
- "Displays help information for the specified topic or command. If no topic or command is specified, help returns basic $bhelp$b information for $b$O$b.");
"RAW" ("$bRAW$b",
"/msg $O RAW <raw line>",
--- 530,533 ----
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.248
retrieving revision 1.249
diff -C2 -r1.248 -r1.249
*** opserv.c 25 Jul 2002 17:40:12 -0000 1.248
--- opserv.c 30 Jul 2002 02:15:11 -0000 1.249
***************
*** 19,32 ****
*/
! #include "config.h"
! #include <ctype.h>
! #include <errno.h>
! #include <limits.h>
! #include <stdarg.h>
! #include <stdlib.h>
! #include <string.h>
! #ifdef HAVE_SYS_TYPES_H
[...1132 lines suppressed...]
opserv_define_func("UNBAN", cmd_unban, 100);
opserv_define_func("UNBANEMAIL", cmd_unban_email, 601);
--- 4433,4436 ----
***************
*** 4975,4982 ****
reg_auth_func(opserv_staff_alert);
- alias_register_service("OpServ", opserv_command_search, opserv_add_alias, opserv_del_alias);
-
opserv_db_read();
! opserv_helpfile_read();
if (opserv_conf.db_backup_frequency) {
--- 4460,4465 ----
reg_auth_func(opserv_staff_alert);
opserv_db_read();
! opserv_service = service_register(opserv, opserv_conf.trigger_char);
if (opserv_conf.db_backup_frequency) {
Index: nickserv.help.m4
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.help.m4,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** nickserv.help.m4 7 Jul 2002 21:16:40 -0000 1.10
--- nickserv.help.m4 30 Jul 2002 02:15:11 -0000 1.11
***************
*** 81,85 ****
"UNREGISTER" ("$bUNREGISTER$b",
! "/msg $n UNREGISTER <password>",
"Un-registers the account you are authenticated with, and any nicks that have been registered to that account.",
"$uSee Also:$u register, regnick, unregnick");
--- 81,85 ----
"UNREGISTER" ("$bUNREGISTER$b",
! "/msg $N@$s UNREGISTER <password>",
"Un-registers the account you are authenticated with, and any nicks that have been registered to that account.",
"$uSee Also:$u register, regnick, unregnick");
***************
*** 109,113 ****
"RESETPASS" ("$bRESETPASS$b",
! "/msg $n RESETPASS <account> <newpassword>",
"Requests that $N send you email with a cookie that will change your password (in case you have forgotten it). Once you receive the cookie in email, use the $bcookie$b command to actually change your password.",
"$bYour password will not be changed, and you will not be able to use it to log in, until you confirm the change using the $ucookie$u command.$b",
--- 109,113 ----
"RESETPASS" ("$bRESETPASS$b",
! "/msg $N@$s RESETPASS <account> <newpassword>",
"Requests that $N send you email with a cookie that will change your password (in case you have forgotten it). Once you receive the cookie in email, use the $bcookie$b command to actually change your password.",
"$bYour password will not be changed, and you will not be able to use it to log in, until you confirm the change using the $ucookie$u command.$b",
***************
*** 121,125 ****
"COOKIE" ("$bCOOKIE$b",
! "/msg $n COOKIE <account> <cookie>",
"Completes the maintenance action (for example, activating an account or changing your password) for which a cookie was issued. The cookie will then be forgotten.",
"$uSee Also:$u cookieauth, resetpass, set, delcookie");
--- 121,125 ----
"COOKIE" ("$bCOOKIE$b",
! "/msg $N@$s COOKIE <account> <cookie>",
"Completes the maintenance action (for example, activating an account or changing your password) for which a cookie was issued. The cookie will then be forgotten.",
"$uSee Also:$u cookieauth, resetpass, set, delcookie");
***************
*** 149,153 ****
"$uSee Also:$u addmask, auth");
"AUTH" ("$bAUTH$b",
! "/msg $n AUTH [account] <password>",
"Authenticates yourself with $b$N$b to the specified account. You must use $bauth$b before you have any access to network services, including channels that are registered with $b$C$b.",
"If you omit the account, it uses your current nick as your account name.",
--- 149,153 ----
"$uSee Also:$u addmask, auth");
"AUTH" ("$bAUTH$b",
! "/msg $N@$s AUTH [account] <password>",
"Authenticates yourself with $b$N$b to the specified account. You must use $bauth$b before you have any access to network services, including channels that are registered with $b$C$b.",
"If you omit the account, it uses your current nick as your account name.",
***************
*** 180,186 ****
"$bn$b No-delete (will never be unregistered for inactivity)",
"$uSee Also:$u accountinfo, set");
- "HELP" ("$bHELP$b",
- "/msg $N HELP [topic/command]",
- "Displays help information for the specified topic or command. If no topic or command is specified, $bhelp$b returns basic help information for $b$N$b.");
"OADDMASK" ("$bOADDMASK$b",
"/msg $N OADDMASK <nick|*account> <user@host>",
--- 180,183 ----
***************
*** 195,199 ****
"$uSee Also:$u oaddmask");
"OREGISTER" ("$bOREGISTER$b",
! "/msg $n OREGISTER <account> <password> <user@host|nick>",
"Registers an account with $b$N$b using the specified account, password, and user@host. If then nick of an online user is specified, then that user's user@host is used.",
ifdef({/services/nickserv/disable_nicks},
--- 192,196 ----
"$uSee Also:$u oaddmask");
"OREGISTER" ("$bOREGISTER$b",
! "/msg $N@$s OREGISTER <account> <password> <user@host|nick>",
"Registers an account with $b$N$b using the specified account, password, and user@host. If then nick of an online user is specified, then that user's user@host is used.",
ifdef({/services/nickserv/disable_nicks},
***************
*** 212,227 ****
{ "$uSee Also:$u accountinfo, account flags, nickinfo, set, userinfo"}));
"PASS" ("$bPASS$b",
! "/msg $n PASS <oldpass> <newpass>",
"Changes your $b$N$b password.",
"$uSee Also:$u auth");
- "READHELP" ("$bREADHELP$b",
- "/msg $N READHELP ",
- "Re-reads the $b$N$b help file from disk. You must be an IRC operator to use this command.");
"REGISTER" ("$bREGISTER$b",
ifdef({/services/nickserv/email_enabled},
{ifdef({/services/nickserv/email_required},
! { "/msg $n REGISTER <account> <password> <email>",},
! { "/msg $n REGISTER <account> <password> [email]",})},
! { "/msg $n REGISTER <account> <password>",})
"Registers a specified account with $b$N$b, adding your current user@host to your new account. You will be required to know the password you specify with $bregister$b in order to be able to use $bauth$b to authenticate to your account.",
ifdef({/services/nickserv/email_enabled},
--- 209,221 ----
{ "$uSee Also:$u accountinfo, account flags, nickinfo, set, userinfo"}));
"PASS" ("$bPASS$b",
! "/msg $N@$s PASS <oldpass> <newpass>",
"Changes your $b$N$b password.",
"$uSee Also:$u auth");
"REGISTER" ("$bREGISTER$b",
ifdef({/services/nickserv/email_enabled},
{ifdef({/services/nickserv/email_required},
! { "/msg $N@$s REGISTER <account> <password> <email>",},
! { "/msg $N@$s REGISTER <account> <password> [email]",})},
! { "/msg $N@$s REGISTER <account> <password>",})
"Registers a specified account with $b$N$b, adding your current user@host to your new account. You will be required to know the password you specify with $bregister$b in order to be able to use $bauth$b to authenticate to your account.",
ifdef({/services/nickserv/email_enabled},
***************
*** 229,233 ****
{ "An email will be sent to the email address you give containing a cookie that will let you activate your account. Once you have that cookie, you must use the $bcookie$b command to be able to use your account.",},
{ "If you specify an email address, an email will be sent to it containing a cookie that will let you activate your account. Once you have that cookie, you must use the $bcookie$b command to be able to use your account.",})})
! "NOTE: It is strongly recommended that you use the long form ($n) rather than just nick ($N) for this command, to protect against impersonators on other networks.",
ifdef({/services/nickserv/disable_nicks},
{ "$uSee Also:$u auth, unregister"},
--- 223,227 ----
{ "An email will be sent to the email address you give containing a cookie that will let you activate your account. Once you have that cookie, you must use the $bcookie$b command to be able to use your account.",},
{ "If you specify an email address, an email will be sent to it containing a cookie that will let you activate your account. Once you have that cookie, you must use the $bcookie$b command to be able to use your account.",})})
! "NOTE: It is strongly recommended that you use the long form ($N@$s) rather than just nick ($N) for this command, to protect against impersonators on other networks.",
ifdef({/services/nickserv/disable_nicks},
{ "$uSee Also:$u auth, unregister"},
Index: nickserv.h
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** nickserv.h 11 Jul 2002 18:15:50 -0000 1.34
--- nickserv.h 30 Jul 2002 02:15:11 -0000 1.35
***************
*** 22,27 ****
#define _nickserv_h
! #include "common.h" /* for MD5_CRYPT_LENGTH, etc. */
! #include "hash.h" /* for NICKLEN, etc. */
#define NICKSERV_HANDLE_LEN NICKLEN
--- 22,26 ----
#define _nickserv_h
! #include "hash.h" /* for NICKLEN, etc., and common.h */
#define NICKSERV_HANDLE_LEN NICKLEN
***************
*** 105,108 ****
--- 104,109 ----
char *tag; /* e.g. email address */
};
+
+ extern const unsigned char *handle_flags;
void init_nickserv(const char *nick);
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.180
retrieving revision 1.181
diff -C2 -r1.180 -r1.181
*** nickserv.c 11 Jul 2002 18:15:49 -0000 1.180
--- nickserv.c 30 Jul 2002 02:15:11 -0000 1.181
***************
*** 19,62 ****
*/
- #include "config.h"
- #include <ctype.h>
- #include <errno.h>
- #include <limits.h>
- #include <stdarg.h>
- #include <stdlib.h>
- #ifdef HAVE_SYS_TIME_H
- #include <sys/time.h>
- #endif
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
- #ifdef HAVE_REGEX_H
- #include <regex.h>
- #endif
-
- #include "alias.h"
#include "chanserv.h"
- #include "common.h"
#include "conf.h"
- #include "dict.h"
#include "global.h"
! #include "hash.h"
! #include "helpfile.h"
! #include "log.h"
! #include "messages.h"
! #include "nickserv.h"
#include "opserv.h"
#include "policer.h"
- #include "recdb.h"
#include "sendmail.h"
#include "timeq.h"
#define NICKSERV_CONF_NAME "services/nickserv"
#define NICKSERV_DB_NAME "nickserv.db"
#define TEMP_DB_NAME "nickserv.db.new"
- #define NICKSERV_HELPFILE_NAME "nickserv.help"
#define KEY_DISABLE_NICKS "disable_nicks"
- #define KEY_REQUIRE_QUALIFIED "require_qualified"
#define KEY_DEFAULT_HOSTMASK "default_hostmask"
#define KEY_NICKS_PER_HANDLE "nicks_per_handle"
--- 19,40 ----
*/
#include "chanserv.h"
#include "conf.h"
#include "global.h"
! #include "modcmd.h"
#include "opserv.h"
#include "policer.h"
#include "sendmail.h"
#include "timeq.h"
+ #ifdef HAVE_REGEX_H
+ #include <regex.h>
+ #endif
+
#define NICKSERV_CONF_NAME "services/nickserv"
#define NICKSERV_DB_NAME "nickserv.db"
#define TEMP_DB_NAME "nickserv.db.new"
#define KEY_DISABLE_NICKS "disable_nicks"
#define KEY_DEFAULT_HOSTMASK "default_hostmask"
#define KEY_NICKS_PER_HANDLE "nicks_per_handle"
***************
*** 174,186 ****
#define NSMSG_PASSWORD_INVALID "Incorrect password; please try again."
#define NSMSG_PLEASE_SET_EMAIL "We now require email addresses for users. Please use the $bset email$b command to set your email address!"
! #define NSMSG_WEAK_PASSWORD "WARNING: You are using a password that is considered weak (easy to guess). It is STRONGLY recommended you change it (now, if not sooner) by typing \"/msg $n PASS oldpass newpass\" (with your current password and a new password)."
#define NSMSG_HANDLE_SUSPENDED "Your $N account has been suspended."
#define NSMSG_AUTH_SUCCESS "I recognize you."
#define NSMSG_AUTH_ALLOWED "User $b%s$b may now authenticate to account $b%s$b."
! #define NSMSG_AUTH_ALLOWED_MSG "You may now authenticate to account $b%s$b by typing $b/msg $n auth %s password$b (using your password). If you will be using this computer regularly, please type $b/msg $N addmask$b (AFTER you auth) to permanently add your hostmask."
#define NSMSG_AUTH_ALLOWED_EMAIL "You may also (after you auth) type $b/msg $N set email us...@yo...$b to set an email address. This will let you use the $bauthcookie$b command to be authenticated in the future."
#define NSMSG_AUTH_NORMAL_ONLY "User $b%s$b may now only authenticate to accounts with matching hostmasks."
#define NSMSG_AUTH_UNSPECIAL "User $b%s$b did not have any special auth allowance."
- #define NSMSG_MUST_QUALIFY "You $bMUST$b \"/msg $n %s\" (not just $N) for that command."
#define NSMSG_MUST_AUTH "You must be authenticated first."
#define NSMSG_TOO_MANY_NICKS "You have already registered the maximum permitted number of nicks."
--- 152,163 ----
#define NSMSG_PASSWORD_INVALID "Incorrect password; please try again."
#define NSMSG_PLEASE_SET_EMAIL "We now require email addresses for users. Please use the $bset email$b command to set your email address!"
! #define NSMSG_WEAK_PASSWORD "WARNING: You are using a password that is considered weak (easy to guess). It is STRONGLY recommended you change it (now, if not sooner) by typing \"/msg $N@$s PASS oldpass newpass\" (with your current password and a new password)."
#define NSMSG_HANDLE_SUSPENDED "Your $N account has been suspended."
#define NSMSG_AUTH_SUCCESS "I recognize you."
#define NSMSG_AUTH_ALLOWED "User $b%s$b may now authenticate to account $b%s$b."
! #define NSMSG_AUTH_ALLOWED_MSG "You may now authenticate to account $b%s$b by typing $b/msg $N@$s auth %s password$b (using your password). If you will be using this computer regularly, please type $b/msg $N addmask$b (AFTER you auth) to permanently add your hostmask."
#define NSMSG_AUTH_ALLOWED_EMAIL "You may also (after you auth) type $b/msg $N set email us...@yo...$b to set an email address. This will let you use the $bauthcookie$b command to be authenticated in the future."
#define NSMSG_AUTH_NORMAL_ONLY "User $b%s$b may now only authenticate to accounts with matching hostmasks."
#define NSMSG_AUTH_UNSPECIAL "User $b%s$b did not have any special auth allowance."
#define NSMSG_MUST_AUTH "You must be authenticated first."
#define NSMSG_TOO_MANY_NICKS "You have already registered the maximum permitted number of nicks."
***************
*** 249,263 ****
#define NICKSERV_VALID_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
! #define NICKSERV_FUNC(NAME) int NAME(struct userNode *user, unsigned int argc, unsigned char *argv[])
! typedef NICKSERV_FUNC(nickserv_func_t);
!
#define OPTION_FUNC(NAME) int NAME(struct userNode *user, struct handle_info *hi, unsigned int override, unsigned int argc, unsigned char *argv[])
typedef OPTION_FUNC(option_func_t);
- static NICKSERV_FUNC(cmd_help);
-
DEFINE_LIST(handle_info_list, struct handle_info*);
! #define NICKSERV_SYNTAX() nickserv_help(user, argv[0], 0)
#define NICKSERV_MIN_PARMS(N) do { \
(void)argv; \
--- 226,236 ----
#define NICKSERV_VALID_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
! #define NICKSERV_FUNC(NAME) MODCMD_FUNC(NAME)
#define OPTION_FUNC(NAME) int NAME(struct userNode *user, struct handle_info *hi, unsigned int override, unsigned int argc, unsigned char *argv[])
typedef OPTION_FUNC(option_func_t);
DEFINE_LIST(handle_info_list, struct handle_info*);
! #define NICKSERV_SYNTAX() svccmd_send_help_2(nickserv, user, nickserv_service, argv[0])
#define NICKSERV_MIN_PARMS(N) do { \
(void)argv; \
***************
*** 268,273 ****
struct userNode *nickserv;
! struct helpfile *nickserv_helpfile;
! static dict_t nickserv_func_dict; /* contains nickserv_cmd* */
static dict_t nickserv_handle_dict; /* contains struct handle_info* */
static dict_t nickserv_nick_dict; /* contains struct nick_info* */
--- 241,249 ----
struct userNode *nickserv;
! struct userList curr_helpers;
! const unsigned char *handle_flags = HANDLE_FLAGS;
!
! static struct module *nickserv_module;
! static struct service *nickserv_service;
static dict_t nickserv_handle_dict; /* contains struct handle_info* */
static dict_t nickserv_nick_dict; /* contains struct nick_info* */
***************
*** 275,288 ****
static dict_t nickserv_allow_auth_dict; /* contains struct handle_info* */
static dict_t nickserv_email_dict; /* contains struct handle_info_list*, indexed by email addr */
- static const unsigned char *handle_flags = HANDLE_FLAGS;
static unsigned char handle_inverse_flags[256];
static unsigned int flag_access_levels[32];
static time_t lastwrite = 0;
- struct userList curr_helpers;
-
static struct {
unsigned int disable_nicks : 1;
- unsigned int require_qualified : 1;
unsigned int ...
[truncated message content] |