diff -uNr ircservices-5.0.57/Changes ircservices-5.0.58/Changes --- ircservices-5.0.57/Changes 2006-01-20 12:52:01 +0900 +++ ircservices-5.0.58/Changes 2006-06-22 01:20:27 +0900 @@ -1,5 +1,16 @@ Version 5.0 ----------- +2006/06/22 .58 Added workaround to support the broken MD5 encryption used + in Epona/Anope (through at least version 1.7.14), + enabled by the EnableAnopeWorkaround option for the + encryption/md5 module in modules.conf. Reported by + Gabriel Baez +2006/06/22 configure -check (run by the Makefile) no longer leaves a + conf-tmp directory lying around. +2006/06/21 Fixed error when compiling with recent versions of GNU make. +2006/06/20 Fixed crash when importing some Anope databases. Reported + by Gabriel Baez +2006/01/20 Added support to convert-db for recent versions of Epona. 2006/01/20 .57 Fixed conversion of Anope 1.7 OperServ databases. Reported by Matt Smith 2006/01/20 ChanServ SET SECUREOPS now prevents unprivileged users from diff -uNr ircservices-5.0.57/configure ircservices-5.0.58/configure --- ircservices-5.0.57/configure 2006-01-09 01:44:35 +0900 +++ ircservices-5.0.58/configure 2006-06-22 01:15:03 +0900 @@ -337,6 +337,7 @@ fi fi if [ "$option" = "check" ] ; then + rm -rf $CONFTMP if [ -f config.cache ] ; then CACHEVER=`grep '^CONFIG_VERSION=' config.cache | cut -d= -f2` if [ "x$CACHEVER" = "x$MY_CONFIG_VERSION" ] ; then diff -uNr ircservices-5.0.57/data/example-modules.conf ircservices-5.0.58/data/example-modules.conf --- ircservices-5.0.57/data/example-modules.conf 2006-01-20 12:56:34 +0900 +++ ircservices-5.0.58/data/example-modules.conf 2006-06-22 01:22:40 +0900 @@ -68,6 +68,30 @@ ########################################################################### # +# Encryption module configuration +# +########################################################################### + +Module encryption/md5 + + # EnableAnopeWorkaround [OPTIONAL] + # Enables a workaround for encrypted passwords imported from the + # Anope or Epona programs, which have a bug (inherited from an old + # version of Services) causing passwords to be incorrectly + # encrypted. + # + # WARNING: Enabling this option may reduce the security of + # encrypted passwords! If you need this option for importing an + # Anope or Epona database, it is recommended that you enable this + # only long enough to ensure that all users have used SET PASSWORD + # to reset their passwords (possibly to the same password). + + #EnableAnopeWorkaround + +EndModule + +########################################################################### +# # Mail module configuration # ########################################################################### diff -uNr ircservices-5.0.57/defs.h ircservices-5.0.58/defs.h --- ircservices-5.0.57/defs.h 2006-01-20 12:56:34 +0900 +++ ircservices-5.0.58/defs.h 2006-06-22 01:22:40 +0900 @@ -28,6 +28,7 @@ /* Maximum number of channels to buffer modes for (for MergeChannelModes) */ #define MERGE_CHANMODES_MAX 3 + /******* NickServ configuration *******/ /* Default language for newly registered nicks; see language.h for @@ -35,16 +36,19 @@ * regional network, you should probably leave this at LANG_EN_US. */ #define DEF_LANGUAGE LANG_EN_US + /******* OperServ configuration *******/ /* Define this to enable OperServ's debugging commands (Services root * only). These commands are undocumented; "use the source, Luke!" */ /* #define DEBUG_COMMANDS */ + /*************************************************************************/ /******************* END OF USER-CONFIGURABLE SECTION ********************/ /*************************************************************************/ + /* Various buffer sizes */ /* Size of input buffer (note: this is different from BUFSIZ) diff -uNr ircservices-5.0.57/docs/2.html ircservices-5.0.58/docs/2.html --- ircservices-5.0.57/docs/2.html 2005-02-21 22:10:45 +0900 +++ ircservices-5.0.58/docs/2.html 2006-01-20 17:02:06 +0900 @@ -118,7 +118,7 @@ dreamforge Dreamforge (ircd.dal 4.6.x) dreamforge -Hybrid +IRCD-Hybrid [ircd-hybrid.com] 7.0 (**) (experimental) @@ -142,7 +142,7 @@ dreamforge UltimateIRCD 3.0.0 bahamut -Unreal +UnrealIRCd [www.unrealircd.com] 3.1.1 and above unreal diff -uNr ircservices-5.0.57/docs/5.html ircservices-5.0.58/docs/5.html --- ircservices-5.0.57/docs/5.html 2006-01-20 12:43:48 +0900 +++ ircservices-5.0.58/docs/5.html 2006-06-22 01:18:19 +0900 @@ -305,7 +305,18 @@

