]> jfr.im git - irc/unrealircd/unrealircd.git/commitdiff
beta4
authorstskeeps <redacted>
Sun, 28 Oct 2001 16:25:13 +0000 (16:25 +0000)
committerstskeeps <redacted>
Sun, 28 Oct 2001 16:25:13 +0000 (16:25 +0000)
30 files changed:
.RELEASE.NOTES
Changes
include/h.h
include/nameser.h
include/struct.h
include/version.h
makefile.win32
src/Makefile
src/ircd.c
src/list.c
src/modules/l_commands.c
src/modules/m_message.c
src/modules/m_svsmode.c
src/modules/m_who.c
src/modules/scan.c
src/modules/scan_http.c
src/modules/scan_socks.c
src/packet.c
src/parse.c
src/res.c
src/res_init.c
src/res_mkquery.c
src/s_bsd.c
src/s_conf.c
src/s_debug.c
src/s_unreal.c
src/s_user.c
src/ssl.rnd
src/umodes.c [new file with mode: 0644]
src/win32/config.c [new file with mode: 0644]

index c4bc462b71cbe1d6f74d94691a9e4359399499ec..30d3ea42ee6d4d4afca5647fa02b8c86dfacee37 100644 (file)
@@ -1,5 +1,5 @@
 
-Unreal3.2-Selene (BETA2) RELEASE NOTES
+Unreal3.2-Selene (BETA4) RELEASE NOTES
 ======================================
     
      I M P O R T A N T   R E A D I N G
diff --git a/Changes b/Changes
index addd19506fe3c676edd7ab4d95cc94c2e2f7a6e8..0c6bce34578a386caed73eaefdb5b42e5181fa00 100644 (file)
--- a/Changes
+++ b/Changes
@@ -869,3 +869,22 @@ seen. gmtime warning still there
 - Fixed a typo in config.h
 - Final changes to prepare for beta3
 - Fixed some bugreport stuff
+- Fixed codemastr-on-crack bug regarding oflag
+- Fixed a win32 bug where the http scanner didn't get loaded
+- Hopefully fixed the weird Z:line bug on win32?
+- Fixed the Z:line bug (caused by stskeeps-on-crack coding) reported by Power2All
+- Removed the tokens for /users, /summon, and /samode (these never come from a server so they don't need
+  it)
+- Added a utility to auto create version.c for win32. It's the worst coding I've ever done, but it works :P
+- Added a hell lot of DNS debugging code, and fixed the BIGENDIAN problem
+  with resolver. Thanks to dawn and Trash.net for shell on a sparc
+- Added umodes.c, long val = get_umode('c');
+- Added new umode system to win32 makefile
+- Made umode_delete(flag, mode);
+- made the umodestring variable smaller to conserve memory
+- Added M_RESETIDLE to fix a /privmsg bug
+- Fixed a bug with nickserv passwords found and fixed by Mathieu
+- Fixed a DEBUGMODE problem with umodes.c
+- Fixed a snomask bug found by Rob
+- Made the missing commands error a little more.. tardfriendly
+- Preperation for beta4
index a98d18f19edf8f693fb3fddb1065fba8e4abee6e..34b72b9733a48acf8af2efeadc9793423545d872 100644 (file)
@@ -277,6 +277,8 @@ extern aClient *next_client(aClient *, char *);
 extern int m_umode(aClient *, aClient *, int, char **);
 extern int m_names(aClient *, aClient *, int, char **);
 extern int m_server_estab(aClient *);
+extern void umode_init(void);
+extern long umode_get(char ch);
 extern void send_umode(aClient *, aClient *, long, long, char *);
 extern void send_umode_out(aClient *, aClient *, long);
 
@@ -333,6 +335,38 @@ extern char *find_server_aln(char *);
 extern atime(char *xtime);
 
 
+/* Mode externs
+*/
+extern long UMODE_INVISIBLE; /*  0x0001         makes user invisible */
+extern long UMODE_OPER;      /*  0x0002         Operator */
+extern long UMODE_WALLOP;    /*  0x0004         send wallops to them */
+extern long UMODE_FAILOP;    /*  0x0008         Shows some global messages */
+extern long UMODE_HELPOP;    /*  0x0010         Help system operator */
+extern long UMODE_REGNICK;   /*  0x0020         Nick set by services as registered */
+extern long UMODE_SADMIN;    /*  0x0040         Services Admin */
+extern long UMODE_ADMIN;     /*  0x0080         Admin */
+extern long UMODE_SERVNOTICE;/* 0x0100  server notices such as kill */
+extern long UMODE_LOCOP;     /* 0x0200  Local operator -- SRB */
+extern long UMODE_RGSTRONLY; /* 0x0400  Only reg nick message */
+extern long UMODE_WEBTV;     /* 0x0800  WebTV Client */
+extern long UMODE_SERVICES;  /* 0x4000  services */
+extern long UMODE_HIDE;             /* 0x8000   Hide from Nukes */
+extern long UMODE_NETADMIN;  /* 0x10000         Network Admin */
+extern long UMODE_TECHADMIN; /* 0x40000         Tech Admin */
+extern long UMODE_COADMIN;   /* 0x80000         Co Admin */
+extern long UMODE_WHOIS;     /* 0x100000        gets notice on /whois */
+extern long UMODE_KIX;       /* 0x200000        usermode +q */
+extern long UMODE_BOT;       /* 0x400000        User is a bot */
+extern long UMODE_SECURE;    /*        0x800000         User is a secure connect */
+extern long UMODE_HIDING;    /* 0x2000000       Totally invisible .. */
+extern long UMODE_VICTIM;    /* 0x8000000       Intentional Victim */
+extern long UMODE_DEAF;      /* 0x10000000       Deaf */
+extern long UMODE_HIDEOPER;  /* 0x20000000      Hide oper mode */
+extern long UMODE_SETHOST;   /* 0x40000000      used sethost */
+extern long UMODE_STRIPBADWORDS; /* 0x80000000  */
+
+
+
 extern int dopacket(aClient *, char *, int);
 
 extern void debug(int, char *, ...);
index abe429bd1a65bf053f1230874f02dcf33c544ab7..f1bf7316f7600aaf7a128bcc0e7ede612e8b2ffc 100644 (file)
  *    documentation and/or other materials provided with the distribution.
  * 3. All advertising materials mentioning features or use of this software
  *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