Anope

  • For version 1.7.11 and later, databases must be stored using the -standard ("FFF") format; MySQL databases are not supported. + standard ("FFF") format; MySQL databases are not supported. +
  • Anope (through at least version 1.7.14) contains the MD5 encryption bug + present in versions of IRC Services before 4.5; as a result, + encrypted passwords will not work by default. As a workaround, you + can enable the + EnableAnopeWorkaround + configuration option for the encryption/md5 module in + modules.conf, but be aware that this may reduce the + security of your passwords. There are also rare cases in which + passwords may be truncated in the databases; if you encounter such + a case, the password will have to be changed manually by a Services + administrator.
  • Services does not store the following information; it will be lost when the databases are converted:
      @@ -326,6 +337,24 @@
    • Nickname requests (nicknames which have been registered but not confirmed via E-mail) are discarded; users with pending nickname requests will need to re-register. +
    • By default, only basic channel modes (+i, +k, + +l, +m, +n, +p, +s, + and +t) will be imported for channel mode locks. To + import extended modes provided by particular IRC servers, use the + -ircd=type command-line option, where + type one of the following (for Anope 1.7.6 and + later, use the same name as in the IRCDModule + configuration directive): +
        +
      • bahamut for Bahamut +
      • dreamforge for Dreamforge +
      • hybrid for IRCD-Hybrid +
      • ptlink for PTlink IRCd +
      • ultimate2 for UltimateIRCD 2.x +
      • ultimate3 for UltimateIRCD 3.x +
      • unreal for UnrealIRCd +
      • viagra for Viagra IRCd +

    Auspice @@ -435,6 +464,16 @@

    Epona

      +
    • Epona contains the MD5 encryption bug present in versions of IRC + Services before 4.5; as a result, encrypted passwords will not work + by default. As a workaround, you can enable the + EnableAnopeWorkaround + configuration option for the encryption/md5 module in + modules.conf, but be aware that this may reduce the + security of your passwords. There are also rare cases in which + passwords may be truncated in the databases; if you encounter such + a case, the password will have to be changed manually by a Services + administrator.
    • Services does not store the following information; it will be lost when the databases are converted:
        @@ -443,6 +482,16 @@
    • Services does not distinguish between using the ChanServ OP, VOICE, and related commands on oneself or on other users. +
    • By default, only basic channel modes (+i, +k, + +l, +m, +n, +p, +s, + and +t) will be imported for channel mode locks. To + import extended modes provided by particular IRC servers, use one + of the following command-line options: +
        +
      • -ircd=bahamut for Bahamut +
      • -ircd=ultimate2 for UltimateIRCD +
      • -ircd=unreal for UnrealIRCd +

    HybServ diff -uNr ircservices-5.0.57/docs/a.html ircservices-5.0.58/docs/a.html --- ircservices-5.0.57/docs/a.html 2004-11-22 19:57:53 +0900 +++ ircservices-5.0.58/docs/a.html 2006-06-22 01:16:31 +0900 @@ -16,6 +16,7 @@
    A-2. Module configuration directives (modules.conf)
        protocol/* +
        encryption/md5
        mail/main
        mail/sendmail
        mail/smtp @@ -651,6 +652,31 @@


    +

    Encryption module configuration

    + +


    + +

    encryption/md5 + + +

    • +EnableAnopeWorkaround    [OPTIONAL] +

      Enables a workaround for encrypted passwords imported from the +Anope or Epona programs, which have a bug (inherited from an old +version of Services) causing passwords to be incorrectly +encrypted. + +

      WARNING: Enabling this option may reduce the security of +encrypted passwords! If you need this option for importing an +Anope or Epona database, it is recommended that you enable this +only long enough to ensure that all users have used SET PASSWORD +to reset their passwords (possibly to the same password). + +

      Example: EnableAnopeWorkaround +

    + +


    +

    Mail module configuration


    diff -uNr ircservices-5.0.57/lang/Makefile ircservices-5.0.58/lang/Makefile --- ircservices-5.0.57/lang/Makefile 2006-01-20 12:56:34 +0900 +++ ircservices-5.0.58/lang/Makefile 2006-06-22 01:22:40 +0900 @@ -50,15 +50,15 @@ langstrs.h: index Makefile - @perl -e $@.new '\ - print STDERR "Generating langstrs.h... "; \ - $$i=0; \ - while (<>) { \ - chop; \ - printf "#define %-32s %d\n", $$_, $$i++; \ - } \ - print "\n#define NUM_STRINGS $$i\n"; \ - print STDERR "$$i strings\n";' + @perl $@.new \ + -e ' print STDERR "Generating langstrs.h... "; ' \ + -e ' $$i=0; ' \ + -e ' while (<>) { ' \ + -e ' chop; ' \ + -e ' printf "#define %-32s %d\n", $$_, $$i++; ' \ + -e ' } ' \ + -e ' print "\n#define NUM_STRINGS $$i\n"; ' \ + -e ' print STDERR "$$i strings\n"; ' @if cmp $@ $@.new >/dev/null 2>&1 ; then \ echo "$@ unchanged" ; \ rm -f $@.new ; \ diff -uNr ircservices-5.0.57/modules/encryption/md5.c ircservices-5.0.58/modules/encryption/md5.c --- ircservices-5.0.57/modules/encryption/md5.c 2006-01-20 12:56:36 +0900 +++ ircservices-5.0.58/modules/encryption/md5.c 2006-06-22 01:22:41 +0900 @@ -16,7 +16,14 @@ static Module *module; +/* Enable a workaround for Anope/Epona broken MD5 passwords? */ +static int EnableAnopeWorkaround = 0; + +/* For the Anope hack: */ +#define XTOI(c) ((c)>9 ? (c)-'A'+10 : (c)-'0') + /*************************************************************************/ +/*======== Beginning of md5c.c ========*/ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. @@ -331,12 +338,11 @@ (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); } +/*======== End of md5c.c ========*/ /*************************************************************************/ /* Our own high-level routines. See encrypt.h for documentation. */ -#define XTOI(c) ((c)>9 ? (c)-'A'+10 : (c)-'0') - static int md5_encrypt(const char *src, int len, char *dest, int size) { MD5_CTX context; @@ -376,11 +382,19 @@ static int md5_check_password(const char *plaintext, const char *password) { char buf[BUFSIZE]; + char tmpbuf[8]; + int i; if (encrypt(plaintext, strlen(plaintext), buf, sizeof(buf)) < 0) return -1; if (memcmp(buf, password, 16) == 0) return 1; + if (EnableAnopeWorkaround) { + for (i = 0; i < 16; i += 2) + tmpbuf[i/2] = XTOI(buf[i])<<4 | XTOI(buf[i+1]); + if (memcmp(tmpbuf, password, 8) == 0) + return 1; + } return 0; } @@ -391,6 +405,7 @@ const int32 module_version = MODULE_VERSION_CODE; ConfigDirective module_config[] = { + { "EnableAnopeWorkaround", { {CD_SET, 0, &EnableAnopeWorkaround} } }, { NULL } }; diff -uNr ircservices-5.0.57/tools/convert-db.c ircservices-5.0.58/tools/convert-db.c --- ircservices-5.0.57/tools/convert-db.c 2006-01-20 12:56:35 +0900 +++ ircservices-5.0.58/tools/convert-db.c 2006-06-22 01:22:40 +0900 @@ -173,7 +173,7 @@ snprintf(filename, sizeof(filename), "%s/%s", dir, name); f = open_db(filename, "r", 0); if (!f) { - fprintf(stderr, "Can't open %s for reading: %s", filename, + fprintf(stderr, "Can't open %s for reading: %s\n", filename, strerror(errno)); exit(1); } @@ -591,10 +591,15 @@ /* Make sure all access entries have non-empty user and host parts. */ ARRAY_FOREACH (i, ngi->access) { - s = strchr(ngi->access[i], '@'); - if (!s || s==ngi->access[i] || !s[1]) { - fprintf(stderr, "Access entry %d for nickgroup %u isn't a" - " valid user@host mask, deleting.\n", i, ngi->id); + if (!ngi->access[i] + || !(s = strchr(ngi->access[i], '@')) + || s == ngi->access[i] + || !s[1] + ) { + fprintf(stderr, "Access entry %d for nickgroup %u %s," + " deleting.\n", i, ngi->id, + !ngi->access ? "is empty" + : "isn't a valid user@host mask"); ARRAY_REMOVE(ngi->access, i); i--; } diff -uNr ircservices-5.0.57/tools/convert-epona.c ircservices-5.0.58/tools/convert-epona.c --- ircservices-5.0.57/tools/convert-epona.c 2006-01-20 12:56:35 +0900 +++ ircservices-5.0.58/tools/convert-epona.c 2006-06-22 01:22:40 +0900 @@ -17,6 +17,44 @@ # error PASSMAX too small (must be >=32) #endif +/* Server type selected with -ircd=XXX */ +static enum servertype_enum { + IRCD_UNKNOWN = 0, + IRCD_BAHAMUT, /* or dreamforge, solidircd */ + IRCD_INSPIRCD, + IRCD_PLEXUS, + IRCD_PTLINK, + IRCD_RAGE, + IRCD_SHADOW, + IRCD_ULTIMATE2, + IRCD_ULTIMATE3, + IRCD_UNREAL, + IRCD_VIAGRA, +} servertype = IRCD_UNKNOWN; + +/* Option names for -ircd=XXXX */ +static struct { + const char *name; + enum servertype_enum type; +} servertype_names[] = { + { "bahamut", IRCD_BAHAMUT }, + { "dreamforge", IRCD_BAHAMUT }, /* +R/+r only */ + { "hybrid", IRCD_UNKNOWN }, /* no special modes */ + { "inspircd", IRCD_INSPIRCD }, + { "plexus", IRCD_PLEXUS }, + { "ptlink", IRCD_PTLINK }, + { "rageircd", IRCD_RAGE }, + { "ratbox", IRCD_UNKNOWN }, /* no special modes */ + { "shadowircd", IRCD_SHADOW }, + { "solidircd", IRCD_BAHAMUT }, /* shared modes */ + { "ultimate2", IRCD_ULTIMATE2 }, + { "ultimate3", IRCD_ULTIMATE3 }, + { "unreal31", IRCD_UNREAL }, + { "unreal32", IRCD_UNREAL }, + { "viagra", IRCD_VIAGRA }, + { NULL } +}; + /*************************************************************************/ static void epona_load_nick(const char *sourcedir) @@ -195,7 +233,7 @@ static struct { int32 flag; char mode; -} epona_cmodes[] = { +} epona_cmodes_common[] = { { 0x00000001, 'i' }, { 0x00000002, 'm' }, { 0x00000004, 'n' }, @@ -204,14 +242,28 @@ { 0x00000020, 't' }, { 0x00000040, 'k' }, { 0x00000080, 'l' }, + { 0, 0 } +}, epona_cmodes_none[] = { /* for servers with no special modes */ + { 0, 0 } +}, epona_cmodes_bahamut[] = { /* also for dreamforge, solidircd */ { 0x00000100, 'R' }, { 0x00000200, 0 }, /* 'r', never set in mlock */ { 0x00000400, 'c' }, + { 0x00000800, 'M' }, + { 0x00001000, 'j' }, + { 0x00002000, 'S' }, + { 0x00004000, 'N' }, { 0x00008000, 'O' }, + { 0, 0 } +}, epona_cmodes_inspircd[] = { + { 0x00000100, 'R' }, + { 0x00000200, 0 }, /* 'r', never set in mlock */ + { 0x00000400, 'c' }, { 0x00000800, 'A' }, { 0x00001000, 'H' }, { 0x00002000, 'K' }, { 0x00004000, 'L' }, + { 0x00008000, 'O' }, { 0x00010000, 'Q' }, { 0x00020000, 'S' }, { 0x00040000, 'V' }, @@ -219,9 +271,133 @@ { 0x00100000, 'G' }, { 0x00200000, 'C' }, { 0x00400000, 'u' }, + { 0x00800000, 'z' }, + { 0x01000000, 'N' }, + { 0, 0 } +}, epona_cmodes_plexus[] = { + { 0x00000400, 'a' }, + { 0x00000800, 'Z' }, + { 0x00001000, 'M' }, + { 0x00002000, 'c' }, + { 0x00004000, 'O' }, + { 0x00008000, 'R' }, + { 0x00010000, 'N' }, { 0, 0 } +}, epona_cmodes_ptlink[] = { + { 0x00000100, 'R' }, + { 0x00000200, 0 }, /* 'r', never set in mlock */ + { 0x00000400, 'A' }, + { 0x00000800, 'B' }, + { 0x00001000, 'c' }, + { 0x00002000, 'd' }, + { 0x00004000, 'f' }, + { 0x00008000, 'K' }, + { 0x00010000, 'O' }, + { 0x00020000, 'q' }, + { 0x00040000, 'S' }, + { 0x00080000, 'N' }, + { 0, 0 } +}, epona_cmodes_rage[] = { + { 0x00000100, 'R' }, + { 0x00000200, 0 }, /* 'r', never set in mlock */ + { 0x00000400, 'c' }, + { 0x00000800, 'M' }, + { 0x00001000, 'N' }, + { 0x00002000, 'S' }, + { 0x00004000, 'C' }, + { 0x00008000, 'A' }, + { 0x00010000, 'O' }, + { 0, 0 } +}, epona_cmodes_shadow[] = { + { 0x00000100, 'K' }, + { 0x00000200, 'A' }, + { 0x00000400, 0 }, /* 'r', never set in mlock */ + { 0x00000800, 'z' }, + { 0x00001000, 'S' }, + { 0x00002000, 'c' }, + { 0x00004000, 'E' }, + { 0x00008000, 'F' }, + { 0x00010000, 'G' }, + { 0x00020000, 'L' }, + { 0x00040000, 'N' }, + { 0x00080000, 'O' }, + { 0x00100000, 'P' }, + { 0x00200000, 'R' }, + { 0x00400000, 'T' }, + { 0x00800000, 'V' }, + { 0, 0 } +}, epona_cmodes_ultimate2[] = { + { 0x00000100, 'R' }, + { 0x00000200, 0 }, /* 'r', never set in mlock */ + { 0x00000400, 'f' }, + { 0x00000800, 'x' }, + { 0x00001000, 'A' }, + { 0x00002000, 'I' }, + { 0x00004000, 'K' }, + { 0x00008000, 'L' }, + { 0x00010000, 'O' }, + { 0x00020000, 'S' }, + { 0, 0 } +}, epona_cmodes_ultimate3[] = { + { 0x00000100, 'R' }, + { 0x00000200, 0 }, /* 'r', never set in mlock */ + { 0x00000400, 'c' }, + { 0x00000800, 'A' }, + { 0x00001000, 'N' }, + { 0x00002000, 'S' }, + { 0x00004000, 'K' }, + { 0x00008000, 'O' }, + { 0x00010000, 'q' }, + { 0x00020000, 'M' }, + { 0, 0 } +}, epona_cmodes_unreal[] = { + { 0x00000100, 'R' }, + { 0x00000200, 0 }, /* 'r', never set in mlock */ + { 0x00000400, 'c' }, + { 0x00000800, 'A' }, + { 0x00001000, 'H' }, + { 0x00002000, 'K' }, + { 0x00004000, 'L' }, + { 0x00008000, 'O' }, + { 0x00010000, 'Q' }, + { 0x00020000, 'S' }, + { 0x00040000, 'V' }, + { 0x00080000, 'f' }, + { 0x00100000, 'G' }, + { 0x00200000, 'C' }, + { 0x00800000, 'z' }, + { 0x01000000, 'N' }, + { 0x02000000, 'M' }, + { 0x04000000, 'T' }, + { 0, 0 } +}, epona_cmodes_viagra[] = { + { 0x00000100, 'R' }, + { 0x00000200, 0 }, /* 'r', never set in mlock */ + { 0x00000400, 'c' }, + { 0x00000800, 'M' }, + { 0x00001000, 'H' }, + { 0x00008000, 'O' }, + { 0x00020000, 'S' }, + { 0x01000000, 'N' }, + { 0x02000000, 'P' }, + { 0x04000000, 'x' }, + { 0, 0 } +}, *epona_cmode_index[] = { + /* IRCD_UNKNOWN */ epona_cmodes_none, + /* IRCD_BAHAMUT */ epona_cmodes_bahamut, + /* IRCD_INSPIRCD */ epona_cmodes_inspircd, + /* IRCD_PLEXUS */ epona_cmodes_plexus, + /* IRCD_PTLINK */ epona_cmodes_ptlink, + /* IRCD_RAGE */ epona_cmodes_rage, + /* IRCD_SHADOW */ epona_cmodes_shadow, + /* IRCD_ULTIMATE2 */ epona_cmodes_ultimate2, + /* IRCD_ULTIMATE3 */ epona_cmodes_ultimate3, + /* IRCD_UNREAL */ epona_cmodes_unreal, + /* IRCD_VIAGRA */ epona_cmodes_viagra, }; +/************************************/ + static void epona_load_chan(const char *sourcedir) { dbFILE *f; @@ -232,7 +408,7 @@ int32 tmp32, mlock_on, mlock_off; char *on, *off; - f = open_db_ver(sourcedir, "chan.db", 14, 16, &ver); + f = open_db_ver(sourcedir, "chan.db", 14, 17, &ver); for (i = 0; i < 256; i++) { int16 tmp16; @@ -382,15 +558,39 @@ SAFE(read_int32(&mlock_off, f)); ci->mlock_on = on = scalloc(64, 1); ci->mlock_off = off = scalloc(64, 1); - for (j = 0; epona_cmodes[j].flag != 0; j++) { - if (mlock_on & epona_cmodes[j].flag) - *on++ = epona_cmodes[j].mode; - if (mlock_off & epona_cmodes[j].flag) - *off++ = epona_cmodes[j].mode; + for (j = 0; epona_cmodes_common[j].flag != 0; j++) { + if (mlock_on & epona_cmodes_common[j].flag) + *on++ = epona_cmodes_common[j].mode; + if (mlock_off & epona_cmodes_common[j].flag) + *off++ = epona_cmodes_common[j].mode; + } + for (j = 0; epona_cmode_index[servertype][j].flag != 0; j++) { + if (mlock_on & epona_cmode_index[servertype][j].flag) + *on++ = epona_cmode_index[servertype][j].mode; + if (mlock_off & epona_cmode_index[servertype][j].flag) + *off++ = epona_cmode_index[servertype][j].mode; } SAFE(read_int32(&ci->mlock_limit, f)); SAFE(read_string(&ci->mlock_key, f)); SAFE(read_string(&ci->mlock_flood, f)); + if (ver >= 17) { + char *s; + SAFE(read_string(&s, f)); + if (s) { + unsigned long rate1, rate2; + if (sscanf(s, "%lu:%lu", &rate1, &rate2) == 2 + && rate1 > 0 && rate1 < 0x7FFFFFFFUL + && rate2 > 0 && rate2 < 0x7FFFFFFFUL + ) { + ci->mlock_joinrate1 = rate1; + ci->mlock_joinrate2 = rate2; + } else { + fprintf(stderr, "MLOCK +j setting for %s is" + " invalid, discarding", ci->name); + } + free(s); + } + } SAFE(read_string(&ci->mlock_link, f)); SAFE(read_int16(&ci->memos.memos_count, f)); @@ -631,10 +831,12 @@ ver |= fgetc(f)<<16; ver |= fgetc(f)<< 8; ver |= fgetc(f); + fclose(f); switch (ver) { case 14: return "Epona 1.3.x"; case 15: return "Epona 1.4.0"; - case 16: return "Epona/Anope 1.4.1+"; + case 16: return "Epona 1.4.1-1.4.14 / Anope"; + case 17: return "Epona 1.4.15+"; } } } @@ -643,10 +845,31 @@ static void load_epona(const char *sourcedir, int verbose, int ac, char **av) { - if (ac > 1) { - fprintf(stderr, "Unrecognized option %s\n", av[1]); - usage(av[0]); + int i; + + for (i = 1; i < ac; i++) { + if (strncmp(av[i],"-ircd=",6) == 0) { + const char *ircd = av[i]+6; + int j; + for (j = 0; servertype_names[j].name != NULL; j++) { + if (stricmp(servertype_names[j].name, ircd) == 0) + break; + } + if (servertype_names[j].name) { + servertype = servertype_names[j].type; + } else { + fprintf(stderr, "Unrecognized IRC server type %s\n", ircd); + fprintf(stderr, "Valid IRC server types are:\n"); + for (j = 0; servertype_names[j].name != NULL; j++) + fprintf(stderr, " %s\n", servertype_names[j].name); + exit(1); + } + } else { + fprintf(stderr, "Unrecognized option %s\n", av[i]); + usage(av[0]); + } } + if (verbose) fprintf(stderr, "Loading nick.db...\n"); epona_load_nick(sourcedir); diff -uNr ircservices-5.0.57/version.sh ircservices-5.0.58/version.sh --- ircservices-5.0.57/version.sh 2006-01-20 12:52:05 +0900 +++ ircservices-5.0.58/version.sh 2006-06-22 01:20:38 +0900 @@ -6,7 +6,7 @@ # $PROGRAM is the string returned as the first part of a /VERSION reply, # and must not contain spaces. It is not used anywhere else. PROGRAM=ircservices -VERSION=5.0.57 +VERSION=5.0.58 # Increment Services build number if [ -f version.c ] ; then