+ *      This product includes software developed by the University of
+ *      California, Berkeley and its contributors.
  * 4. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS `AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  */
 
 /*
- *      @(#)nameser.h  8.1 (Berkeley) 6/2/93
- *     $Id$
+ *      @(#)nameser.h   8.1 (Berkeley) 6/2/93
+ *      $NetBSD: nameser.h,v 1.14 2000/08/09 14:41:00 itojun Exp $
  */
 
+#ifndef _ARPA_NAMESER_H_
+#define _ARPA_NAMESER_H_
+
+#include <sys/param.h>
+
+#ifdef _AUX_SOURCE
+# include <sys/types.h>
+#endif
+
 /*
  * revision information.  this is the release date in YYYYMMDD format.
  * it can change every day so the right thing to do with it is use it
  * is new enough to contain a certain feature.
  */
 
-#define __BIND         19960801        /* interface version stamp */
+#define __BIND          19960801        /* interface version stamp */
 
 /*
  * Define constants based on rfc883
  */
-#define PACKETSZ       512             /* maximum packet size */
-#define MAXDNAME       1025            /* maximum presentation domain name */
-#define MAXCDNAME      255             /* maximum compressed domain name */
-#define MAXLABEL       63              /* maximum length of domain label */
-#define HFIXEDSZ       12              /* #/bytes of fixed data in header */
-#define QFIXEDSZ       4               /* #/bytes of fixed data in query */
-#define RRFIXEDSZ      10              /* #/bytes of fixed data in r record */
-#define INT32SZ                4               /* for systems without 32-bit ints */
-#define INT16SZ                2               /* for systems without 16-bit ints */
-#define INADDRSZ       4               /* IPv4 T_A */
-#define IN6ADDRSZ      16              /* IPv6 T_AAAA */
+#define PACKETSZ        512                /* maximum packet size */
+#define MAXDNAME        1025                /* maximum presentation domain name */
+#define MAXCDNAME       255                /* maximum compressed domain name */
+#define MAXLABEL        63                /* maximum length of domain label */
+#define HFIXEDSZ        12                /* #/bytes of fixed data in header */
+#define QFIXEDSZ        4                /* #/bytes of fixed data in query */
+#define RRFIXEDSZ       10                /* #/bytes of fixed data in r record */
+#define INT32SZ                        /* for systems without 32-bit ints */
+#define INT16SZ                        /* for systems without 16-bit ints */
+#define INADDRSZ        4                /* IPv4 T_A */
+#define IN6ADDRSZ       16                /* IPv6 T_AAAA */
 
 /*
  * Internet nameserver port number
  */
-#define NAMESERVER_PORT        53
+#define NAMESERVER_PORT 53
 
 /*
  * Currently defined opcodes
  */
-#define QUERY          0x0             /* standard query */
-#define IQUERY         0x1             /* inverse query */
-#define STATUS         0x2             /* nameserver status query */
-/*#define xxx          0x3*/           /* 0x3 reserved */
-#define NS_NOTIFY_OP   0x4             /* notify secondary of SOA change */
+#define QUERY           0x0                /* standard query */
+#define IQUERY          0x1                /* inverse query */
+#define STATUS          0x2                /* nameserver status query */
+/*#define xxx           0x3*/                /* 0x3 reserved */
+#define NS_NOTIFY_OP    0x4                /* notify secondary of SOA change */
 /*
  * Currently defined response codes
  */
-#define NOERROR                0               /* no error */
-#define FORMERR                1               /* format error */
-#define SERVFAIL       2               /* server failure */
-#define NXDOMAIN       3               /* non existent domain */
-#define NOTIMP         4               /* not implemented */
-#define REFUSED                5               /* query refused */
+#define NOERROR                        /* no error */
+#define FORMERR                        /* format error */
+#define SERVFAIL        2                /* server failure */
+#define NXDOMAIN        3                /* non existent domain */
+#define NOTIMP          4                /* not implemented */
+#define REFUSED                        /* query refused */
 
 /*
  * Type values for resources and queries
  */
-#define T_A            1               /* host address */
-#define T_NS           2               /* authoritative server */
-#define T_MD           3               /* mail destination */
-#define T_MF           4               /* mail forwarder */
-#define T_CNAME                5               /* canonical name */
-#define T_SOA          6               /* start of authority zone */
-#define T_MB           7               /* mailbox domain name */
-#define T_MG           8               /* mail group member */
-#define T_MR           9               /* mail rename name */
-#define T_NULL         10              /* null resource record */
-#define T_WKS          11              /* well known service */
-#define T_PTR          12              /* domain name pointer */
-#define T_HINFO                13              /* host information */
-#define T_MINFO                14              /* mailbox information */
-#define T_MX           15              /* mail routing information */
-#define T_TXT          16              /* text strings */
-#define T_RP           17              /* responsible person */
-#define T_AFSDB                18              /* AFS cell database */
-#define T_X25          19              /* X_25 calling address */
-#define T_ISDN         20              /* ISDN calling address */
-#define T_RT           21              /* router */
-#define T_NSAP         22              /* NSAP address */
-#define T_NSAP_PTR     23              /* reverse NSAP lookup (deprecated) */
-#define T_SIG          24              /* security signature */
-#define T_KEY          25              /* security key */
-#define T_PX           26              /* X.400 mail mapping */
-#define T_GPOS         27              /* geographical position (withdrawn) */
-#define T_AAAA         28              /* IP6 Address */
-#define T_LOC          29              /* Location Information */
-#define T_NXT          30              /* Next Valid Name in Zone */
-#define T_EID          31              /* Endpoint identifier */
-#define T_NIMLOC       32              /* Nimrod locator */
-#define T_SRV          33              /* Server selection */
-#define T_ATMA         34              /* ATM Address */
-#define T_NAPTR                35              /* Naming Authority PoinTeR */
-       /* non standard */
-#define T_UINFO                100             /* user (finger) information */
-#define T_UID          101             /* user ID */
-#define T_GID          102             /* group ID */
-#define T_UNSPEC       103             /* Unspecified format (binary data) */
-       /* Query type values which do not appear in resource records */
-#define        T_IXFR          251             /* incremental zone transfer */
-#define T_AXFR         252             /* transfer zone of authority */
-#define T_MAILB                253             /* transfer mailbox records */
-#define T_MAILA                254             /* transfer mail agent records */
-#define T_ANY          255             /* wildcard match */
+#define T_A             1                /* host address */
+#define T_NS            2                /* authoritative server */
+#define T_MD            3                /* mail destination */
+#define T_MF            4                /* mail forwarder */
+#define T_CNAME         5                /* canonical name */
+#define T_SOA           6                /* start of authority zone */
+#define T_MB            7                /* mailbox domain name */
+#define T_MG            8                /* mail group member */
+#define T_MR            9                /* mail rename name */
+#define T_NULL          10                /* null resource record */
+#define T_WKS           11                /* well known service */
+#define T_PTR           12                /* domain name pointer */
+#define T_HINFO         13                /* host information */
+#define T_MINFO         14                /* mailbox information */
+#define T_MX            15                /* mail routing information */
+#define T_TXT           16                /* text strings */
+#define T_RP            17                /* responsible person */
+#define T_AFSDB         18                /* AFS cell database */
+#define T_X25           19                /* X_25 calling address */
+#define T_ISDN          20                /* ISDN calling address */
+#define T_RT            21                /* router */
+#define T_NSAP          22                /* NSAP address */
+#define T_NSAP_PTR      23                /* reverse NSAP lookup (deprecated) */
+#define T_SIG           24                /* security signature */
+#define T_KEY           25                /* security key */
+#define T_PX            26                /* X.400 mail mapping */
+#define T_GPOS          27                /* geographical position (withdrawn) */
+#define T_AAAA          28                /* IP6 Address */
+#define T_LOC           29                /* Location Information */
+#define T_NXT           30                /* Next Valid Name in Zone */
+#define T_EID           31                /* Endpoint identifier */
+#define T_NIMLOC        32                /* Nimrod locator */
+#define T_SRV           33                /* Server selection */
+#define T_ATMA          34                /* ATM Address */
+#define T_NAPTR         35                /* Naming Authority PoinTeR */
+#define T_OPT           41                /* OPT pseudo-RR, RFC2761 */
+        /* non standard */
+#define T_UINFO         100                /* user (finger) information */
+#define T_UID           101                /* user ID */
+#define T_GID           102                /* group ID */
+#define T_UNSPEC        103                /* Unspecified format (binary data) */
+        /* Query type values which do not appear in resource records */
+#define T_IXFR                251                /* incremental zone transfer */
+#define T_AXFR          252                /* transfer zone of authority */
+#define T_MAILB         253                /* transfer mailbox records */
+#define T_MAILA         254                /* transfer mail agent records */
+#define T_ANY           255                /* wildcard match */
 
 /*
  * Values for class field
  */
 
-#define C_IN           1               /* the arpa internet */
-#define C_CHAOS                3               /* for chaos net (MIT) */
-#define C_HS           4               /* for Hesiod name server (MIT) (XXX) */
-       /* Query class values which do not appear in resource records */
-#define C_ANY          255             /* wildcard match */
+#define C_IN            1                /* the arpa internet */
+#define C_CHAOS                        /* for chaos net (MIT) */
+#define C_HS            4                /* for Hesiod name server (MIT) (XXX) */
+        /* Query class values which do not appear in resource records */
+#define C_ANY           255                /* wildcard match */
 
 /*
  * Flags field of the KEY RR rdata
  */
-#define        KEYFLAG_TYPEMASK        0xC000  /* Mask for "type" bits */
-#define        KEYFLAG_TYPE_AUTH_CONF  0x0000  /* Key usable for both */
-#define        KEYFLAG_TYPE_CONF_ONLY  0x8000  /* Key usable for confidentiality */
-#define        KEYFLAG_TYPE_AUTH_ONLY  0x4000  /* Key usable for authentication */
-#define        KEYFLAG_TYPE_NO_KEY     0xC000  /* No key usable for either; no key */
+#define KEYFLAG_TYPEMASK        0xC000        /* Mask for "type" bits */
+#define KEYFLAG_TYPE_AUTH_CONF        0x0000        /* Key usable for both */
+#define KEYFLAG_TYPE_CONF_ONLY        0x8000        /* Key usable for confidentiality */
+#define KEYFLAG_TYPE_AUTH_ONLY        0x4000        /* Key usable for authentication */
+#define KEYFLAG_TYPE_NO_KEY        0xC000        /* No key usable for either; no key */
 /* The type bits can also be interpreted independently, as single bits: */
-#define        KEYFLAG_NO_AUTH         0x8000  /* Key not usable for authentication */
-#define        KEYFLAG_NO_CONF         0x4000  /* Key not usable for confidentiality */
-
-#define        KEYFLAG_EXPERIMENTAL    0x2000  /* Security is *mandatory* if bit=0 */
-#define        KEYFLAG_RESERVED3       0x1000  /* reserved - must be zero */
-#define        KEYFLAG_RESERVED4       0x0800  /* reserved - must be zero */
-#define        KEYFLAG_USERACCOUNT     0x0400  /* key is assoc. with a user acct */
-#define        KEYFLAG_ENTITY          0x0200  /* key is assoc. with entity eg host */
-#define        KEYFLAG_ZONEKEY         0x0100  /* key is zone key for the zone named */
-#define        KEYFLAG_IPSEC           0x0080  /* key is for IPSEC use (host or user)*/
-#define        KEYFLAG_EMAIL           0x0040  /* key is for email (MIME security) */
-#define        KEYFLAG_RESERVED10      0x0020  /* reserved - must be zero */
-#define        KEYFLAG_RESERVED11      0x0010  /* reserved - must be zero */
-#define        KEYFLAG_SIGNATORYMASK   0x000F  /* key can sign DNS RR's of same name */
+#define KEYFLAG_NO_AUTH                0x8000        /* Key not usable for authentication */
+#define KEYFLAG_NO_CONF                0x4000        /* Key not usable for confidentiality */
+
+#define KEYFLAG_EXPERIMENTAL        0x2000        /* Security is *mandatory* if bit=0 */
+#define KEYFLAG_RESERVED3        0x1000  /* reserved - must be zero */
+#define KEYFLAG_RESERVED4        0x0800  /* reserved - must be zero */
+#define KEYFLAG_USERACCOUNT        0x0400        /* key is assoc. with a user acct */
+#define KEYFLAG_ENTITY                0x0200        /* key is assoc. with entity eg host */
+#define KEYFLAG_ZONEKEY                0x0100        /* key is zone key for the zone named */
+#define KEYFLAG_IPSEC                0x0080  /* key is for IPSEC use (host or user)*/
+#define KEYFLAG_EMAIL                0x0040  /* key is for email (MIME security) */
+#define KEYFLAG_RESERVED10        0x0020  /* reserved - must be zero */
+#define KEYFLAG_RESERVED11        0x0010  /* reserved - must be zero */
+#define KEYFLAG_SIGNATORYMASK        0x000F        /* key can sign DNS RR's of same name */
 
 #define  KEYFLAG_RESERVED_BITMASK ( KEYFLAG_RESERVED3 | \
-                                   KEYFLAG_RESERVED4 | \
-                                   KEYFLAG_RESERVED10| KEYFLAG_RESERVED11) 
+                                    KEYFLAG_RESERVED4 | \
+                                    KEYFLAG_RESERVED10| KEYFLAG_RESERVED11) 
 
 /* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
-#define        ALGORITHM_MD5RSA        1       /* MD5 with RSA */
-#define        ALGORITHM_EXPIRE_ONLY   253     /* No alg, no security */
-#define        ALGORITHM_PRIVATE_OID   254     /* Key begins with OID indicating alg */
+#define ALGORITHM_MD5RSA        1        /* MD5 with RSA */
+#define ALGORITHM_EXPIRE_ONLY        253        /* No alg, no security */
+#define ALGORITHM_PRIVATE_OID        254        /* Key begins with OID indicating alg */
 
 /* Signatures */
-                                       /* Size of a mod or exp in bits */
-#define        MIN_MD5RSA_KEY_PART_BITS         512
-#define        MAX_MD5RSA_KEY_PART_BITS        2552
-                                       /* Total of binary mod and exp, bytes */
-#define        MAX_MD5RSA_KEY_BYTES            ((MAX_MD5RSA_KEY_PART_BITS+7/8)*2+3)
-                                       /* Max length of text sig block */
-#define        MAX_KEY_BASE64                  (((MAX_MD5RSA_KEY_BYTES+2)/3)*4)
+                                        /* Size of a mod or exp in bits */
+#define MIN_MD5RSA_KEY_PART_BITS         512
+#define MAX_MD5RSA_KEY_PART_BITS        2552
+                                        /* Total of binary mod and exp, bytes */
+#define MAX_MD5RSA_KEY_BYTES                ((MAX_MD5RSA_KEY_PART_BITS+7/8)*2+3)
+                                        /* Max length of text sig block */
+#define MAX_KEY_BASE64                        (((MAX_MD5RSA_KEY_BYTES+2)/3)*4)
 
 /*
  * Status return codes for T_UNSPEC conversion routines
  */
-#define CONV_SUCCESS   0
-#define CONV_OVERFLOW  (-1)
-#define CONV_BADFMT    (-2)
-#define CONV_BADCKSUM  (-3)
-#define CONV_BADBUFLEN (-4)
+#define CONV_SUCCESS    0
+#define CONV_OVERFLOW   (-1)
+#define CONV_BADFMT     (-2)
+#define CONV_BADCKSUM   (-3)
+#define CONV_BADBUFLEN  (-4)
+
+#ifndef BYTE_ORDER
+#if (BSD >= 199103)
+# include <machine/endian.h>
+#else
+#ifdef linux
+# include <endian.h>
+#else
+#define LITTLE_ENDIAN   1234        /* least-significant byte first (vax, pc) */
+#define BIG_ENDIAN      4321        /* most-significant byte first (IBM, net) */
+#define PDP_ENDIAN      3412        /* LSB first in word, MSW first in long (pdp)*/
+
+#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
+    defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
+    defined(__alpha__) || defined(__alpha) || defined(__vax__)
+#define BYTE_ORDER      LITTLE_ENDIAN
+#endif
+
+#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
+    defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
+    defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
+    defined(apollo) || defined(__convex__) || defined(_CRAY) || \
+    defined(__hppa) || defined(__hp9000) || \
+    defined(__hp9000s300) || defined(__hp9000s700) || \
+    defined (BIT_ZERO_ON_LEFT) || defined(m68k)
+#define BYTE_ORDER      BIG_ENDIAN
+#endif
+#endif /* linux */
+#endif /* BSD */
+#endif /* BYTE_ORDER */
+
+#if !defined(BYTE_ORDER) || \
+    (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
+    BYTE_ORDER != PDP_ENDIAN)
+        /* you must determine what the correct bit order is for
+         * your compiler - the next line is an intentional error
+         * which will force your compiles to bomb until you fix
+         * the above macros.
+         */
+  error "Undefined or invalid BYTE_ORDER";
+#endif
 
 /*
  * Structure for query header.  The order of the fields is machine- and
  */
 
 typedef struct {
-       unsigned        id :16;         /* query identification number */
-#if WORDS_BIGENDIAN
-                       /* fields in third byte */
-       unsigned        qr: 1;          /* response flag */
-       unsigned        opcode: 4;      /* purpose of message */
-       unsigned        aa: 1;          /* authoritive answer */
-       unsigned        tc: 1;          /* truncated message */
-       unsigned        rd: 1;          /* recursion desired */
-                       /* fields in fourth byte */
-       unsigned        ra: 1;          /* recursion available */
-       unsigned        unused :1;      /* unused bits (MBZ as of 4.9.3a3) */
-       unsigned        ad: 1;          /* authentic data from named */
-       unsigned        cd: 1;          /* checking disabled by resolver */
-       unsigned        rcode :4;       /* response code */
-#else /* WORDS_BIGENDIAN */
-                       /* fields in third byte */
-       unsigned        rd :1;          /* recursion desired */
-       unsigned        tc :1;          /* truncated message */
-       unsigned        aa :1;          /* authoritive answer */
-       unsigned        opcode :4;      /* purpose of message */
-       unsigned        qr :1;          /* response flag */
-                       /* fields in fourth byte */
-       unsigned        rcode :4;       /* response code */
-       unsigned        cd: 1;          /* checking disabled by resolver */
-       unsigned        ad: 1;          /* authentic data from named */
-       unsigned        unused :1;      /* unused bits (MBZ as of 4.9.3a3) */
-       unsigned        ra :1;          /* recursion available */
-#endif /* WORDS_BIGENDIAN */
-                       /* remaining bytes */
-       unsigned        qdcount :16;    /* number of question entries */
-       unsigned        ancount :16;    /* number of answer entries */
-       unsigned        nscount :16;    /* number of authority entries */
-       unsigned        arcount :16;    /* number of resource entries */
+        unsigned        id :16;                /* query identification number */
+#if BYTE_ORDER == BIG_ENDIAN
+                        /* fields in third byte */
+        unsigned        qr: 1;                /* response flag */
+        unsigned        opcode: 4;        /* purpose of message */
+        unsigned        aa: 1;                /* authoritive answer */
+        unsigned        tc: 1;                /* truncated message */
+        unsigned        rd: 1;                /* recursion desired */
+                        /* fields in fourth byte */
+        unsigned        ra: 1;                /* recursion available */
+        unsigned        unused :1;        /* unused bits (MBZ as of 4.9.3a3) */
+        unsigned        ad: 1;                /* authentic data from named */
+        unsigned        cd: 1;                /* checking disabled by resolver */
+        unsigned        rcode :4;        /* response code */
+#endif
+#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+                        /* fields in third byte */
+        unsigned        rd :1;                /* recursion desired */
+        unsigned        tc :1;                /* truncated message */
+        unsigned        aa :1;                /* authoritive answer */
+        unsigned        opcode :4;        /* purpose of message */
+        unsigned        qr :1;                /* response flag */
+                        /* fields in fourth byte */
+        unsigned        rcode :4;        /* response code */
+        unsigned        cd: 1;                /* checking disabled by resolver */
+        unsigned        ad: 1;                /* authentic data from named */
+        unsigned        unused :1;        /* unused bits (MBZ as of 4.9.3a3) */
+        unsigned        ra :1;                /* recursion available */
+#endif
+                        /* remaining bytes */
+        unsigned        qdcount :16;        /* number of question entries */
+        unsigned        ancount :16;        /* number of answer entries */
+        unsigned        nscount :16;        /* number of authority entries */
+        unsigned        arcount :16;        /* number of resource entries */
 } HEADER;
 
 /*
  * Defines for handling compressed domain names
  */
-#define INDIR_MASK     0xc0
+#define INDIR_MASK      0xc0
+
 
 /*
  * Inline versions of get/put short/long.  Pointer is advanced.
@@ -294,37 +347,40 @@ typedef struct {
  * portable or it can be elegant but rarely both.
  */
 #define GETSHORT(s, cp) { \
-       register u_char *t_cp = (u_char *)(cp); \
-       (s) = ((u_int16_t)t_cp[0] << 8) \
-           | ((u_int16_t)t_cp[1]) \
-           ; \
-       (cp) += INT16SZ; \
+        register const u_char *t_cp = (const u_char *)(cp); \
+        (s) = ((const u_int16_t)t_cp[0] << 8) \
+            | ((const u_int16_t)t_cp[1]) \
+            ; \
+        (cp) += INT16SZ; \
 }
 
 #define GETLONG(l, cp) { \
-       register u_char *t_cp = (u_char *)(cp); \
-       (l) = ((u_int32_t)t_cp[0] << 24) \
-           | ((u_int32_t)t_cp[1] << 16) \
-           | ((u_int32_t)t_cp[2] << 8) \
-           | ((u_int32_t)t_cp[3]) \
-           ; \
-       (cp) += INT32SZ; \
+        register const u_char *t_cp = (const u_char *)(cp); \
+        (l) = ((const u_int32_t)t_cp[0] << 24) \
+            | ((const u_int32_t)t_cp[1] << 16) \
+            | ((const u_int32_t)t_cp[2] << 8) \
+            | ((const u_int32_t)t_cp[3]) \
+            ; \
+        (cp) += INT32SZ; \
 }
 
 #define PUTSHORT(s, cp) { \
-       register u_int16_t t_s = (u_int16_t)(s); \
-       register u_char *t_cp = (u_char *)(cp); \
-       *t_cp++ = t_s >> 8; \
-       *t_cp   = t_s; \
-       (cp) += INT16SZ; \
+        register u_int16_t t_s = (u_int16_t)(s); \
+        register u_char *t_cp = (u_char *)(cp); \
+        *t_cp++ = (u_int32_t)t_s >> 8; \
+        *t_cp   = t_s; \
+        (cp) += INT16SZ; \
 }
 
 #define PUTLONG(l, cp) { \
-       register u_int32_t t_l = (u_int32_t)(l); \
-       register u_char *t_cp = (u_char *)(cp); \
-       *t_cp++ = t_l >> 24; \
-       *t_cp++ = t_l >> 16; \
-       *t_cp++ = t_l >> 8; \
-       *t_cp   = t_l; \
-       (cp) += INT32SZ; \
+        register u_int32_t t_l = (u_int32_t)(l); \
+        register u_char *t_cp = (u_char *)(cp); \
+        *t_cp++ = t_l >> 24; \
+        *t_cp++ = t_l >> 16; \
+        *t_cp++ = t_l >> 8; \
+        *t_cp   = t_l; \
+        (cp) += INT32SZ; \
 }
+
+#endif /* _ARPA_NAMESER_H_ */
+
index d54312aab27c174d641e0e0c27ab2ab17fe75e62..7f352acb048fb12fd400b3a96ec9365a32d14eb0 100644 (file)
@@ -139,6 +139,7 @@ typedef unsigned int u_int32_t;     /* XXX Hope this works! */
 #define        MAXBANLENGTH    1024
 #define        MAXSILES        5
 #define        MAXSILELENGTH   128
+#define UMODETABLESZ (sizeof(long) * 8)
 /*
  * Watch it - Don't change this unless you also change the ERR_TOOMANYWATCH
  * and PROTOCOL_SUPPORTED settings.
@@ -267,34 +268,6 @@ typedef unsigned int u_int32_t;    /* XXX Hope this works! */
  * -DuffJ
  */
 
-#define        UMODE_INVISIBLE  0x0001 /* makes user invisible */
-#define        UMODE_OPER       0x0002 /* Operator */
-#define        UMODE_WALLOP     0x0004 /* send wallops to them */
-#define UMODE_FAILOP    0x0008 /* Shows some global messages */
-#define UMODE_HELPOP    0x0010 /* Help system operator */
-#define UMODE_REGNICK   0x0020 /* Nick set by services as registered */
-#define UMODE_SADMIN    0x0040 /* Services Admin */
-#define UMODE_ADMIN     0x0080 /* Admin */
-#define        UMODE_SERVNOTICE 0x0100 /* server notices such as kill */
-#define        UMODE_LOCOP      0x0200 /* Local operator -- SRB */
-#define UMODE_RGSTRONLY  0x0400 /* Only reg nick message */
-#define UMODE_WEBTV     0x0800 /* WebTV Client */
-#define UMODE_SERVICES   0x4000        /* services */
-#define UMODE_HIDE      0x8000 /* Hide from Nukes */
-#define UMODE_NETADMIN  0x10000        /* Network Admin */
-#define UMODE_TECHADMIN 0x40000        /* Tech Admin */
-#define UMODE_COADMIN   0x80000        /* Co Admin */
-#define UMODE_WHOIS    0x100000        /* gets notice on /whois */
-#define UMODE_KIX      0x200000        /* usermode +q */
-#define UMODE_BOT       0x400000       /* User is a bot */
-#define UMODE_SECURE   0x800000        /* User is a secure connect */
-#define UMODE_FCLIENT  0x1000000       /* recieve client on far connects.. */
-#define UMODE_HIDING   0x2000000       /* Totally invisible .. */
-#define        UMODE_VICTIM   0x8000000        /* Intentional Victim */
-#define UMODE_DEAF     0x10000000
-#define UMODE_HIDEOPER 0x20000000      /* Hide oper mode */
-#define UMODE_SETHOST  0x40000000      /* used sethost */
-#define UMODE_STRIPBADWORDS 0x80000000 /* */
 
 #define SNO_KILLS   0x0001
 #define SNO_CLIENT  0x0002
@@ -308,7 +281,7 @@ typedef unsigned int u_int32_t;     /* XXX Hope this works! */
 #define SNO_DEFOPER "+kcfvG"
 #define SNO_DEFUSER "+k"
 
-#define        SEND_UMODES (UMODE_INVISIBLE|UMODE_OPER|UMODE_WALLOP|UMODE_FAILOP|UMODE_HELPOP|UMODE_RGSTRONLY|UMODE_REGNICK|UMODE_SADMIN|UMODE_NETADMIN|UMODE_TECHADMIN|UMODE_COADMIN|UMODE_ADMIN|UMODE_SERVICES|UMODE_HIDE|UMODE_WHOIS|UMODE_KIX|UMODE_BOT|UMODE_SECURE|UMODE_FCLIENT|UMODE_HIDING|UMODE_DEAF|UMODE_VICTIM|UMODE_HIDEOPER|UMODE_SETHOST|UMODE_STRIPBADWORDS|UMODE_WEBTV)
+#define        SEND_UMODES (UMODE_INVISIBLE|UMODE_OPER|UMODE_WALLOP|UMODE_FAILOP|UMODE_HELPOP|UMODE_RGSTRONLY|UMODE_REGNICK|UMODE_SADMIN|UMODE_NETADMIN|UMODE_TECHADMIN|UMODE_COADMIN|UMODE_ADMIN|UMODE_SERVICES|UMODE_HIDE|UMODE_WHOIS|UMODE_KIX|UMODE_BOT|UMODE_SECURE|UMODE_HIDING|UMODE_DEAF|UMODE_VICTIM|UMODE_HIDEOPER|UMODE_SETHOST|UMODE_STRIPBADWORDS|UMODE_WEBTV)
 #define        ALL_UMODES (SEND_UMODES|UMODE_SERVNOTICE|UMODE_LOCOP|UMODE_SERVICES)
 #define        FLAGS_ID        (FLAGS_DOID|FLAGS_GOTID)
 
@@ -691,6 +664,7 @@ struct Server {
 #define M_SHUN 0x0008
 #define M_NOLAG 0x0010
 #define M_ALIAS 0x0020
+#define M_RESETIDLE 0x0040
 
 struct Command {
        aCommand                *next;
@@ -743,6 +717,14 @@ typedef struct ircstatsx {
 
 extern ircstats IRCstats;
 
+typedef struct {
+       long    mode;
+       char    flag;
+} aUMtable;
+
+extern aUMtable *Usermode_Table;
+extern short    Usermode_highest;
+
 
 #define LISTENER_NORMAL                0x000001
 #define LISTENER_CLIENTSONLY   0x000002
index 9cc91be58ea51ccf33cc20936ab2d64e38b0105b..2010a8ebabb7f539279b4e3a93cb2ca50704d7f0 100644 (file)
@@ -31,7 +31,7 @@
 #define PATCH1                 "3"
 #define PATCH2                 ".2"
 #define PATCH3                 "-Selene"
-#define PATCH4                 "[beta3]"
+#define PATCH4                 "[beta4]"
 #define PATCH5                 ""
 #define PATCH6                 ""
 #define PATCH7                 ""
index 3a4645bbe75c5b4f0c74f8b9a7c1bed81a2d34ca..6ba3a02ab12e3990ec863c272fa3fb643f3f0ff6 100644 (file)
@@ -33,7 +33,7 @@ OBJ_FILES=SRC/CHANNEL.OBJ SRC/SEND.OBJ SRC/SOCKET.OBJ \
  SRC/VERSION.OBJ SRC/S_UNREAL.OBJ SRC/RES_INIT.OBJ \
  SRC/S_KLINE.OBJ SRC/S_EXTRA.OBJ SRC/IRCSPRINTF.OBJ SRC/LUSERS.OBJ \
  SRC/SCACHE.OBJ SRC/ALN.OBJ SRC/BADWORDS.OBJ SRC/WEBTV.OBJ SRC/RES.OBJ SRC/MODULES.OBJ \
- SRC/S_SVS.OBJ SRC/EVENTS.OBJ
+ SRC/S_SVS.OBJ SRC/EVENTS.OBJ SRC/UMODES.OBJ
 
 MOD_FILES=SRC/L_COMMANDS.OBJ SRC/M_CHGHOST.OBJ SRC/M_SDESC.OBJ SRC/M_SETIDENT.OBJ \
  SRC/M_SETNAME.OBJ SRC/M_SETHOST.OBJ SRC/M_CHGIDENT.OBJ SRC/M_SVSMOTD.OBJ \
@@ -47,17 +47,19 @@ MOD_FILES=SRC/L_COMMANDS.OBJ SRC/M_CHGHOST.OBJ SRC/M_SDESC.OBJ SRC/M_SETIDENT.OB
  SRC/SCAN.OBJ SRC/SCAN_SOCKS.OBJ SRC/SCAN_HTTP.OBJ
 
 
-ALL: WIRCD.EXE
+ALL: CONF WIRCD.EXE
 
 CLEAN:
-        -@erase src\*.exe 2>NUL
-        -@erase src\*.obj 2>NUL
-        -@erase src\win32.res 2>NUL
-        -@erase src\version.c 2>NUL
-        -@erase src\win32\*.obj 2>NUL
-        -@erase .\*.exe 2>NUL
-
+        -@erase src\*.obj >NUL
+        -@erase src\win32.res >NUL
+        -@erase src\version.c >NUL
+        -@erase src\win32\*.obj >NUL
+        -@erase .\*.exe >NUL
 
+CONF:
+       -@copy include\win32\setup.h include\setup.h >NUL
+       $(CC) src/win32/config.c
+       -@config.exe
 
 ./WIRCD.EXE: $(OBJ_FILES) $(MOD_FILES) SRC/win32/WIN32.RES
         $(LINK) $(LFLAGS) $(OBJ_FILES) $(MOD_FILES) SRC/win32/WIN32.RES SRC/WIN32/GNU_REGEX.LIB SRC/WIN32/DEBUG/STACKTRACE.LIB /MAPINFO:LINES /MAP
@@ -204,6 +206,9 @@ src/modules.obj: src/modules.c $(INCLUDES)
 src/events.obj: src/events.c $(INCLUDES)
          $(CC) $(CFLAGS) src/events.c
 
+src/umodes.obj: src/umodes.c $(INCLUDES)
+       $(CC) $(CFLAGS) src/umodes.c
+
 src/l_commands.obj: src/modules/l_commands.c $(INCLUDES)
         $(CC) $(CFLAGS) src/modules/l_commands.c
 
index 626ac70eb2b65db6504d924d357ac24ad49035e5..c1ed3e7ed6780ce25109da11f7c966fd8a2bf2a0 100644 (file)
@@ -27,9 +27,8 @@ OBJS=aln.o badwords.o channel.o cloak.o crule.o dbuf.o \
        res_init.o res_comp.o res_mkquery.o res_skipname.o s_auth.o \
        s_bsd.o s_conf.o s_debug.o s_err.o s_extra.o s_kline.o \
        s_misc.o s_numeric.o s_serv.o s_svs.o $(STRTOUL) socket.o \
-       ssl.o s_unreal.o \
-       s_user.o scache.o send.o support.o version.o webtv.o \
-       whowas.o zip.o
+       ssl.o s_unreal.o s_user.o scache.o send.o support.o umodes.o \
+       version.o webtv.o whowas.o zip.o
 
 SRC=$(OBJS:%.o=%.c)
 
@@ -120,6 +119,9 @@ match.o: match.c $(INCLUDES)
 support.o: support.c $(INCLUDES)
        $(CC) $(CFLAGS) -c support.c
 
+umodes.o: umodes.c $(INCLUDES)
+       $(CC) $(CFLAGS) -c umodes.c
+
 userload.o: userload.c $(INCLUDES)
        $(CC) $(CFLAGS) -c userload.c
 
index 6155bb2440bfc40bc805ceada6dea91e3151c6c4..989f4d1c4a3dcc375b28975a181aa0fe43a14f4a 100644 (file)
@@ -825,6 +825,7 @@ int  InitwIRCD(argc, argv)
        bzero((char *)&me, sizeof(me));
        setup_signals();
        init_ircstats();
+       umode_init();
        clear_scache_hash_table();
 #ifdef FORCE_CORE
        corelim.rlim_cur = corelim.rlim_max = RLIM_INFINITY;
index b82e2dc0199abe35ecc1e9ad2f4f9215f59185f4..953dff8434f4496ac1ba5a9a1d8c62deabc17f3a 100644 (file)
@@ -181,6 +181,7 @@ anUser *make_user(cptr)
                user->lopt = NULL;
                user->whowas = NULL;
                user->snomask = 0;
+               user->oflag = 0;
                user->virthost = MyMalloc(5);
                *user->virthost = '\0';
                cptr->user = user;
index 0e5944b0c7442b7301a732feb5afdaf575db610a..a2afe8ae49630948ebb7227dcb3751c7aa0cb32b 100644 (file)
@@ -49,6 +49,7 @@
 
 #ifdef SCAN_API
 extern MSymbolTable scan_socks_depend[];
+extern MSymbolTable scan_http_depend[];
 #endif
 
 /* Place includes here */
@@ -125,8 +126,10 @@ int    l_commands_init(int module_load)
 #endif
 #ifdef SCAN_API
        module_depend_resolve(&scan_socks_depend[0]);
+       module_depend_resolve(&scan_http_depend[0]);
        m_scan_init(module_load);
        scan_socks_init(module_load);
+       scan_http_init(module_load);
 #endif
 
 }
@@ -181,6 +184,7 @@ void    l_commands_load(int module_load)
 #ifdef SCAN_API
        m_scan_load(module_load);
        scan_socks_load(module_load);
+       scan_http_load(module_load);
 #endif
 }
 
@@ -234,6 +238,7 @@ void        l_commands_unload(void)
 #endif
 #ifdef SCAN_API
        scan_socks_unload();
+       scan_http_unload();
        m_scan_unload();
 #endif
 }
index 8ceddcb4bf568e2432c7b6752837c07c15cd7007..2ec9b92fba7955abeb67bb03c38e0df81e90b8de 100644 (file)
@@ -85,7 +85,7 @@ int    m_message_init(int module_load)
        /*
         * We call our add_Command crap here
        */
-       add_Command(MSG_PRIVATE, TOK_PRIVATE, m_private, MAXPARA);
+       add_CommandX(MSG_PRIVATE, TOK_PRIVATE, m_private, MAXPARA, M_USER|M_SERVER|M_RESETIDLE);
        add_Command(MSG_NOTICE, TOK_NOTICE, m_notice, MAXPARA);
 }
 
index 028309efb62d0587e4cab1b5ef01e7f90e62782b..05966a06a54483de0931adf2337697a4ed71366a 100644 (file)
@@ -49,7 +49,6 @@ DLLFUNC int m_svsmode(aClient *cptr, aClient *sptr, int parc, char *parv[]);
 DLLFUNC int m_svs2mode(aClient *cptr, aClient *sptr, int parc, char *parv[]);
 
 extern ircstats IRCstats;
-extern int user_modes[];
 #define MSG_SVSMODE    "SVSMODE"       
 #define TOK_SVSMODE    "n"     
 #define MSG_SVS2MODE    "SVS2MODE"
@@ -286,8 +285,7 @@ int  m_svsmode(cptr, sptr, parc, parv)
         int  parc;
         char *parv[];
 {
-        int  flag;
-        int *s;
+       int i;
         char **p, *m;
         aClient *acptr;
         int  what, setflags;
@@ -306,9 +304,9 @@ int  m_svsmode(cptr, sptr, parc, parv)
         if (!(acptr = find_person(parv[1], NULL)))
                 return 0;
         setflags = 0;
-        for (s = user_modes; (flag = *s); s += 2)
-                if (acptr->umodes & flag)
-                        setflags |= flag;
+        for (i = 0; i <= Usermode_highest; i++)
+                if (Usermode_Table[i].flag && (acptr->umodes & Usermode_Table[i].mode))
+                        setflags |= Usermode_Table[i].mode;
         /*
          * parse mode change string(s)
          */
@@ -361,16 +359,20 @@ int  m_svsmode(cptr, sptr, parc, parv)
                                   }
                           default:
                                 setmodex:
-                                  for (s = user_modes; (flag = *s); s += 2)
-                                          if (*m == (char)(*(s + 1)))
+                                  for (i = 0; i <= Usermode_highest; i++)
+                                  {
+                                         if (!Usermode_Table[i].flag)
+                                               continue;
+                                          if (*m == Usermode_Table[i].flag)
                                           {
                                                   if (what == MODE_ADD)
-                                                          acptr->umodes |= flag;
+                                                          acptr->umodes |= Usermode_Table[i].mode;
                                                   else
                                                           acptr->umodes &=
-                                                              ~flag;
+                                                              ~Usermode_Table[i].mode;
                                                   break;
                                           }
+                                  }
                                   break;
                         }
         if (parc > 3)
@@ -395,8 +397,7 @@ int  m_svs2mode(cptr, sptr, parc, parv)
         int  parc;
         char *parv[];
 {
-        int  flag;
-        int *s;
+        int  i;
         char **p, *m;
         aClient *acptr;
         int  what, setflags;
@@ -418,10 +419,10 @@ int  m_svs2mode(cptr, sptr, parc, parv)
                 return 0;
 
         setflags = 0;
-        for (s = user_modes; (flag = *s); s += 2)
-                if (acptr->umodes & flag)
-                        setflags |= flag;
-        /*
+        for (i = 0; i <= Usermode_highest; i++)
+                if (Usermode_Table[i].flag && (acptr->umodes & Usermode_Table[i].mode))
+                        setflags |= Usermode_Table[i].mode;
+         /*
          * parse mode change string(s)
          */
         for (p = &parv[2]; p && *p; p++)
@@ -472,16 +473,21 @@ int  m_svs2mode(cptr, sptr, parc, parv)
                                           IRCstats.operators--;
                           default:
                                 setmodey:
-                                  for (s = user_modes; (flag = *s); s += 2)
-                                          if (*m == (char)(*(s + 1)))
+                                  for (i = 0; i <= Usermode_highest; i++)
+                                  {
+                                         if (!Usermode_Table[i].flag)
+                                               continue;
+                                          if (*m == Usermode_Table[i].flag)
                                           {
                                                   if (what == MODE_ADD)
-                                                          acptr->umodes |= flag;
+                                                          acptr->umodes |= Usermode_Table[i].mode;
                                                   else
                                                           acptr->umodes &=
-                                                              ~flag;
+                                                              ~Usermode_Table[i].mode;
                                                   break;
+                                            
                                           }
+                                  }
                                   break;
                         }
 
index 7cf12495b08ffd262ccc2a6128bc2ec47666bbcb..622b78d13f007a24f29392aa12afcc13e28c679e 100644 (file)
@@ -142,7 +142,6 @@ int  chk_who(aClient *, aClient *, int);
 
 /* Externally defined stuffs */
 extern int lifesux;
-extern int user_modes[];
 
 
 int build_searchopts(aClient *sptr, int parc, char *parv[])
@@ -297,10 +296,10 @@ int build_searchopts(aClient *sptr, int parc, char *parv[])
                          }
                          s = parv[args];
                          while (*s) {
-                                 for (i = 1; user_modes[i] != 0x0; i += 2) {
-                                         if (*s == (char)user_modes[i]) {
+                                 for (i = 0; i <= Usermode_highest; i++) {
+                                         if (*s == Usermode_Table[i].flag) {
                                                  wsopts.umodes |=
-                                                     user_modes[i - 1];
+                                                    Usermode_Table[i].mode;
                                                  break;
                                          }
                                  }
index cb0b2952464d4ee67478c62a97e98d1d70a99b72..25e429dddf11a19aafd8e9a4589e8fd555ea446a 100644 (file)
@@ -74,7 +74,7 @@ MUTEX                         blackhole_mutex;
 ConfigItem_blackhole           blackhole_conf;
 char                           blackhole_stop = 0;
 SOCKET                         blackholefd = 0;
-static struct SOCKADDR_IN              blackholesin;
+struct SOCKADDR_IN             blackholesin;
 /* Some prototypes .. aint they sweet? */
 DLLFUNC int                    h_scan_connect(aClient *sptr);
 DLLFUNC EVENT                  (HS_Cleanup);
@@ -198,7 +198,7 @@ void        m_scan_unload(void)
                i = 0;
                HS_Cleanup(NULL);
                IRCMutexLock(HSlock);
-               for (j = 0; j <= SCAN_AT_ONCE;  j++)
+               for (j = 0; j < SCAN_AT_ONCE;  j++)
                        if (Hosts[i].host[0])
                                i++;
                IRCMutexUnlock(HSlock);
@@ -209,7 +209,7 @@ void        m_scan_unload(void)
                i = 0;
                VS_Ban(NULL);
                IRCMutexLock(VSlock);
-               for (j = 0; j <= SCAN_AT_ONCE;  j++)
+               for (j = 0; j < SCAN_AT_ONCE;  j++)
                        if (VHosts[i].host[0])
                                i++;
                IRCMutexUnlock(VSlock);
@@ -241,7 +241,7 @@ HStruct     *HS_Add(char *host)
 {
        int     i;
        
-       for (i = 0; i <= SCAN_AT_ONCE; i++)
+       for (i = 0; i < SCAN_AT_ONCE; i++)
                if (!(*Hosts[i].host))
                {
                        strcpy(Hosts[i].host, host);
@@ -254,7 +254,7 @@ VHStruct    *VS_Add(char *host, char *reason)
 {
        int     i;
        
-       for (i = 0; i <= SCAN_AT_ONCE; i++)
+       for (i = 0; i < SCAN_AT_ONCE; i++)
                if (!(*VHosts[i].host))
                {
                        strcpy(VHosts[i].host, host);
@@ -269,7 +269,7 @@ HStruct *HS_Find(char *host)
 {
        int     i;
 
-       for (i = 0; i <= SCAN_AT_ONCE; i++)
+       for (i = 0; i < SCAN_AT_ONCE; i++)
                if (!strcmp(Hosts[i].host, host))
                {
                        return (&Hosts[i]);
@@ -281,7 +281,7 @@ VHStruct *VS_Find(char *host)
 {
        int     i;
 
-       for (i = 0; i <= SCAN_AT_ONCE; i++)
+       for (i = 0; i < SCAN_AT_ONCE; i++)
                if (!strcmp(VHosts[i].host, host))
                {
                        return (&VHosts[i]);
@@ -296,7 +296,7 @@ DLLFUNC EVENT(HS_Cleanup)
        /* If it is called as a event, get lock */
        if (data == NULL)
                IRCMutexLock(HSlock);                   
-       for (i = 0; i <= SCAN_AT_ONCE; i++)
+       for (i = 0; i < SCAN_AT_ONCE; i++)
                if (Hosts[i].host[0] && (Hosts[i].refcnt <= 0))
                {
                        *(Hosts[i].host) = '\0';        
@@ -324,7 +324,7 @@ DLLFUNC EVENT(VS_Ban)
 
        if (data == NULL)
                IRCMutexLock(VSlock);                   
-       for (i = 0; i <= SCAN_AT_ONCE; i++)
+       for (i = 0; i < SCAN_AT_ONCE; i++)
                if (*VHosts[i].host && *VHosts[i].reason)
                {
                        
@@ -410,13 +410,13 @@ DLLFUNC int h_scan_info(aClient *sptr)
                        me.name, sptr->name);
        sendto_one(sptr, ":%s NOTICE %s :*** Currently scanning:",
                me.name, sptr->name);
-       for (i = 0; i <= SCAN_AT_ONCE; i++)
+       for (i = 0; i < SCAN_AT_ONCE; i++)
                if (*Hosts[i].host)
                        sendto_one(sptr, ":%s NOTICE %s :*** IP: %s refcnt: %i",
                                me.name, sptr->name, Hosts[i].host, Hosts[i].refcnt);
        sendto_one(sptr, ":%s NOTICE %s :*** Currently banning:",
                me.name, sptr->name);
-       for (i = 0; i <= SCAN_AT_ONCE; i++)
+       for (i = 0; i < SCAN_AT_ONCE; i++)
                if (*VHosts[i].host)
                        sendto_one(sptr, ":%s NOTICE %s :*** IP: %s Reason: %s",
                                me.name, sptr->name, VHosts[i].host, VHosts[i].reason);
index 4f516f1cff1a27c74d9750e042b2e071db7dbc1a..6fa6d6cee66956712fcacf4de902a860a0ed8e2f 100644 (file)
@@ -203,7 +203,7 @@ void        scan_http_scan_port(HSStruct *z)
                return;
        }
 
-       sin.sin_port = htons(z->port);
+       sin.sin_port = htons((unsigned short)z->port);
        sin.sin_family = AF_INET;
        /* We do this non-blocking to prevent a hang of the entire ircd with newer
         * versions of glibc.  Don't you just love new "features?"
index ca8fd15b5a5da7d80619ce86d1c5eefed901ebeb..2e2ebad93920342a35abe518f015cfb70c94e50c 100644 (file)
@@ -182,7 +182,7 @@ void        scan_socks4_scan(HStruct *h)
                return;
        }
 
-       sin.sin_port = htons(SCAN_ON_PORT);
+       sin.sin_port = htons((unsigned short)SCAN_ON_PORT);
        sin.sin_family = AF_INET;
        /* We do this non-blocking to prevent a hang of the entire ircd with newer
         * versions of glibc.  Don't you just love new "features?"
index ac32806c422ff7c5c1ad58f0a29d301f90cab2d8..d1e8a62e66bf4399ce3e0209023412091f5c4766 100644 (file)
@@ -161,9 +161,9 @@ void        init_CommandHash(void)
        add_Command(MSG_STATS, TOK_STATS, m_stats, MAXPARA);
        add_Command(MSG_LINKS, TOK_LINKS, m_links, MAXPARA);
        add_CommandX(MSG_ADMIN, TOK_ADMIN, m_admin, MAXPARA, M_UNREGISTERED|M_USER);
-       add_Command(MSG_SUMMON, TOK_SUMMON, m_summon, 1);
-       add_Command(MSG_USERS, TOK_USERS, m_users, MAXPARA);
-       add_Command(MSG_SAMODE, TOK_SAMODE, m_samode, MAXPARA);
+       add_Command(MSG_SUMMON, NULL, m_summon, 1);
+       add_Command(MSG_USERS, NULL, m_users, MAXPARA);
+       add_Command(MSG_SAMODE, NULL, m_samode, MAXPARA);
        add_Command(MSG_SVSKILL, TOK_SVSKILL, m_svskill, MAXPARA);
        add_Command(MSG_HELP, TOK_HELP, m_help, 1);
        add_Command(MSG_HELPOP, TOK_HELP, m_help, 1);
@@ -241,7 +241,8 @@ void        add_Command_backend(char *cmd, int (*func)(), unsigned char parameters, uns
 void   add_Command(char *cmd, char *token, int (*func)(), unsigned char parameters)
 {
        add_Command_backend(cmd, func, parameters, 0, 0);
-       add_Command_backend(token, func, parameters, 1, 0);
+       if (token)
+               add_Command_backend(token, func, parameters, 1, 0);
 }
 
 void    add_CommandX(char *cmd, char *token, int (*func)(), unsigned char parameters, int flags) 
index b854023cc79bf1b8d3fd2433b43f80d2d3f7454d..ddf727faaee4e32e6d2552e6165d48067a881166 100644 (file)
@@ -439,7 +439,7 @@ int  parse(cptr, buffer, bufend)
        if (cmptr == NULL)
                return (do_numeric(numeric, cptr, from, i, para));
        cmptr->count++;
-       if (IsRegisteredUser(cptr) && (cmptr->cmd == MSG_PRIVATE) || (cmptr->cmd == TOK_PRIVATE))
+       if (IsRegisteredUser(cptr) && (cmptr->flags & M_RESETIDLE))
                from->user->last = TStime();
 
 #ifndef DEBUGMODE
index b246449a81bf7568236a2d296117fc1a81a232c6..bd67382d603972412af13dfbf0d77588b0197f11 100644 (file)
--- a/src/res.c
+++ b/src/res.c
@@ -111,6 +111,8 @@ int init_resolver(op)
                if (!ircd_res.nscount)
                {
                        ircd_res.nscount = 1;
+                       Debug((DEBUG_DNS, "Setting nameserver to be %s",
+                               NAME_SERVER));
 #ifdef INET6
                        /* still IPv4 */
                        ircd_res.nsaddr_list[0].sin_addr.s_addr =
@@ -137,7 +139,7 @@ int init_resolver(op)
                (void)setsockopt(ret, SOL_SOCKET, SO_BROADCAST, &on, on);
 #endif
        }
-#ifdef DEBUG
+#ifdef DEBUGMODE
        if (op & RES_INITDEBG);
        ircd_res.options |= RES_DEBUG;
 #endif
@@ -193,7 +195,7 @@ static void rem_request(old)
                                last = r2ptr;
                        break;
                }
-#ifdef DEBUG
+#ifdef DEBUGMODE
        Debug((DEBUG_INFO, "rem_request:Remove %#x at %#x %#x",
            old, *rptr, r2ptr));
 #endif
@@ -272,7 +274,7 @@ time_t timeout_query_list(now)
 #endif
                        if (--rptr->retries <= 0)
                        {
-#ifdef DEBUG
+#ifdef DEBUGMODE
                                Debug((DEBUG_ERROR, "timeout %x now %d cptr %x",
                                    rptr, now, rptr->cinfo.value.cptr));
 #endif
@@ -303,7 +305,7 @@ time_t timeout_query_list(now)
                                resend_query(rptr);
 #endif
                                tout = now + rptr->timeout;
-#ifdef DEBUG
+#ifdef DEBUGMODE
                                Debug((DEBUG_INFO, "r %x now %d retry %d c %x",
                                    rptr, now, rptr->retries,
                                    rptr->cinfo.value.cptr));
@@ -344,6 +346,11 @@ static int send_res_msg(msg, len, rcount)
        char *msg;
        int len, rcount;
 {
+#ifdef DEBUGMODE
+       char debbuffer[50];
+       int j;
+#endif
+
        int  i;
        int  sent = 0, max;
 
@@ -356,14 +363,44 @@ static int send_res_msg(msg, len, rcount)
        if (!max)
                max = 1;
 
+#ifdef DEBUGMODE
+       Debug((DEBUG_DNS, "send_res_msg: Dumping packet contents"));
+       *debbuffer = '\0';
+       j = 0;
+       for (i = 0; i < len; i++)
+       {
+               debbuffer[j] = msg[i] > 32 ? msg[i] : '.';
+               j++;
+               if (j == 32)
+               {
+                       debbuffer[j] = '\0';
+                       Debug((DEBUG_DNS, "- %s", debbuffer));
+                       j = 0;                          
+               }
+       }
+       if (j > 0)
+       {
+               debbuffer[j] = '\0';
+               Debug((DEBUG_DNS, "- %s", debbuffer));
+       }
+#endif
+
+
        for (i = 0; i < max; i++)
        {
+               Debug((DEBUG_DNS, "Sending to nameserver %i",
+                       i));
+#ifndef INET6
+               Debug((DEBUG_DNS, "IP: %s",
+                inet_ntoa(ircd_res.nsaddr_list[i].sin_addr)));
+#endif
 #ifdef INET6
                /* still IPv4 */
                ircd_res.nsaddr_list[i].sin_family = AF_INET;
 #else
                ircd_res.nsaddr_list[i].sin_family = AF_INET;
 #endif
+               ERRNO = 0;
 #ifdef INET6
                if (sendto(resfd, msg, len, 0,
                    (struct sockaddr *)&(ircd_res.nsaddr_list[i]),
@@ -375,6 +412,7 @@ static int send_res_msg(msg, len, rcount)
 #endif
 
                {
+                       Debug((DEBUG_DNS, "send_res_msg, errno = %s",strerror(ERRNO)));
                        reinfo.re_sent++;
                        sent++;
                }
@@ -541,6 +579,8 @@ static int do_query_number(lp, numb, rptr)
            (u_int)(cp[3]), (u_int)(cp[2]), (u_int)(cp[1]), (u_int)(cp[0]));
 #endif
 #endif
+       Debug((DEBUG_DNS, "do_query_number: built %s rptr = %lx",
+               ipbuf, rptr));
 
        if (!rptr)
        {
@@ -596,6 +636,7 @@ static int query_name(name, class, type, rptr)
            (u_char *)buf, sizeof(buf));
        if (r <= 0)
        {
+               Debug((DEBUG_DNS, "query_name: NO_RECOVERY"));
                h_errno = NO_RECOVERY;
                return r;
        }
@@ -622,6 +663,7 @@ static int query_name(name, class, type, rptr)
        s = send_res_msg(buf, r, rptr->sends);
        if (s == -1)
        {
+               Debug((DEBUG_DNS, "query_name: TRY_AGAIN"));
                h_errno = TRY_AGAIN;
                return -1;
        }
@@ -819,7 +861,7 @@ static int proc_answer(rptr, hptr, buf, eob)
                          ans++;
                          break;
                  default:
-#ifdef DEBUG
+#ifdef DEBUGMODE
                          Debug((DEBUG_INFO, "proc_answer: type:%d for:%s",
                              type, hostbuf));
 #endif
@@ -880,7 +922,7 @@ struct hostent *get_res(lp,id)
        hptr->qdcount = ntohs(hptr->qdcount);
        hptr->nscount = ntohs(hptr->nscount);
        hptr->arcount = ntohs(hptr->arcount);
-#ifdef DEBUG
+#ifdef DEBUGMODE
        Debug((DEBUG_NOTICE, "get_res:id = %d rcode = %d ancount = %d",
            hptr->id, hptr->rcode, hptr->ancount));
 #endif
@@ -982,7 +1024,7 @@ struct hostent *get_res(lp,id)
                    inetntoa((char *)&rptr->he.h_addr)));
 #endif
        }
-#ifdef DEBUG
+#ifdef DEBUGMODE
        Debug((DEBUG_INFO, "get_res:Proc answer = %d", a));
 #endif
        if (a > 0 && rptr->type == T_PTR)
@@ -1032,7 +1074,7 @@ struct hostent *get_res(lp,id)
                if (lp)
                        bcopy((char *)&rptr->cinfo, lp, sizeof(Link));
                cp = make_cache(rptr);
-#ifdef DEBUG
+#ifdef DEBUGMODE
                Debug((DEBUG_INFO, "get_res:cp=%#x rptr=%#x (made)", cp, rptr));
 #endif
 
@@ -1177,7 +1219,7 @@ static aCache *add_to_cache(ocp)
        aCache *cp = NULL;
        int  hashv;
 
-#ifdef DEBUG
+#ifdef DEBUGMODE
        Debug((DEBUG_INFO,
            "add_to_cache:ocp %#x he %#x name %#x addrl %#x 0 %#x",
            ocp, HE(ocp), HE(ocp)->h_name, HE(ocp)->h_addr_list,
@@ -1194,7 +1236,7 @@ static aCache *add_to_cache(ocp)
        ocp->hnum_next = hashtable[hashv].num_list;
        hashtable[hashv].num_list = ocp;
 
-#ifdef DEBUG
+#ifdef DEBUGMODE
 #ifdef INET6
        Debug((DEBUG_INFO, "add_to_cache:added %s[%08x%08x%08x%08x] cache %#x.",
            ocp->he.h_name,
@@ -1258,9 +1300,9 @@ static void update_list(rptr, cachep)
        if (!rptr)
                return;
 
-#ifdef DEBUG
+#ifdef DEBUGMODE
        Debug((DEBUG_DEBUG, "u_l:cp %#x na %#x al %#x ad %#x",
-           cp, HE(cp)->h_name, HE(cp)->h_aliases, HE(cp)->he.h_addr));
+           cp, HE(cp)->h_name, HE(cp)->h_aliases, HE(cp)->h_addr));
        Debug((DEBUG_DEBUG, "u_l:rptr %#x h_n %#x", rptr, HE(rptr)->h_name));
 #endif
        /*
@@ -1285,9 +1327,9 @@ static void update_list(rptr, cachep)
                        base = (char **)MyRealloc((char *)base,
                            sizeof(char *) * (addrcount + 1));
                        HE(cp)->h_aliases = base;
-#ifdef DEBUG
+#ifdef DEBUGMODE
                        Debug((DEBUG_DNS, "u_l:add name %s hal %x ac %d",
-                           s, HE(CP)->h_aliases, addrcount));
+                           s, HE(cp)->h_aliases, addrcount));
 #endif
                        base[addrcount - 1] = strdup(s);
                        base[addrcount] = NULL;
@@ -1340,7 +1382,7 @@ static void update_list(rptr, cachep)
                        base = (char **)MyRealloc((char *)ab,
                            (addrcount + 1) * sizeof(*ab));
                        HE(cp)->h_addr_list = base;
-#ifdef DEBUG
+#ifdef DEBUGMODE
                        Debug((DEBUG_DNS, "u_l:add IP %x hal %x ac %d",
                            ntohl(((struct IN_ADDR *)s)->S_ADDR),
                            HE(cp)->h_addr_list, addrcount));
@@ -1368,7 +1410,7 @@ static aCache *find_cache_name(name)
        hashv = hash_name(name);
 
        cp = hashtable[hashv].name_list;
-#ifdef DEBUG
+#ifdef DEBUGMODE
        Debug((DEBUG_DNS, "find_cache_name:find %s : hashv = %d", name, hashv));
 #endif
 
@@ -1411,14 +1453,14 @@ static aCache *find_cache_number(rptr, numb)
 {
        aCache *cp;
        int  hashv, i;
-#ifdef DEBUG
+#ifdef DEBUGMODE
        struct IN_ADDR *ip = (struct IN_ADDR *)numb;
 #endif
 
        hashv = hash_number((u_char *)numb);
 
        cp = hashtable[hashv].num_list;
-#ifdef DEBUG
+#ifdef DEBUGMODE
 #ifdef INET6
        Debug((DEBUG_DNS,
            "find_cache_number:find %s[%08x%08x%08x%08x]: hashv = %d",
@@ -1583,7 +1625,7 @@ static aCache *make_cache(rptr)
                cp->ttl = rptr->ttl;
        cp->expireat = TStime() + cp->ttl;
        HE(rptr)->h_name = NULL;
-#ifdef DEBUG
+#ifdef DEBUGMODE
        Debug((DEBUG_INFO, "make_cache:made cache %#x", cp));
 #endif
        return add_to_cache(cp);
@@ -1628,7 +1670,7 @@ static void rem_cache(ocp)
        int  hashv;
        aClient *cptr;
 
-#ifdef DEBUG
+#ifdef DEBUGMODE
        Debug((DEBUG_DNS, "rem_cache: ocp %#x hp %#x l_n %#x aliases %#x",
            ocp, hp, ocp->list_next, hp->h_aliases));
 #endif
@@ -1652,7 +1694,7 @@ static void rem_cache(ocp)
         * remove cache entry from hashed name lists
         */
        hashv = hash_name(hp->h_name);
-#ifdef DEBUG
+#ifdef DEBUGMODE
        Debug((DEBUG_DEBUG, "rem_cache: h_name %s hashv %d next %#x first %#x",
            hp->h_name, hashv, ocp->hname_next, hashtable[hashv].name_list));
 #endif
@@ -1666,7 +1708,7 @@ static void rem_cache(ocp)
         * remove cache entry from hashed number list
         */
        hashv = hash_number((u_char *)hp->h_addr);
-#ifdef DEBUG
+#ifdef DEBUGMODE
 # ifdef INET6
        Debug((DEBUG_DEBUG, "rem_cache: h_addr %s hashv %d next %#x first %#x",
            inet_ntop(AF_INET6, hp->h_addr, mydummy, MYDUMMY_SIZE),
index c9e00f731a24effd6dd5dbf02bca7669b19d8d09..0b66dd28ba7975f670879ec0d24592c02e3c154b 100644 (file)
@@ -488,14 +488,13 @@ int ircd_res_init()
                        dots--;
                }
                *pp = NULL;
-#ifdef DEBUG
-               if (ircd_res.options & RES_DEBUG)
+#ifdef DEBUGMODE
+               Debug((DEBUG_DNS, ";; res_init()... default dnsrch list:"));
+               for (pp = ircd_res.dnsrch; *pp; pp++)
                {
-                       printf(";; res_init()... default dnsrch list:\n");
-                       for (pp = ircd_res.dnsrch; *pp; pp++)
-                               printf(";;\t%s\n", *pp);
-                       printf(";;\t..END..\n");
+                               Debug((DEBUG_DNS, ";;\t%s", *pp));
                }
+               Debug((DEBUG_DNS, ";;\t..END..\n"));
 #endif /* DEBUG */
 #endif /* !RFC1535 */
        }
@@ -512,10 +511,9 @@ static void ircd_res_setoptions(options, source)
        char *cp = options;
        int  i;
 
-#ifdef DEBUG
-       if (ircd_res.options & RES_DEBUG)
-               printf(";; ircd_res_setoptions(\"%s\", \"%s\")...\n",
-                   options, source);
+#ifdef DEBUGMODE
+       Debug((DEBUG_DNS, ";; ircd_res_setoptions(\"%s\", \"%s\")...",
+                   options, source));
 #endif
        while (*cp)
        {
@@ -530,22 +528,17 @@ static void ircd_res_setoptions(options, source)
                                ircd_res.ndots = i;
                        else
                                ircd_res.ndots = RES_MAXNDOTS;
-#ifdef DEBUG
-                       if (ircd_res.options & RES_DEBUG)
-                               printf(";;\tndots=%d\n", ircd_res.ndots);
+#ifdef DEBUGMODE
+                       Debug((DEBUG_DNS, ";;\tndots=%d", ircd_res.ndots));
 #endif
                }
                else if (!strncmp(cp, "debug", sizeof("debug") - 1))
                {
-#ifdef DEBUG
-                       if (!(ircd_res.options & RES_DEBUG))
-                       {
-                               printf
-                                   (";; ircd_res_setoptions(\"%s\", \"%s\")..\n",
-                                   options, source);
+#ifdef DEBUGMODE
+                               Debug((DEBUG_DNS,
+                                   ";; ircd_res_setoptions(\"%s\", \"%s\")..",
+                                   options, source));
                                ircd_res.options |= RES_DEBUG;
-                       }
-                       printf(";;\tdebug\n");
 #endif
                }
                else if (!strncmp(cp, "inet6", sizeof("inet6") - 1))
index 687341646ff086537404339cf2f321ed18a0c319..c8861473a3ec6a53d3ca5a558327a523f84f4295 100644 (file)
@@ -99,10 +99,10 @@ ircd_res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
                h_errno = NETDB_INTERNAL;
                return (-1);
        }
-#ifdef DEBUG
-       if (ircd_res.options & RES_DEBUG)
-               printf(";; res_mkquery(%d, %s, %d, %d)\n",
-                   op, dname, class, type);
+#ifdef DEBUGMODE
+       Debug((DEBUG_DNS,
+               ";; res_mkquery(%d, %s, %d, %d)",
+                   op, dname, class, type));
 #endif
        /*
         * Initialize header fields.
index 3e9a80eb0d07fc94562be56953d0093877576533..9c7ccc5ae46247a1e04ce276a7d8a3521bc58435 100644 (file)
@@ -632,6 +632,7 @@ init_dgram:
 #endif /*_WIN32*/
 
        resfd = init_resolver(0x1f);
+       Debug((DEBUG_DNS, "resfd %d", resfd));
        return;
 }
 
@@ -1690,6 +1691,7 @@ int  read_message(delay, listp)
 #ifndef _WIN32
        if (resfd >= 0 && FD_ISSET(resfd, &read_set))
        {
+               Debug((DEBUG_DNS, "Doing DNS async.."));
                do_dns_async();
                nfds--;
                FD_CLR(resfd, &read_set);
index ecd65e184109da2c41c38c94c057169c11366614..4d6c01a103008d8f372298bac3addc07629af15e 100644 (file)
@@ -3436,7 +3436,7 @@ void      validate_configuration(void)
        if (!find_Command_simple("AWAY") || !find_Command_simple("KILL") ||
                !find_Command_simple("OPER") || !find_Command_simple("PING"))
        {
-               Error("Someone forgot to load modules with proper commands in them. Read the documentation");
+               Error("Someone forgot to load modules with proper commands in them. Read the documentation (.RELEASE.NOTES)");
        }
 #ifdef _WIN32
        if (config_error_flag)
index 46212b493d76740119b12e0c4f21a4e584120f33..3e9b44ac7b2fafc3ac7174f0075be9778b8f0ee1 100644 (file)
@@ -243,8 +243,8 @@ void send_usage(cptr, nick)
 
        if (getrusage(RUSAGE_SELF, &rus) == -1)
        {
-#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__APPLE__)
-/*             extern char *sys_errlist[]; */
+#ifdef _SOLARIS
+               extern char *sys_errlist[];
 #endif
                sendto_one(cptr, ":%s NOTICE %s :Getruseage error: %s.",
                    me.name, nick, sys_errlist[errno]);
index de69f98d41c46caa2786fd5517ff2224173902d4..d0a805635f77effcfec648f563ccafa2145b54dd 100644 (file)
@@ -129,3 +129,5 @@ aClient *find_match_server(char *mask)
        return acptr;
 }
 
+
+
index 8576d38c5560bb99cc165d1d9167348596ca057d..c6d864ae85631cf0f2352bce8985fb7779e7465e 100644 (file)
@@ -60,37 +60,6 @@ int  dontspread = 0;
 extern char *me_hash;
 extern char backupbuf[];
 static char buf[BUFSIZE], buf2[BUFSIZE];
-int user_modes[] = { UMODE_OPER, 'o',
-       UMODE_LOCOP, 'O',
-       UMODE_INVISIBLE, 'i',
-       UMODE_WALLOP, 'w',
-       UMODE_FAILOP, 'g',
-       UMODE_HELPOP, 'h',
-       UMODE_SERVNOTICE, 's',
-       UMODE_SERVICES, 'S',
-       UMODE_SADMIN, 'a',
-       UMODE_HIDEOPER, 'H',
-       UMODE_ADMIN, 'A',
-       UMODE_NETADMIN, 'N',
-       UMODE_TECHADMIN, 'T',
-       UMODE_COADMIN, 'C',
-       UMODE_REGNICK, 'r',
-       UMODE_RGSTRONLY, 'R',
-       UMODE_HIDE, 'x',
-       UMODE_WHOIS, 'W',
-       UMODE_KIX, 'q',
-       UMODE_BOT, 'B',
-       UMODE_HIDING, 'I',
-       UMODE_SECURE, 'z',
-       UMODE_DEAF, 'd',
-       UMODE_VICTIM, 'v',
-       UMODE_SETHOST, 't',
-       UMODE_WEBTV, 'V',
-#ifdef STRIPBADWORDS
-       UMODE_STRIPBADWORDS, 'G',
-#endif
-       0, 0
-};
 
 int sno_mask[] = { 
        SNO_KILLS, 'k',
@@ -123,8 +92,7 @@ long set_usermode(char *umode)
        int  newumode;
        int  what;
        char **p, *m;
-       int  flag;
-       int *s;
+       int i;
 
        newumode = 0;
        what = MODE_ADD;
@@ -143,19 +111,18 @@ long set_usermode(char *umode)
                  case '\t':
                          break;
                  default:
-                         for (s = user_modes; (flag = *s); s += 2)
-                                 if (*m == (char)(*(s + 1)))
-                                 {
-                                         if (what == MODE_ADD)
-                                         {
-                                                 newumode |= flag;
-                                         }
-                                         else
-                                         {
-                                                 newumode &= ~flag;
-                                         }
-                                         break;
-                                 }
+                        for (i = 0; i <= Usermode_highest; i++)
+                        {
+                               if (!Usermode_Table[i].flag)
+                                       continue;
+                               if (*m == Usermode_Table[i].flag)
+                               {
+                                       if (what == MODE_ADD)
+                                               newumode |= Usermode_Table[i].mode;
+                                       else
+                                               newumode &= ~Usermode_Table[i].mode;
+                               }
+                        }        
                }
 
        return (newumode);
@@ -257,23 +224,7 @@ unsigned char *StripColors(unsigned char *text) {
 }
 
 
-char umodestring[512];
-
-void make_umodestr(void)
-{
-
-       int *s;
-       char *m;
-
-       m = umodestring;
-
-       for (s = user_modes; *s; s += 2)
-       {
-               *m++ = (char)(*(s + 1));
-       }
-
-       *m = '\0';
-}
+char umodestring[UMODETABLESZ+1];
 
 /*
 ** next_client
@@ -1626,7 +1577,7 @@ int  m_nick(cptr, sptr, parc, parv)
                /* Copy password to the passwd field if it's given after NICK
                 * - originally by taz, modified by Wizzu
                 */
-               if ((parc > 2) && (strlen(parv[2]) < sizeof(sptr->passwd)))
+               if ((parc > 2) && (strlen(parv[2]) <= PASSWDLEN))
                {
                        if (sptr->passwd)
                                MyFree(sptr->passwd);
@@ -1701,30 +1652,31 @@ char *get_sno_str(aClient *sptr) {
 
 char *get_mode_str(aClient *acptr)
 {
-       int  flag;
-       int *s;
+       int  i;
        char *m;
 
        m = buf;
        *m++ = '+';
-       for (s = user_modes; (flag = *s) && (m - buf < BUFSIZE - 4); s += 2)
-               if ((acptr->umodes & flag))
-                       *m++ = (char)(*(s + 1));
+       for (i = 0; (i <= Usermode_highest) && (m - buf < BUFSIZE - 4); i++)
+               
+               if (Usermode_Table[i].flag && (acptr->umodes & Usermode_Table[i].mode))
+                       *m++ = Usermode_Table[i].flag;
        *m = '\0';
        return buf;
 }
 
-char *get_modestr(long modes)
+
+char *get_modestr(long umodes)
 {
-       int  flag;
-       int *s;
+       int  i;
        char *m;
 
        m = buf;
        *m++ = '+';
-       for (s = user_modes; (flag = *s) && (m - buf < BUFSIZE - 4); s += 2)
-               if ((modes & flag))
-                       *m++ = (char)(*(s + 1));
+       for (i = 0; (i <= Usermode_highest) && (m - buf < BUFSIZE - 4); i++)
+               
+               if (Usermode_Table[i].flag && (umodes & Usermode_Table[i].mode))
+                       *m++ = Usermode_Table[i].flag;
        *m = '\0';
        return buf;
 }
@@ -2077,7 +2029,7 @@ void set_snomask(aClient *sptr, char *snomask) {
 int  m_umode(aClient *cptr, aClient *sptr, int parc, char *parv[])
 {
        int  flag;
-       int *s;
+       int  i;
        char **p, *m;
        aClient *acptr;
        int  what, setflags, setsnomask;
@@ -2114,9 +2066,11 @@ int  m_umode(aClient *cptr, aClient *sptr, int parc, char *parv[])
 
        /* find flags already set for user */
        setflags = 0;
-       for (s = user_modes; (flag = *s); s += 2)
-               if ((sptr->umodes & flag))
-                       setflags |= flag;
+       
+       for (i = 0; i <= Usermode_highest; i++)
+               if ((sptr->umodes & Usermode_Table[i].mode))
+                       setflags |= Usermode_Table[i].mode;
+
        if (MyConnect(sptr))
                setsnomask = sptr->user->snomask;
        /*
@@ -2175,22 +2129,25 @@ int  m_umode(aClient *cptr, aClient *sptr, int parc, char *parv[])
                                  (void)m_botmotd(sptr, sptr, 1, parv);
                  default:
                        def:
-                         for (s = user_modes; (flag = *s); s += 2)
-                                 if (*m == (char)(*(s + 1)))
+                         
+                         for (i = 0; i <= Usermode_highest; i++)
+                         {
+                                 if (*m == Usermode_Table[i].flag)
                                  {
                                          if (what == MODE_ADD)
-                                                 sptr->umodes |= flag;
+                                                 sptr->umodes |= Usermode_Table[i].mode;
                                          else
-                                                 sptr->umodes &= ~flag;
+                                                 sptr->umodes &= ~Usermode_Table[i].mode;
                                          break;
                                  }
                                  if (flag == 0 && MyConnect(sptr) && !rpterror)
                                  {
-                                 sendto_one(sptr,
-                                     err_str(ERR_UMODEUNKNOWNFLAG),
-                                     me.name, parv[0]);
-                                 rpterror = 1;
+                                         sendto_one(sptr,
+                                             err_str(ERR_UMODEUNKNOWNFLAG),
+                                             me.name, parv[0]);
+                                         rpterror = 1;
                                  }
+                         }
                          break;
                }
        /*
@@ -2230,6 +2187,21 @@ int  m_umode(aClient *cptr, aClient *sptr, int parc, char *parv[])
                        ClearCoAdmin(sptr);
                if (IsTechAdmin(sptr))
                        ClearTechAdmin(sptr);
+               if (sptr->user->snomask & SNO_CLIENT)
+                       sptr->user->snomask &= ~SNO_CLIENT;
+               if (sptr->user->snomask & SNO_FCLIENT)
+                       sptr->user->snomask &= ~SNO_FCLIENT;
+               if (sptr->user->snomask & SNO_FLOOD)
+                       sptr->user->snomask &= ~SNO_FLOOD;
+               if (sptr->user->snomask & SNO_JUNK)
+                       sptr->user->snomask &= ~SNO_JUNK;
+               if (sptr->user->snomask & SNO_EYES)
+                       sptr->user->snomask &= ~SNO_EYES;
+               if (sptr->user->snomask & SNO_VHOST)
+                       sptr->user->snomask &= ~SNO_VHOST;
+               if (sptr->user->snomask & SNO_TKL)
+                       sptr->user->snomask &= ~SNO_TKL;
+
        }
 
        /*
@@ -2415,7 +2387,8 @@ void send_umode(cptr, sptr, old, sendmask, umode_buf)
        long old, sendmask;
        char *umode_buf;
 {
-       int *s, flag;
+       int i;
+       long flag;
        char *m;
        int  what = MODE_NULL;
 
@@ -2425,30 +2398,33 @@ void send_umode(cptr, sptr, old, sendmask, umode_buf)
         */
        m = umode_buf;
        *m = '\0';
-       for (s = user_modes; (flag = *s); s += 2)
+       for (i = 0; i <= Usermode_highest; i++)
        {
+               if (!Usermode_Table[i].flag)
+                       continue;
+               flag = Usermode_Table[i].mode;
                if (MyClient(sptr) && !(flag & sendmask))
                        continue;
                if ((flag & old) && !(sptr->umodes & flag))
                {
                        if (what == MODE_DEL)
-                               *m++ = *(s + 1);
+                               *m++ = Usermode_Table[i].flag;
                        else
                        {
                                what = MODE_DEL;
                                *m++ = '-';
-                               *m++ = *(s + 1);
+                               *m++ = Usermode_Table[i].flag;
                        }
                }
                else if (!(flag & old) && (sptr->umodes & flag))
                {
                        if (what == MODE_ADD)
-                               *m++ = *(s + 1);
+                               *m++ = Usermode_Table[i].flag;
                        else
                        {
                                what = MODE_ADD;
                                *m++ = '+';
-                               *m++ = *(s + 1);
+                               *m++ = Usermode_Table[i].flag;
                        }
                }
        }
index a62b8c33f55f47e47ce7e1b568ef5f4dcd7eee9c..ece29e239af96bb1e79de78eea6b8ab33e85613b 100644 (file)
Binary files a/src/ssl.rnd and b/src/ssl.rnd differ
diff --git a/src/umodes.c b/src/umodes.c
new file mode 100644 (file)
index 0000000..b3f4267
--- /dev/null
@@ -0,0 +1,183 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, s_unreal.c
+ *   (C) 1999-2000 Carsten Munk (Techie/Stskeeps) <stskeeps@tspre.org>
+ *
+ *   See file AUTHORS in IRC package for additional names of
+ *   the programmers. 
+ *
+ *   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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "struct.h"
+#include "common.h"
+#include "sys.h"
+#include "numeric.h"
+#include "msg.h"
+#include "channel.h"
+#include "version.h"
+#include <time.h>
+#ifdef _WIN32
+#include <sys/timeb.h>
+#endif
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef _WIN32
+#include <io.h>
+#endif
+#include <fcntl.h>
+#include "h.h"
+
+extern char umodestring[UMODETABLESZ+1];
+
+aUMtable *Usermode_Table = NULL;
+short   Usermode_highest = 0;
+
+long UMODE_INVISIBLE = 0L; /*  0x0001   makes user invisible */
+long UMODE_OPER = 0L;      /*  0x0002   Operator */
+long UMODE_WALLOP = 0L;    /*  0x0004   send wallops to them */
+long UMODE_FAILOP = 0L;    /*  0x0008   Shows some global messages */
+long UMODE_HELPOP = 0L;    /*  0x0010   Help system operator */
+long UMODE_REGNICK = 0L;   /*  0x0020   Nick set by services as registered */
+long UMODE_SADMIN = 0L;    /*  0x0040   Services Admin */
+long UMODE_ADMIN = 0L;     /*  0x0080   Admin */
+long UMODE_SERVNOTICE = 0L;/* 0x0100    server notices such as kill */
+long UMODE_LOCOP = 0L;     /* 0x0200    Local operator -- SRB */
+long UMODE_RGSTRONLY = 0L; /* 0x0400  Only reg nick message */
+long UMODE_WEBTV = 0L;     /* 0x0800  WebTV Client */
+long UMODE_SERVICES = 0L;  /* 0x4000    services */
+long UMODE_HIDE = 0L;       /* 0x8000   Hide from Nukes */
+long UMODE_NETADMIN = 0L;  /* 0x10000   Network Admin */
+long UMODE_TECHADMIN = 0L; /* 0x40000   Tech Admin */
+long UMODE_COADMIN = 0L;   /* 0x80000   Co Admin */
+long UMODE_WHOIS = 0L;     /* 0x100000  gets notice on /whois */
+long UMODE_KIX = 0L;       /* 0x200000  usermode +q */
+long UMODE_BOT = 0L;       /* 0x400000  User is a bot */
+long UMODE_SECURE = 0L;    /*  0x800000         User is a secure connect */
+long UMODE_HIDING = 0L;    /* 0x2000000         Totally invisible .. */
+long UMODE_VICTIM = 0L;    /* 0x8000000         Intentional Victim */
+long UMODE_DEAF = 0L;      /* 0x10000000       Deaf */
+long UMODE_HIDEOPER = 0L;  /* 0x20000000        Hide oper mode */
+long UMODE_SETHOST = 0L;   /* 0x40000000        used sethost */
+long UMODE_STRIPBADWORDS = 0L; /* 0x80000000    */
+
+
+
+void   umode_init(void)
+{
+       long val = 1;
+       int     i;
+       Usermode_Table = (aUMtable *)MyMalloc(sizeof(aUMtable) * UMODETABLESZ);
+       bzero(Usermode_Table, sizeof(aUMtable) * UMODETABLESZ);
+       for (i = 0; i < UMODETABLESZ; i++)
+       {
+               Usermode_Table[i].mode = val;
+               val *= 2;
+       }
+       Usermode_highest = 0;
+       /* Set up modes */
+       UMODE_INVISIBLE = umode_get('i'); /*  0x0001    /* makes user invisible */
+       UMODE_OPER = umode_get('o');      /*  0x0002     Operator */
+       UMODE_WALLOP = umode_get('w');    /*  0x0004     send wallops to them */
+       UMODE_FAILOP = umode_get('g');    /*  0x0008     Shows some global messages */
+       UMODE_HELPOP = umode_get('h');    /*  0x0010     Help system operator */
+       UMODE_REGNICK = umode_get('r');   /*  0x0020     Nick set by services as registered */
+       UMODE_SADMIN = umode_get('a');    /*  0x0040     Services Admin */
+       UMODE_ADMIN = umode_get('A');     /*  0x0080     Admin */
+       UMODE_SERVNOTICE = umode_get('s');/* 0x0100      server notices such as kill */
+       UMODE_LOCOP = umode_get('O');     /* 0x0200      Local operator -- SRB */
+       UMODE_RGSTRONLY = umode_get('R'); /* 0x0400  Only reg nick message */
+       UMODE_WEBTV = umode_get('V');     /* 0x0800  WebTV Client */
+       UMODE_SERVICES = umode_get('S');  /* 0x4000      services */
+       UMODE_HIDE = umode_get('x');         /* 0x8000   Hide from Nukes */
+       UMODE_NETADMIN = umode_get('N');  /* 0x10000     Network Admin */
+       UMODE_TECHADMIN = umode_get('T'); /* 0x40000     Tech Admin */
+       UMODE_COADMIN = umode_get('C');   /* 0x80000     Co Admin */
+       UMODE_WHOIS = umode_get('W');     /* 0x100000    gets notice on /whois */
+       UMODE_KIX = umode_get('q');       /* 0x200000    usermode +q */
+       UMODE_BOT = umode_get('B');       /* 0x400000    User is a bot */
+       UMODE_SECURE = umode_get('z');    /*    0x800000         User is a secure connect */
+       UMODE_HIDING = umode_get('I');    /* 0x2000000   Totally invisible .. */
+       UMODE_VICTIM = umode_get('v');    /* 0x8000000   Intentional Victim */
+       UMODE_DEAF = umode_get('d');      /* 0x10000000       Deaf */
+       UMODE_HIDEOPER = umode_get('H');  /* 0x20000000  Hide oper mode */
+       UMODE_SETHOST = umode_get('t');   /* 0x40000000  used sethost */
+       UMODE_STRIPBADWORDS = umode_get('G'); /* 0x80000000      */
+}
+
+void make_umodestr(void)
+{
+       int i;
+       char *m;
+
+       m = umodestring;
+       for (i = 0; i <= Usermode_highest; i++)
+       {
+               if (Usermode_Table[i].flag)
+                       *m++ = Usermode_Table[i].flag;
+       }
+       *m = '\0';
+}
+long   umode_get(char ch)
+{
+       short    i = 0;
+       short    j = 0;
+       while (i < UMODETABLESZ)
+       {
+               if (!Usermode_Table[i].flag)
+               {
+                       break;
+               }
+               i++;
+       }
+       if (i != UMODETABLESZ)
+       {
+               Usermode_Table[i].flag = ch;
+               Debug((DEBUG_DEBUG, "umode_get(%c) returning %04x",
+                       ch, Usermode_Table[i].mode));
+               /* Update usermode table highest */
+               for (j = 0; j < UMODETABLESZ; j++)
+                       if (Usermode_Table[i].flag)
+                               if (i > Usermode_highest)
+                                       Usermode_highest = i;
+               make_umodestr();
+               return (Usermode_Table[i].mode);
+       }
+       else
+       {
+               Debug((DEBUG_DEBUG, "umode_get failed, no space"));
+               return (0);
+       }
+}
+
+
+int    umode_delete(char ch, long val)
+{
+       int i = 0;
+       Debug((DEBUG_DEBUG, "umode_delete %c, %li",
+               ch, val));      
+       
+       while (i < UMODETABLESZ)
+       {
+               if ((Usermode_Table[i].flag == ch) && (Usermode_Table[i].mode == val))
+               {
+                       Usermode_Table[i].flag = '\0';
+                       return 1;
+               }       
+               i++;
+       }
+       return -1;
+}
diff --git a/src/win32/config.c b/src/win32/config.c
new file mode 100644 (file)
index 0000000..0b84fe2
--- /dev/null
@@ -0,0 +1,78 @@
+
+#include <stdio.h>
+#include <string.h>
+int main() {
+       FILE *fd = fopen("Changes", "r");
+       FILE *fd2;
+       char buf[1024];
+       int i = 0, space = 0, j = 0;
+       char releaseid[512];
+       int generation = 0;
+
+       if (!fd) {
+               return -1;
+       }
+
+       while (fgets(buf, 1023, fd)) {
+               if (!strstr(buf, "Changes,v"))
+                       continue;
+               else {
+                       while (!isdigit(buf[i]))
+                               i++;
+                       j = i;
+                       while (buf[j]) {
+                               if (buf[j] == ' ')
+                                       space++;
+                               if (space == 3) {
+                                       buf[j] = 0;
+                                       break;
+                               }
+                               j++;
+                       }
+                       strcpy(releaseid,&buf[i]);
+               }
+       }
+       fclose(fd);
+       i = 0;
+       fd = fopen("src/version.c", "r");
+       if (!fd)
+               generation = 1;
+       else {
+               while (fgets(buf, 1023, fd)) {
+                       if (!strstr(buf, "char *generation"))
+                               continue;
+                       while (!isdigit(buf[i]))
+                                       i++;
+                       j = i;
+                       while (isdigit(buf[j])) 
+                               j++;
+                       buf[j] = 0;
+                       generation = (atoi(&buf[i])+1);
+               }
+       }
+       fd = fopen("src/version.c.sh", "r");
+       if (!fd)
+               return 0;
+       fd2 = fopen("src/version.c", "w");
+       if (!fd2)
+               return 0;
+       while (fgets(buf, 1023, fd)) {
+               if (!strncmp("cat >version.c <<!SUB!THIS!",buf,27)) {
+                       while (fgets(buf, 1023, fd)) {
+                               if (!strncmp("!SUB!THIS!",buf,10))
+                                       break;
+                               if (!strncmp("char *creation = \"$creation\";",buf,29)) 
+                                       fprintf(fd2,"char *creation = __TIMESTAMP__;\n");
+                               else if (!strncmp("char *generation = \"$generation\";",buf,33))
+                                       fprintf(fd2,"char *generation = \"%d\";\n",generation);
+                               else if (!strncmp("char *buildid = \"$id\";",buf,22))
+                                       fprintf(fd2,"char *buildid = \"%s\";\n",releaseid);
+                               else
+                                       fprintf(fd2,"%s", buf);
+                       }
+               }
+       }
+
+
+}
+       
\ No newline at end of file