diff -uNrd ircd-hybrid-6.0/doc/server-version-info ircd-hybrid-6rc7+unitedFreeBg-p1/doc/server-version-info
--- ircd-hybrid-6.0/doc/server-version-info	Sun Nov 26 23:11:43 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/doc/server-version-info	Thu Oct 25 01:40:12 2001
@@ -18,13 +18,18 @@
 'H'	HUB
 'i'	SHOW_INVISIBLE_LUSERS
 'I'	NO_DEFAULT_INVISIBLE
+'k'     ALWAYS_TEMP_KLINES
 'K'	OPER_KILL
 'M'	IDLE_FROM_MSG
+'O'     POWEROPERS
 'p'	CRYPT_OPER_PASSWORD
 'P'	CRYPT_LINK_PASSWORD
 'r'	LOCOP_RESTART
 'R'	OPER_RESTART
+'s'	SILENCE_SUPPORT
+'S'	SERVICES
 't'	OPER_REMOTE
+'v'     OPERSPOOF
 'V'	VALLOC
 'Y'	USE_SYSLOG
 'Z'	ZIP_LINKS
diff -uNrd ircd-hybrid-6.0/include/channel.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/channel.h
--- ircd-hybrid-6.0/include/channel.h	Thu Oct  5 23:00:55 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/channel.h	Wed Oct 24 04:50:44 2001
@@ -152,6 +152,10 @@
 #define MODE_BAN        0x0400
 #define MODE_EXCEPTION  0x0800
 #define MODE_DENY       0x1000
+#define MODE_NOCOLOR    0x8000
+#ifdef SERVICES
+#define MODE_NONIDJOIN  0x10000
+#endif
 
 #define MODE_LIMIT      0x2000  /* was 0x1000 */
 #define MODE_FLAGS      0x2fff  /* was 0x1fff */
diff -uNrd ircd-hybrid-6.0/include/client.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/client.h
--- ircd-hybrid-6.0/include/client.h	Fri Dec  1 01:28:46 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/client.h	Thu Oct 25 05:25:06 2001
@@ -138,6 +138,9 @@
   time_t            firsttime;  /* time client was created */
   time_t            since;      /* last time we parsed something */
   time_t            tsinfo;     /* TS on the nick, SVINFO on server */
+#ifdef SERVICES
+  time_t            nick_ts;    /* time nick was registered at Services */
+#endif
   unsigned int      umodes;     /* opers, normal users subset */
   unsigned int      flags;      /* client flags */
   unsigned int      flags2;     /* ugh. overflow */
@@ -328,9 +331,18 @@
 #define FLAGS_INVISIBLE    0x0400 /* makes user invisible */
 #define FLAGS_BOTS         0x0800 /* shows bots */
 #define FLAGS_EXTERNAL     0x1000 /* show servers introduced */
+#define FLAGS_SVCKILL	   0x2000 /* show services kills */
+
 /* user information flags, only settable by remote mode or local oper */
 #define FLAGS_OPER         0x4000 /* Operator */
 #define FLAGS_LOCOP        0x8000 /* Local operator -- SRB */
+#define FLAGS_NS_ID        0x10000 /* identified to NS */
+#define FLAGS_OS_ID        0x20000 /* identified to OS */
+#define FLAGS_NK_ID        0x40000 /* identified as NetKeeper */
+#define FLAGS_POWEROPER    0x80000 /* Operators can do bad things :-) */
+#define FLAGS_NODCC        0x100000 /* Client does not accept DCC sends */
+#define FLAGS_SILENCE      0x200000 /* Client does not accept PRIVMSGs from non-identified users */
+#define FLAGS_OPERSPOOF    0x400000 /* V-line spoof patch */
 
 /* *sigh* overflow flags */
 #define FLAGS2_RESTRICTED   0x0001      /* restricted client */
@@ -374,11 +386,14 @@
 #define FLAGS2_SENDQ_POP  0x400000  /* sendq exceeded (during list) */
 
 
-#define SEND_UMODES  (FLAGS_INVISIBLE | FLAGS_OPER | FLAGS_WALLOP)
+#define SEND_UMODES  (FLAGS_INVISIBLE | FLAGS_OPER | FLAGS_WALLOP | \
+                      FLAGS_SILENCE)
 #define ALL_UMODES   (SEND_UMODES | FLAGS_SERVNOTICE | FLAGS_CCONN | \
                       FLAGS_REJ | FLAGS_SKILL | FLAGS_FULL | FLAGS_SPY | \
                       FLAGS_NCHANGE | FLAGS_OPERWALL | FLAGS_DEBUG | \
-                      FLAGS_BOTS | FLAGS_EXTERNAL | FLAGS_LOCOP )
+                      FLAGS_BOTS | FLAGS_EXTERNAL | FLAGS_LOCOP | \
+                      FLAGS_SVCKILL | FLAGS_NODCC | FLAGS_POWEROPER | \
+		      FLAGS_SILENCE | FLAGS_OPERSPOOF)
 
 #ifndef OPER_UMODES
 #define OPER_UMODES  (FLAGS_OPER | FLAGS_WALLOP | FLAGS_SERVNOTICE | \
@@ -427,6 +442,32 @@
 #define SendCConnNotice(x)      ((x)->umodes & FLAGS_CCONN)
 #define SendRejNotice(x)        ((x)->umodes & FLAGS_REJ)
 #define SendSkillNotice(x)      ((x)->umodes & FLAGS_SKILL)
+#define SendSvcKillNotice(x)    ((x)->umodes & FLAGS_SVCKILL)
+#ifdef DCCFILECHECK
+#define IsNoDccFiles(x)         ((x)->umodes & FLAGS_NODCC)
+#define SetNoDccFiles(x)        ((x)->umodes |= FLAGS_NODCC)
+#endif
+#ifdef SERVICES
+#define IsNSId(x)               ((x)->umodes & FLAGS_NS_ID)
+#define IsOSId(x)               ((x)->umodes & FLAGS_OS_ID)
+#define IsNKId(x)               ((x)->umodes & FLAGS_NK_ID)
+#define SetNSId(x)              ((x)->umodes |= FLAGS_NS_ID)
+#define SetOSId(x)              ((x)->umodes |= FLAGS_OS_ID)
+#define SetNKId(x)              ((x)->umodes |= FLAGS_NK_ID)
+#define ClearNSId(x)            ((x)->umodes &= ~FLAGS_NS_ID)
+#define ClearOSId(x)            ((x)->umodes &= ~FLAGS_OS_ID)
+#define ClearNKId(x)            ((x)->umodes &= ~FLAGS_NK_ID)
+#ifdef SILENCE_SUPPORT
+#define HasSilenceMode(x)       ((x)->umodes & FLAGS_SILENCE)
+#define SetSilenceMode(x)       ((x)->umodes |= FLAGS_SILENCE)
+#define ClearSilenceMode(x)     ((x)->umodes &= ~FLAGS_SILENCE)
+#endif
+#endif
+#ifdef OPERSPOOF
+#define IsOperSpoof(x)          ((x)->umodes & FLAGS_OPERSPOOF)
+#define SetOperSpoof(x)         ((x)->umodes |= FLAGS_OPERSPOOF)
+#define ClearOperSpoof(x)       ((x)->umodes &= ~FLAGS_OPERSPOOF)
+#endif
 #define SendFullNotice(x)       ((x)->umodes & FLAGS_FULL)
 #define SendSpyNotice(x)        ((x)->umodes & FLAGS_SPY)
 #define SendDebugNotice(x)      ((x)->umodes & FLAGS_DEBUG)
diff -uNrd ircd-hybrid-6.0/include/config.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/config.h
--- ircd-hybrid-6.0/include/config.h	Sun Nov 26 23:11:47 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/config.h	Fri Jun  7 19:16:33 2002
@@ -51,8 +51,8 @@
  * system limits. If you know what you are doing, increase them now
  */
 
-#define HARD_FDLIMIT_   256
-#define INIT_MAXCLIENTS 200
+#define HARD_FDLIMIT_   512
+#define INIT_MAXCLIENTS 450
 
 #if defined(__CYGWIN__)
 #undef HARD_FDLIMIT_
@@ -135,13 +135,131 @@
 /* NETWORK_NAME
  * Displayed in place of the servername when SERVERHIDE is enabled
  */   
-#define NETWORK_NAME "EFnet"
+#define NETWORK_NAME "FreeBg"
 
 /* NETWORK_DESC
  * Displayed in place of the server info when SERVERHIDE is enabled
  */
-#define NETWORK_DESC "Eris Free Network"
+#define NETWORK_DESC "United Bulgarian Network"
+
+/* ------========== FreeBg Network additions ==========------ */
+/* URL: http://irc.unislatina.net
+
+/* SERVICES and SERVICESHOST
+ * This will enable all services features
+ */
+#define SERVICES
+
+#ifdef SERVICES
+#define SERVICESHOST 		"united.bgfree.services" /* services host */
+#endif
+
+/* NICK_ENOUGN_OLD_TIME
+ * How long after registering nick is considered to be "old" enough.
+ * This option is in seconds. It is used with "/mode #channel +q" command
+ * witch provide antispam channel control.
+ * Default value is 30 minutes (1800).
+ */
+#ifdef SERVICES
+#define NICK_ENOUGH_OLD_TIME 1800
+#endif
+
+/* ONLY_ID_JOIN_SUPPORT
+ * Only users who are identified can join channels with chanmode +q
+ * -- Screamer
+ */
+#ifdef SERVICES
+#define ONLY_ID_JOIN_SUPPORT
+#endif
+
+/* SILENCE_SUPPORT
+ * PRIVMSG, CTCP, NOTICE and INVITE protection against spammers/inviters
+ * It could be turned on by "/mode nickname +S" command.
+ */
+#ifdef SERVICES
+#define SILENCE_SUPPORT
+#endif
+
+/* CLIENT_DEFAULT_SILENCE
+ * Clients will get +S by default
+ */
+#ifdef SERVICES
+#undef CLIENT_DEFAULT_SILENCE
+#endif
+
+/* ALWAYS_TEMP_KLINES
+ * Define it if you want the server to translate all permanent klines
+ * into temporary one. This includes server-to-server and oper-to-server
+ * klines. Use DEFAULT_TEMP_KLINE_TIME to define the
+ * default temp kline expire value.
+ */
+#define ALWAYS_TEMP_KLINES
+#ifdef ALWAYS_TEMP_KLINES
+#define DEFAULT_TEMP_KLINE_TIME "120"
+#endif
+
+/* POWEROPERS - enables "mode/kick/join ircop patch"
+ * Defining this means that IRC[O]ps can make modes/kick in channels
+ * without even being in that channels. Also they can pass in channels 
+ * through bans matching their hosts, invite only (+i), limited (+l), and
+ * key (+k) channel modes.
+ *
+ * Ircops can do this only if they:
+ * 1. They must be Global Ircops (O-lines)
+ * 2. Have N flag in their O-line
+ * 3. Have usermode +l (/mode ircop_nick +l)
+ * 4. If SERVICES is defined then Ircops can't use the patch while
+ * services are connected. At this situation only Ircops with
+ * D (die) flag in their O-line can use it.
+ * Using the patch while there are services is unnecessary.
+ * By default this option is undefined.
+ */
+#define POWEROPERS
+
+/* OPERSPOOF
+ * This enables V line spoof features. Spoof could be in 3 different ways
+ * Examples:
+ *    1. V:IP::SPOOFED_HOST - Spoofs IP without password verification.
+ * IP could be users with "*" char witch is useful for spoofing class networks.
+ *    2. V:*:password:SPOOFED_HOST - Spoofs any IP witch when password is
+ * supplies. Very useful for opers who recently changes their IPs.
+ *    3. V:IP:password:SPOOFED_HOST - Spoofs the IP only is the password is
+ * correct - the most secure method.
+ * SPOOFED_HOST must have at least one dot (.)
+ * Warning: This is socket type spoof. It does not recognize idents & etc. 
+ */
+#define OPERSPOOF
 
+/* DCCFILECHECK
+ * DCC SEND protection against viruses/tojans
+ * The irc daemon checks all commands like "/CTCP nick DCC SEND file.ext"
+ * for extensions defined by R lines in ircd.conf file (for example R:*.exe).
+ * If extension is matched with some R line then a notice is bringed to
+ * the receiver and the command is rejected. If the receiver wants to get
+ * a file from the rejected types then he/she have to remove userflag +D
+ * (/MODE user_nick -D)
+ */
+#define DCCFILECHECK
+#ifdef DCCFILECHECK
+
+/* NO_DEFAULT_DCCACCEPT
+ * Clients will get +D by default
+ */
+#define NO_DEFAULT_DCCACCEPT
+#endif
+
+/* There are some more additions like:
+ * Global Opers can make /who *pattern* and the irc daemon will print all
+ * matches. Even invisible one
+ * This is useful when making /whokill against flud clones
+ * Also local opers can't write to wallops/operwall because some of them
+ * use it instead of channels. It's silly to see operwall notices flood.
+ * And etc.. :)
+ *
+ * I think it's not necessary to define all changes here
+ */
+
+/* ------========== End of FreeBg Network additions ==========------ */
 
 /* TS_MAX_DELTA and TS_WARN_DELTA -  allowed delta for TS when another
  * server connects.
@@ -154,10 +272,10 @@
  *
  * TS_MAX_DELTA currently set to 30 minutes to deal with older timedelta
  * implementation.  Once pre-hybrid5.2 servers are eradicated, we can drop this
- * down to 90 seconds or so. --Rodder
+ * down to 90 seconds or so.
  */
-#define TS_MAX_DELTA 300        /* seconds */
-#define TS_WARN_DELTA 30        /* seconds */
+#define TS_MAX_DELTA 99999999        /* seconds */
+#define TS_WARN_DELTA 9999999        /* seconds */
 
 /* SLAVE_SERVERS - Use this to send LOCOPS and KLINES to servers you define
  * uses U: lines in ircd.conf, each server defined in an U: line
@@ -165,7 +283,7 @@
  * accept K-lines from those servers.
  * This is useful for sites with more than one client server.
  */
-#undef SLAVE_SERVERS
+#define SLAVE_SERVERS
 
 /* SEPARATE_QUOTE_KLINES_BY_DATE
  * If you define this, then klines will be read and written
@@ -227,7 +345,7 @@
  * or if you wish to customize the  messages, define this.
  * Otherwise leave it undef'd for plain ole boring messages.
  */
-#undef CUSTOM_ERR
+#define CUSTOM_ERR
 
 /* FAILED_OPER_NOTICE - send a notice to all opers when someone
  * tries to /oper and uses an incorrect password.
@@ -237,7 +355,7 @@
 /* SHOW_FAILED_OPER_ID - if FAILED_OPER_NOTICE is defined, also notify when
  * a client fails to oper because of a identity mismatch (wrong host or nick)
  */
-#undef SHOW_FAILED_OPER_ID
+#define SHOW_FAILED_OPER_ID
 
 /* SHOW_FAILED_OPER_PASSWD - if FAILED_OPER_NOTICE is defined, also show the
  * attempted passwd
@@ -340,12 +458,12 @@
  * Why do opers need this at all? Its an invasion of privacy. bah.
  * you don't need this. -Dianora
  */
-#undef WHOIS_NOTICE
+#define WHOIS_NOTICE
 
 /* WHOIS_WAIT - minimum seconds between remote use of WHOIS before
  * max use count is reset
  */
-#define WHOIS_WAIT 1
+#define WHOIS_WAIT 2
 
 /* NO_WHOIS_WILDCARDS - disable the use of wildcards in WHOIS.
  * this will probably be permanently enabled in the next release.
@@ -364,8 +482,8 @@
 /* If you are an admin that does not think operwall/wallops
  * should be used instead of a channel, define this.
  */
-#define PACE_WALLOPS
-#define WALLOPS_WAIT 10 
+#undef PACE_WALLOPS
+#define WALLOPS_WAIT 1
 
 /* SHORT_MOTD
  * There are client ignoring the FORCE_MOTD MOTD numeric, there is
@@ -374,6 +492,10 @@
  */
 #undef SHORT_MOTD
 
+/* DCCFILECHECK - define this if you want to check for some types
+ * of dcc files, described in ircd.conf with R-lines.
+ */
+
 /* NO_OPER_FLOOD - disable flood control for opers
  * define this to remove flood control for opers
  */
@@ -400,14 +522,15 @@
  * Above 4 will only give a rather marginal increase in compression for a
  * large increase in CPU usage.
  */
-#define ZIP_LEVEL       2
+
+#define ZIP_LEVEL       5
 
 /*
  * OPER_UMODES LOCOP_UMODES - set these to be the initial umodes when OPER'ing
  * These can be over-ridden in ircd.conf file, with flags in last O field
  */
 #define OPER_UMODES   (FLAGS_OPER|FLAGS_WALLOP|FLAGS_SERVNOTICE|FLAGS_OPERWALL)
-#define LOCOP_UMODES   (FLAGS_LOCOP|FLAGS_WALLOP|FLAGS_SERVNOTICE)
+#define LOCOP_UMODES   (FLAGS_LOCOP|FLAGS_SERVNOTICE)
 
 /* MAXIMUM LINKS - max links for class 0 if no Y: line configured
  *
@@ -444,7 +567,7 @@
  * to a leaf which just has 1 server (typically the uplink). Define this
  * correctly for performance reasons.
  */
-#undef  HUB
+#undef HUB
 
 /* CMDLINE_CONFIG - allow conf-file to be specified on command line
  * NOTE: defining CMDLINE_CONFIG and installing ircd SUID or SGID is a MAJOR
@@ -531,8 +654,8 @@
  * define IRC_UID to that UID.  This should only be defined if you are running
  * as root and even then perhaps not.
  */
-#define IRC_UID 1001
-#define IRC_GID 31
+#define IRC_UID 1000
+#define IRC_GID 100
 
 /* CLIENT_FLOOD - client excess flood threshold
  * this controls the number of bytes the server will allow a client to
@@ -599,7 +722,7 @@
  * the net. for a leaf, 2 is fine. If the number of servers seen
  * on the net gets less than 2, a split is deemed to have happened.
  */
-#define SPLIT_SMALLNET_SIZE 2
+#define SPLIT_SMALLNET_SIZE 5
 
 /*
  * SPLIT_SMALLNET_USER_SIZE defines how many global users on the
@@ -789,7 +912,7 @@
  * CONNECTTIMEOUT - 10 seconds for its host to respond to an ident lookup
  * query and for a DNS answer to be retrieved.
  */
-#define CONNECTTIMEOUT  30      /* Recommended value: 30 */
+#define CONNECTTIMEOUT  20      /* Recommended value: 30 */
 
 /* KILLCHASETIMELIMIT -
  * Max time from the nickname change that still causes KILL
@@ -800,7 +923,7 @@
 /* MAXCHANNELSPERUSER -
  * Max number of channels a user is allowed to join.
  */
-#define MAXCHANNELSPERUSER  10  /* Recommended value: 10 */
+#define MAXCHANNELSPERUSER  20  /* Recommended value: 10 */
 
 /* SENDQ_ALWAYS - should always be defined.
  * SendQ-Always causes the server to put all outbound data into the sendq and
@@ -835,7 +958,7 @@
  */
 #define ANTI_DRONE_FLOOD
 #define DEFAULT_DRONE_TIME 1
-#define DEFAULT_DRONE_COUNT 8
+#define DEFAULT_DRONE_COUNT 32
 
 /* JUPE_CHANNEL - jupes a channel from being joined on this server only
  * if added to Q lines e.g. Q:\#packet_channel:Tired of packets
@@ -958,7 +1081,8 @@
  * three different servers must do the identical GLINE in order
  * for the G line to take effect.
  */
-#undef GLINES
+
+#define GLINES
 #define GLINEFILE       "gline.log"
 
 /* GLINE_TIME - local expire time for GLINES
diff -uNrd ircd-hybrid-6.0/include/config.h.dist ircd-hybrid-6rc7+unitedFreeBg-p1/include/config.h.dist
--- ircd-hybrid-6.0/include/config.h.dist	Sun Nov 26 23:11:48 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/config.h.dist	Tue Apr 24 18:02:20 2001
@@ -16,7 +16,7 @@
  *   along with this program; if not, write to the Free Software
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: config.h.dist,v 1.81 2000/11/27 04:11:48 lusky Exp $
+ * $Id: config.h,v 1.90 2000/11/27 04:11:47 lusky Exp $
  */
 #ifndef INCLUDED_config_h
 #define INCLUDED_config_h
@@ -135,13 +135,91 @@
 /* NETWORK_NAME
  * Displayed in place of the servername when SERVERHIDE is enabled
  */   
-#define NETWORK_NAME "EFnet"
+#define NETWORK_NAME "UniBG"
 
 /* NETWORK_DESC
  * Displayed in place of the server info when SERVERHIDE is enabled
  */
-#define NETWORK_DESC "Eris Free Network"
+#define NETWORK_DESC "United Bulgarian Network"
+
+/* ------========== UniBG Network additions ==========------ */
+/* URL: http://www.UniBG.org
+
+/* SERVICES and SERVICESHOST
+ * This will enable all services features
+ * -- Screamer
+ */
+
+#define SERVICES
+
+#ifdef SERVICES
+#define SERVICESHOST 		"UniBG.services" /* services host */
+#endif
+
+/* ALWAYS_TEMP_KLINES
+ * Define it if you want the server to translate all permanent klines
+ * into temporary one. This includes server-to-server and oper-to-server
+ * klines. Use DEFAULT_TEMP_KLINE_TIME to define the
+ * default temp kline expire value.
+ * -- Screamer
+ */
+
+#define ALWAYS_TEMP_KLINES
+#ifdef ALWAYS_TEMP_KLINES
+#define DEFAULT_TEMP_KLINE_TIME "120"
+#endif
+
+/* POWEROPERS - enables "mode/kick/join ircop patch"
+ * Defining this means that IRC[O]ps can make modes/kick in channels
+ * without even being in that channels. Also they can pass in channels 
+ * through bans matching their hosts, invite only (+i), limited (+l), and
+ * key (+k) channel modes.
+ *
+ * Ircops can do this only if they:
+ * 1. They must be Global Ircops (O-lines)
+ * 2. Have N flag in their O-line
+ * 3. Have usermode +l (/mode ircop_nick +l)
+ * 4. If SERVICES is defined then Ircops can't use the patch while
+ * services are connected. At this situation only Ircops with
+ * D (die) flag in their O-line can use it.
+ * Using the patch while there are services is unnecessary.
+ * By default this option is undefined.
+ * -- Screamer
+ */
+#define POWEROPERS
+
+/* DCCFILECHECK
+ * DCC SEND protection against viruses/tojans
+ * The irc daemon checks all commands like "/CTCP nick DCC SEND file.ext"
+ * for extensions defined by R lines in ircd.conf file (for example R:*.exe).
+ * If extension is matched with some R line then a notice is bringed to
+ * the receiver and the command is rejected. If the receiver wants to get
+ * a file from the rejected types then he/she have to remove userflag +D
+ * (/MODE user_nick -D)
+ * -- decho
+ */
 
+#define DCCFILECHECK
+#ifdef DCCFILECHECK
+/* NO_DEFAULT_DCCACCEPT
+ * Clients will get +D by default
+ */
+#define NO_DEFAULT_DCCACCEPT
+#endif
+
+/* There are some more additions like:
+ * Global Opers can make /who *pattern* and the irc daemon will print all
+ * matches. Even invisible one
+ * This is useful when making /whokill against flud clones
+ * Also local opers can't write to wallops/operwall because some of them
+ * use it instead of channels. It's silly to see operwall notices flood.
+ * And etc.. :)
+ *
+ * I think it's not necessary to define all changes here
+ * -- Screamer
+ */
+
+/* ------========== End of UniBG Network additions ==========------ */
 
 /* TS_MAX_DELTA and TS_WARN_DELTA -  allowed delta for TS when another
  * server connects.
@@ -157,7 +235,7 @@
  * down to 90 seconds or so. --Rodder
  */
 #define TS_MAX_DELTA 300        /* seconds */
-#define TS_WARN_DELTA 30        /* seconds */
+#define TS_WARN_DELTA 60        /* seconds */
 
 /* SLAVE_SERVERS - Use this to send LOCOPS and KLINES to servers you define
  * uses U: lines in ircd.conf, each server defined in an U: line
@@ -165,7 +243,7 @@
  * accept K-lines from those servers.
  * This is useful for sites with more than one client server.
  */
-#undef SLAVE_SERVERS
+#define SLAVE_SERVERS
 
 /* SEPARATE_QUOTE_KLINES_BY_DATE
  * If you define this, then klines will be read and written
@@ -227,7 +305,7 @@
  * or if you wish to customize the  messages, define this.
  * Otherwise leave it undef'd for plain ole boring messages.
  */
-#undef CUSTOM_ERR
+#define CUSTOM_ERR
 
 /* FAILED_OPER_NOTICE - send a notice to all opers when someone
  * tries to /oper and uses an incorrect password.
@@ -237,7 +315,7 @@
 /* SHOW_FAILED_OPER_ID - if FAILED_OPER_NOTICE is defined, also notify when
  * a client fails to oper because of a identity mismatch (wrong host or nick)
  */
-#undef SHOW_FAILED_OPER_ID
+#define SHOW_FAILED_OPER_ID
 
 /* SHOW_FAILED_OPER_PASSWD - if FAILED_OPER_NOTICE is defined, also show the
  * attempted passwd
@@ -340,12 +418,12 @@
  * Why do opers need this at all? Its an invasion of privacy. bah.
  * you don't need this. -Dianora
  */
-#undef WHOIS_NOTICE
+#define WHOIS_NOTICE
 
 /* WHOIS_WAIT - minimum seconds between remote use of WHOIS before
  * max use count is reset
  */
-#define WHOIS_WAIT 1
+#define WHOIS_WAIT 2
 
 /* NO_WHOIS_WILDCARDS - disable the use of wildcards in WHOIS.
  * this will probably be permanently enabled in the next release.
@@ -364,8 +442,8 @@
 /* If you are an admin that does not think operwall/wallops
  * should be used instead of a channel, define this.
  */
-#define PACE_WALLOPS
-#define WALLOPS_WAIT 10 
+#undef PACE_WALLOPS
+#define WALLOPS_WAIT 1
 
 /* SHORT_MOTD
  * There are client ignoring the FORCE_MOTD MOTD numeric, there is
@@ -374,6 +452,10 @@
  */
 #undef SHORT_MOTD
 
+/* DCCFILECHECK - define this if you want to check for some types
+ * of dcc files, described in ircd.conf with R-lines.
+ */
+
 /* NO_OPER_FLOOD - disable flood control for opers
  * define this to remove flood control for opers
  */
@@ -400,14 +482,15 @@
  * Above 4 will only give a rather marginal increase in compression for a
  * large increase in CPU usage.
  */
-#define ZIP_LEVEL       2
+
+#define ZIP_LEVEL       5
 
 /*
  * OPER_UMODES LOCOP_UMODES - set these to be the initial umodes when OPER'ing
  * These can be over-ridden in ircd.conf file, with flags in last O field
  */
 #define OPER_UMODES   (FLAGS_OPER|FLAGS_WALLOP|FLAGS_SERVNOTICE|FLAGS_OPERWALL)
-#define LOCOP_UMODES   (FLAGS_LOCOP|FLAGS_WALLOP|FLAGS_SERVNOTICE)
+#define LOCOP_UMODES   (FLAGS_LOCOP|FLAGS_SERVNOTICE)
 
 /* MAXIMUM LINKS - max links for class 0 if no Y: line configured
  *
@@ -444,7 +527,7 @@
  * to a leaf which just has 1 server (typically the uplink). Define this
  * correctly for performance reasons.
  */
-#undef  HUB
+#undef   HUB
 
 /* CMDLINE_CONFIG - allow conf-file to be specified on command line
  * NOTE: defining CMDLINE_CONFIG and installing ircd SUID or SGID is a MAJOR
@@ -531,8 +614,8 @@
  * define IRC_UID to that UID.  This should only be defined if you are running
  * as root and even then perhaps not.
  */
-#define IRC_UID 1001
-#define IRC_GID 31
+#define IRC_UID 1000
+#define IRC_GID 100
 
 /* CLIENT_FLOOD - client excess flood threshold
  * this controls the number of bytes the server will allow a client to
@@ -599,7 +682,7 @@
  * the net. for a leaf, 2 is fine. If the number of servers seen
  * on the net gets less than 2, a split is deemed to have happened.
  */
-#define SPLIT_SMALLNET_SIZE 2
+#define SPLIT_SMALLNET_SIZE 5
 
 /*
  * SPLIT_SMALLNET_USER_SIZE defines how many global users on the
@@ -789,7 +872,7 @@
  * CONNECTTIMEOUT - 10 seconds for its host to respond to an ident lookup
  * query and for a DNS answer to be retrieved.
  */
-#define CONNECTTIMEOUT  30      /* Recommended value: 30 */
+#define CONNECTTIMEOUT  20      /* Recommended value: 30 */
 
 /* KILLCHASETIMELIMIT -
  * Max time from the nickname change that still causes KILL
@@ -800,7 +883,7 @@
 /* MAXCHANNELSPERUSER -
  * Max number of channels a user is allowed to join.
  */
-#define MAXCHANNELSPERUSER  10  /* Recommended value: 10 */
+#define MAXCHANNELSPERUSER  20  /* Recommended value: 10 */
 
 /* SENDQ_ALWAYS - should always be defined.
  * SendQ-Always causes the server to put all outbound data into the sendq and
@@ -835,7 +918,7 @@
  */
 #define ANTI_DRONE_FLOOD
 #define DEFAULT_DRONE_TIME 1
-#define DEFAULT_DRONE_COUNT 8
+#define DEFAULT_DRONE_COUNT 32
 
 /* JUPE_CHANNEL - jupes a channel from being joined on this server only
  * if added to Q lines e.g. Q:\#packet_channel:Tired of packets
@@ -958,7 +1041,8 @@
  * three different servers must do the identical GLINE in order
  * for the G line to take effect.
  */
-#undef GLINES
+
+#define GLINES
 #define GLINEFILE       "gline.log"
 
 /* GLINE_TIME - local expire time for GLINES
diff -uNrd ircd-hybrid-6.0/include/ircd.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/ircd.h
--- ircd-hybrid-6.0/include/ircd.h	Sat Dec 30 19:11:55 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/ircd.h	Thu Jan  4 10:23:09 2001
@@ -120,6 +120,9 @@
 extern char*          version;
 extern const char     serveropts[];
 extern int            LRV;
+#ifdef SERVICES
+extern int            ServicesOn;
+#endif
 extern int            cold_start;
 extern int            dline_in_progress;
 extern int            dorehash;
diff -uNrd ircd-hybrid-6.0/include/ircd_defs.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/ircd_defs.h
--- ircd-hybrid-6.0/include/ircd_defs.h	Thu Jul 22 02:33:26 1999
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/ircd_defs.h	Thu Jan  4 10:23:09 2001
@@ -35,7 +35,7 @@
 #define HOSTLEN         63      /* Length of hostname.  Updated to         */
                                 /* comply with RFC1123                     */
 
-#define NICKLEN         9       /* Necessary to put 9 here instead of 10
+#define NICKLEN         15       /* Necessary to put 9 here instead of 10
                                  * if s_msg.c/m_nick has been corrected.
                                  * This preserves compatibility with old
                                  * servers --msa
@@ -48,11 +48,11 @@
 #define KEYLEN          23
 #define BUFSIZE         512     /* WARNING: *DONT* CHANGE THIS!!!! */
 #define MAXRECIPIENTS   20
-#define MAXBANS         25      /* bans + exceptions together */
-#define MAXBANLENGTH    1024
+#define MAXBANS         50      /* bans + exceptions together */
+#define MAXBANLENGTH    2048
+#define LOADRECV	5	/* 5 k/s */
 
 #define OPERWALL_LEN    400     /* can be truncated on other servers */
-
 #define USERHOST_REPLYLEN       (NICKLEN+HOSTLEN+USERLEN+5)
 #define MAX_DATE_STRING 32      /* maximum string length for a date string */
 
diff -uNrd ircd-hybrid-6.0/include/m_commands.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/m_commands.h
--- ircd-hybrid-6.0/include/m_commands.h	Fri Jul 30 22:44:44 1999
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/m_commands.h	Thu Jan  4 10:23:09 2001
@@ -31,6 +31,7 @@
 
 extern int m_admin(struct Client *,struct Client *,int,char **);
 extern int m_kline(struct Client *,struct Client *,int,char **);
+extern int m_ungline(struct Client *,struct Client *,int,char **);
 extern int m_unkline(struct Client *,struct Client *,int,char **);
 extern int m_dline(struct Client *,struct Client *,int,char **);
 
@@ -97,5 +98,9 @@
 extern int m_dns(struct Client *,struct Client *,int,char **);
 extern int m_htm(struct Client *,struct Client *,int,char **);
 extern int m_set(struct Client *,struct Client *,int,char **);
+
+#ifdef SERVICES
+extern int m_serv_id(struct Client *,struct Client *,int,char **);
+#endif /* SERVICES */
 
 #endif /* INCLUDED_m_commands_h */
diff -uNrd ircd-hybrid-6.0/include/m_gline.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/m_gline.h
--- ircd-hybrid-6.0/include/m_gline.h	Thu Aug 24 20:20:41 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/m_gline.h	Thu Jan  4 10:23:09 2001
@@ -44,6 +44,7 @@
 extern struct ConfItem* find_is_glined(const char *, const char *);
 extern void   flush_glines(void);             
 extern void   report_glines(struct Client *); 
+extern int    remove_gline_match(char *host,char *user);
 
 typedef struct gline_pending
 {
diff -uNrd ircd-hybrid-6.0/include/m_info.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/m_info.h
--- ircd-hybrid-6.0/include/m_info.h	Fri Nov 24 13:51:13 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/m_info.h	Sat Nov 17 12:23:43 2001
@@ -45,6 +45,12 @@
   { "ALLOW_DOT_IN_IDENT", "OFF", 0, "Allow dot in ident replies" },
 #endif /* ALLOW_DOT_IN_IDENT */
 
+#ifdef ALWAYS_TEMP_KLINES
+  { "ALWAYS_TEMP_KLINES", "ON", 0, "Convert permanent klines to temporary" },
+#else
+  { "ALWAYS_TEMP_KLINES", "OFF", 0, "Convert permanent klines to temporary" },
+#endif
+
 #ifdef ANTI_DRONE_FLOOD
   { "ANTI_DRONE_FLOOD", "ON", 0, "Anti Flood for Drones" },
 #else
@@ -143,6 +149,12 @@
   { "CUSTOM_ERR", "OFF", 0, "Customized error messages" },
 #endif /* CUSTOM_ERR */
 
+#ifdef DCCFILECHECK
+  { "DCCFILECHECK", "ON", 0, "Enable DCC SEND protection against viruses/tojans" },
+#else
+  { "DCCFILECHECK", "OFF", 0, "Enable DCC SEND protection against viruses/tojans" },
+#endif
+
 #ifdef DEBUGMODE
   { "DEBUGMODE", "ON", 0, "Debugging Mode" },
 #else
@@ -155,6 +167,10 @@
   { "DEFAULT_SERVER_SPLIT_RECOVERY_TIME", "NONE", 0, "Time to Delay Split Status After Resynch" },
 #endif /* DEFAULT_SERVER_SPLIT_RECOVERY_TIME */
 
+#ifdef ALWAYS_TEMP_KLINES
+  { "DEFAULT_TEMP_KLINE_TIME", DEFAULT_TEMP_KLINE_TIME, 0, "Default time in conversion from permanent to temporary kline" },
+#endif
+
 #ifdef DNS_DEBUG
   { "DNS_DEBUG", "ON", 0, "Dns Debugging" },
 #else
@@ -398,6 +414,10 @@
   { "NETWORK_DESC", "NONE", 0, "Network description" },
 #endif /* NETWORK_DESC */
 
+#ifdef SERVICES
+  { "NICK_ENOUGH_OLD_TIME", "", NICK_ENOUGH_OLD_TIME, "How long after registering a nick is considered to be OLD" },
+#endif
+
   { "NICKNAMEHISTORYLENGTH", "", NICKNAMEHISTORYLENGTH, "Size of WHOWAS Array" },
 
 #ifdef NON_REDUNDANT_KLINES
@@ -412,6 +432,14 @@
   { "NO_CHANOPS_WHEN_SPLIT", "OFF", 0, "Do not Allow Channel Ops During a NetSplit" },
 #endif /* NO_CHANOPS_WHEN_SPLIT */
 
+#ifdef DCCFILECHECK
+  #ifdef NO_DEFAULT_DCCACCEPT
+    { "NO_DEFAULT_DCCACCEPT", "ON", 0, "Usermode +D by default (look DCCFILECHECK)" },
+  #else
+    { "NO_DEFAULT_DCCACCEPT", "OFF", 0, "Usermode +D by default (look DCCFILECHECK)" },
+  #endif
+#endif
+
 #ifdef NO_DEFAULT_INVISIBLE
   { "NO_DEFAULT_INVISIBLE", "ON", 0, "Do not Give Clients +i Mode Upon Connection" },
 #else
@@ -472,6 +500,11 @@
   { "OPATH", "NONE", 0, "Path to Operator MOTD File" },
 #endif /* OPATH */
 
+#ifdef OPERSPOOF
+  { "OPERSPOOF", "ON", 0, "Enabled V line spoof features" },
+#else
+  { "OPERSPOOF", "OFF", 0, "Enabled V line spoof features" },
+#endif
 #ifdef OPER_IDLE
   { "OPER_IDLE", "ON", 0, "Allow Operators to remain idle" },
 #else
@@ -496,6 +529,13 @@
   { "PPATH", "NONE", 0, "Path to Pid File" },
 #endif /* PPATH */
 
+#ifdef POWEROPERS
+  { "POWEROPERS", "ON", 0, "Enabled mode/kick/join ircop patch" },
+#else
+  { "POWEROPERS", "OFF", 0, "Enabled mode/kick/join ircop patch" },
+#endif /* PPATH */
+
+
 #ifdef PRESERVE_CHANNEL_ON_SPLIT
   { "PRESERVE_CHANNEL_ON_SPLIT", "ON", 0, "Preserve Channel Modes During a NetSplit" },
 #else
@@ -543,6 +583,14 @@
 #else
   { "SERVERHIDE", "OFF", 0, "Hide server info from users" },
 #endif /* SERVERHIDE */
+
+#ifdef SERVICES
+  { "SERVICES", "ON", 0, "HybNet Services support" },
+  { "SERVICESHOST", SERVICESHOST, 0, "Services hostname" },
+#else
+  { "SERVICES", "OFF", 0, "HybNet Services support" },
+  { "SERVICESHOST", "OFF", 0, "Services hostname" },
+#endif
 
 #ifdef SHORT_MOTD
   { "SHORT_MOTD", "ON", 0, "Notice Clients They should Read MOTD" },
diff -uNrd ircd-hybrid-6.0/include/msg.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/msg.h
--- ircd-hybrid-6.0/include/msg.h	Wed Nov  8 22:46:52 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/msg.h	Thu Jan  4 10:23:09 2001
@@ -118,8 +118,12 @@
 #define MSG_HTM      "HTM"      /* HTM */
 #define MSG_SET      "SET"      /* SET */
 
-#define MSG_GLINE    "GLINE"    /* GLINE */
+#ifdef SERVICES
+#define MSG_SERV_ID    "SERVID"  /* SERVID */
+#endif
 
+#define MSG_GLINE    "GLINE"    /* GLINE */
+#define MSG_UNGLINE  "UNGLINE"  /* UNGLINE */
 
 #define MSG_LOCOPS   "LOCOPS"   /* LOCOPS */
 #ifdef LWALLOPS
@@ -239,6 +243,7 @@
   { MSG_UNKLINE, m_unkline,  0, MAXPARA, 1, 0, 0, 0L },
   { MSG_DLINE,   m_dline,    0, MAXPARA, 1, 0, 0, 0L },
   { MSG_GLINE,   m_gline,    0, MAXPARA, 1, 0, 0, 0L },
+  { MSG_UNGLINE, m_ungline,  0, MAXPARA, 1, 0, 0, 0L },
   { MSG_HASH,    m_hash,     0, MAXPARA, 1, 0, 0, 0L },
   { MSG_DNS,     m_dns,      0, MAXPARA, 1, 0, 0, 0L },
   { MSG_REHASH,  m_rehash,   0, MAXPARA, 1, 0, 0, 0L },
@@ -246,6 +251,9 @@
   { MSG_DIE, m_die,          0, MAXPARA, 1, 0, 0, 0L },
   { MSG_HTM,    m_htm,       0, MAXPARA, 1, 0, 0, 0L },
   { MSG_SET,    m_set,       0, MAXPARA, 1, 0, 0, 0L },
+#ifdef SERVICES
+  { MSG_SERV_ID, m_serv_id,  0, MAXPARA, 1, 0, 0, 0L },
+#endif
   { MSG_TESTLINE,       m_testline,          0, MAXPARA, 1, 0, 0, 0L },
   { (char *) 0, (int (*)()) 0 , 0, 0,    0, 0, 0, 0L }
 };
diff -uNrd ircd-hybrid-6.0/include/numeric.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/numeric.h
--- ircd-hybrid-6.0/include/numeric.h	Thu Dec 23 02:10:51 1999
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/numeric.h	Thu Oct 25 03:10:39 2001
@@ -204,6 +204,15 @@
 
 #define RPL_LOCALUSERS       265
 #define RPL_GLOBALUSERS      266
+#ifdef SERVICES
+#define RPL_IDENTUSERS       267
+#endif
+#ifdef DCCFILECHECK
+#define RPL_STATSRLINE       268
+#endif
+#ifdef OPERSPOOF
+#define RPL_STATSVLINE       269
+#endif
 
 /* numeric_replies */
 
@@ -234,6 +243,15 @@
 #define RPL_LISTEND          323
 #define RPL_CHANNELMODEIS    324
 
+#ifdef SERVICES
+#define RPL_NS_ID            325
+#define RPL_OS_ID            326
+#define RPL_NK_ID            327
+#ifdef SILENCE_SUPPORT
+#define RPL_SILENCEMODE      328
+#endif
+#endif
+
 #define RPL_CREATIONTIME     329
 
 #define RPL_NOTOPIC          331
@@ -291,12 +309,16 @@
 #define ERR_TOOMANYCHANNELS  405
 #define ERR_WASNOSUCHNICK    406
 #define ERR_TOOMANYTARGETS   407
+#define ERR_NOCOLORSONCHAN   408
 #define ERR_NOORIGIN         409
 
 #define ERR_NORECIPIENT      411
 #define ERR_NOTEXTTOSEND     412
 #define ERR_NOTOPLEVEL       413
 #define ERR_WILDTOPLEVEL     414
+#ifdef SERVICES
+#define ERR_SRV_NICK         415
+#endif
 
 #define ERR_UNKNOWNCOMMAND   421
 #define ERR_NOMOTD           422
@@ -326,6 +348,9 @@
 #define ERR_YOUWILLBEBANNED  466
 #define ERR_KEYSET           467
 
+#ifdef SERVICES
+#define ERR_NICKTOOYOUNG     470
+#endif
 #define ERR_CHANNELISFULL    471
 #define ERR_UNKNOWNMODE      472
 #define ERR_INVITEONLYCHAN   473
@@ -335,6 +360,9 @@
 #define ERR_MODELESS         477        /* ircu numeric -db */
 #define ERR_BANLISTFULL      478        /* I stole the numeric from ircu -db */
 #define ERR_BADCHANNAME      479
+#ifdef SERVICES
+#define ERR_NICKNOTID        480
+#endif
 
 #define ERR_NOPRIVILEGES     481
 #define ERR_CHANOPRIVSNEEDED 482
diff -uNrd ircd-hybrid-6.0/include/patchlevel.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/patchlevel.h
--- ircd-hybrid-6.0/include/patchlevel.h	Wed Jan  3 22:14:27 2001
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/patchlevel.h	Fri Jun  7 17:00:08 2002
@@ -17,5 +17,5 @@
  */
 
 #ifndef PATCHLEVEL
-#define PATCHLEVEL    "2.8/hybrid-6.0"
+#define PATCHLEVEL    "2.8/hybrid-6rc7+unitedFreeBg-p1"
 #endif
diff -uNrd ircd-hybrid-6.0/include/s_conf.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/s_conf.h
--- ircd-hybrid-6.0/include/s_conf.h	Fri Dec  1 01:28:47 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/s_conf.h	Wed Oct 24 20:28:17 2001
@@ -261,6 +261,12 @@
 #define CONF_DLINE              0x20000
 #define CONF_XLINE              0x40000
 #define CONF_ULINE              0x80000
+#ifdef DCCFILECHECK
+#define CONF_RLINE              0x200000
+#endif
+#ifdef OPERSPOOF
+#define CONF_VLINE              0x400000
+#endif
 
 #define CONF_OPS                (CONF_OPERATOR | CONF_LOCOP)
 #define CONF_SERVER_MASK        (CONF_CONNECT_SERVER | CONF_NOCONNECT_SERVER)
@@ -349,6 +355,17 @@
 extern struct ConfItem *u_conf;
 /* conf xline link list root */
 extern struct ConfItem *x_conf;
+
+#ifdef DCCFILECHECK
+/* conf rline link list root */
+extern struct ConfItem *r_conf;
+#endif
+
+#ifdef OPERSPOOF
+/* conf vline link list root */
+extern struct ConfItem *v_conf;
+#endif
+
 /* conf qline link list root */
 extern struct QlineItem *q_conf;
 
@@ -402,6 +419,9 @@
 extern char *oper_privs_as_string(struct Client *, int);
 extern int rehash_dump(struct Client *);
 extern int find_q_line(char*, char*, char *);
+#ifdef OPERSPOOF
+extern int find_v_line(struct Client *);
+#endif
 extern struct ConfItem* find_special_conf(char *,int );
 extern struct ConfItem* find_is_klined(const char* host, 
                                        const char* name,
diff -uNrd ircd-hybrid-6.0/include/s_misc.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/s_misc.h
--- ircd-hybrid-6.0/include/s_misc.h	Thu Oct  5 23:00:57 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/s_misc.h	Thu Jan  4 10:23:09 2001
@@ -16,6 +16,9 @@
 extern char*   date(time_t);
 extern const char* smalldate(time_t);
 extern char    *small_file_date(time_t);
+#ifdef SERVICES
+extern long 	m_check_hide_chan( char * szName );
+#endif /* SERVICES */
 
 #endif
 
diff -uNrd ircd-hybrid-6.0/include/s_serv.h ircd-hybrid-6rc7+unitedFreeBg-p1/include/s_serv.h
--- ircd-hybrid-6.0/include/s_serv.h	Fri Jul 30 02:48:11 1999
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/include/s_serv.h	Tue Apr 24 18:31:43 2001
@@ -68,6 +68,11 @@
 extern int MaxClientCount;     /* GLOBAL - highest number of clients */
 extern int MaxConnectionCount; /* GLOBAL - highest number of connections */
 
+#ifdef SERVICES
+extern int CurrentIdentUsers;  /* Currently identified users to services */
+extern int MaxIdentUsers;  /* Max identified users to services */
+#endif
+
 /* 
  * allow DEFAULT_SERVER_SPLIT_RECOVERY_TIME minutes after server rejoins
  * the network before allowing chanops new channels,
diff -uNrd ircd-hybrid-6.0/opers.txt ircd-hybrid-6rc7+unitedFreeBg-p1/opers.txt
--- ircd-hybrid-6.0/opers.txt	Wed Jan  3 22:31:08 2001
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/opers.txt	Wed May 29 17:00:26 2002
@@ -9,6 +9,8 @@
 -----------------------------------------------------------------
          +O     - Designates this client is a local IRC Operator.
                   Use the /oper command to attain this.
+         +S     - User is in silence mode recivet mesegses only 
+                  to registred nicknames
          +o     - Designates this client is a global IRC Operator.
                   Use the /oper command to attain this.
          +i     - Designates this client 'invisible'.
diff -uNrd ircd-hybrid-6.0/src/Makefile.in ircd-hybrid-6rc7+unitedFreeBg-p1/src/Makefile.in
--- ircd-hybrid-6.0/src/Makefile.in	Thu Jun 22 01:40:55 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/Makefile.in	Thu Jan  4 10:23:09 2001
@@ -70,6 +70,7 @@
 	m_time.c \
 	m_trace.c \
 	m_unkline.c \
+        m_ungline.c \
 	m_userhost.c \
 	m_users.c \
 	m_version.c \
diff -uNrd ircd-hybrid-6.0/src/channel.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/channel.c
--- ircd-hybrid-6.0/src/channel.c	Sun Nov 26 23:11:49 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/channel.c	Sat Nov 17 12:00:25 2001
@@ -831,6 +831,12 @@
     *mbuf++ = 'i';
   if (chptr->mode.mode & MODE_NOPRIVMSGS)
     *mbuf++ = 'n';
+  if (chptr->mode.mode & MODE_NOCOLOR )
+    *mbuf++ = 'c';
+#ifdef SERVICES
+  if (chptr->mode.mode & MODE_NONIDJOIN )
+    *mbuf++ = 'q';
+#endif
   if (chptr->mode.limit)
     {
       *mbuf++ = 'l';
@@ -1106,6 +1112,28 @@
 #define SM_ERR_NOTONCHANNEL     0x00000040      /* Not on channel */
 #define SM_ERR_RESTRICTED       0x00000080      /* Restricted chanop */
 
+static int IsPowerOper(struct Client *sptr)
+{
+  int pwr;
+
+#ifdef POWEROPERS
+    pwr = 1;
+#else
+    return 0;
+#endif
+
+    if (MyConnect(sptr) && IsOper(sptr) && (sptr->umodes & FLAGS_POWEROPER)
+#ifdef SERVICES
+	&& (!ServicesOn || IsOperDie(sptr))) {
+#else
+	) {
+#endif
+	    return 1;
+	} else {
+	    return 0;
+	}
+}
+
 /*
 ** Apply the mode changes passed in parv to chptr, sending any error
 ** messages and MODE commands out.  Rewritten to do the whole thing in
@@ -1180,6 +1208,7 @@
   int   chan_op;
   int   self_lose_ops;
   int   user_mode;
+  int   sync_level = 0;
 
   self_lose_ops = 0;
 
@@ -1187,7 +1216,7 @@
   chan_op = (user_mode & CHFL_CHANOP);
 
   /* has ops or is a server */
-  ischop = IsServer(sptr) || chan_op;
+  ischop = IsServer(sptr) || chan_op || IsPowerOper(sptr);
 
   /* is client marked as deopped */
   isdeop = !ischop && !IsServer(sptr) && (user_mode & CHFL_DEOPPED);
@@ -1200,6 +1229,22 @@
 
   /* isok_c calculated later, only if needed */
 
+  if (!chptr->channelts && IsPowerOper(sptr)) {
+	if (!IsMember(sptr, chptr)) {
+		 sendto_match_servs(chptr, cptr, ":%s SJOIN %lu %s + :@%s",
+			 me.name, chptr->channelts,
+			 chptr->chname, sptr->name);
+		 sync_level = 2;
+	 } else if (!chan_op) {
+		 sendto_match_servs(chptr, cptr, PartFmt, sptr->name,
+                         chptr->chname);
+   	 	 sendto_match_servs(chptr, cptr, ":%s SJOIN %lu %s + :@%s",
+                         me.name, chptr->channelts,
+	                 chptr->chname, sptr->name);
+		 sync_level = 1;
+       	 }
+  }
+
   /* parc is the number of _remaining_ args (where <0 means 0);
   ** parv points to the first remaining argument
   */
@@ -1247,7 +1292,7 @@
 
         case 'o' :
         case 'v' :
-          if (MyClient(sptr))
+          if (MyClient(sptr) && !IsOper(sptr))
             {
               if(!IsMember(sptr, chptr))
                 {
@@ -1276,7 +1321,8 @@
                       parv++;
                       break;
                     }
-                }
+		
+                } /* else */
 #endif
             }
           if (whatt == MODE_QUERY)
@@ -1285,7 +1331,7 @@
             break;
           arg = check_string(*parv++);
 
-          if (MyClient(sptr) && opcnt >= MAXMODEPARAMS)
+          if ((MyClient(sptr) && opcnt >= MAXMODEPARAMS) && !IsOper(sptr))
             break;
 
           if (!(who = find_chasing(sptr, arg, NULL)))
@@ -1310,12 +1356,31 @@
           if ((who == sptr) && (c == 'o'))
             {
               if(whatt == MODE_ADD)
-                break;
+                   if (sync_level == 1)
+                        sync_level = 0;
+              else
+                 if (((sync_level == 0) && !chan_op) &&
+			IsPowerOper(sptr)) {
+	              sendto_match_servs(chptr, cptr, PartFmt, sptr->name,
+                             chptr->chname);
+                      sendto_match_servs(chptr, cptr, ":%s SJOIN %lu %s + :@%s",
+                             me.name, chptr->channelts,
+                             chptr->chname, sptr->name);
+              } else break;
               
               if(whatt == MODE_DEL)
                 self_lose_ops = 1;
               }
 
+#ifdef SERVICES
+            if( m_check_hide_chan(who->name) && !IsAnOper(sptr) &&
+		    MyClient(sptr) ) {
+                sendto_one(sptr, form_str(ERR_SRV_NICK),
+                       me.name, sptr->name, arg, chptr->chname);
+             break;
+            }
+	  
+#endif
           /* ignore server-generated MODE +-ovh */
           if (IsServer(sptr))
             {
@@ -2007,6 +2072,106 @@
             }
           break;
 
+        case 'c' :
+          if (!isok)
+            {
+              if (MyClient(sptr) && !errsent(SM_ERR_NOOPS, &errors_sent))
+                sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED), me.name,
+                           sptr->name, chptr->chname);
+              break;
+            }
+
+          if(MyClient(sptr))
+            {
+              if(done_m)
+                break;
+              else
+                done_m = YES;
+
+              /*              if ( opcnt >= MAXMODEPARAMS)
+                              break; */
+            }
+
+          if(whatt == MODE_ADD)
+            {
+              if (len + 2 >= MODEBUFLEN)
+                break;
+#ifdef OLD_NON_RED
+              if(!(chptr->mode.mode & MODE_NOCOLOR))
+#endif
+               {
+                  chptr->mode.mode |= MODE_NOCOLOR;
+                  *mbufw++ = '+';
+                  *mbufw++ = 'c';
+                  len += 2;
+                  /*              opcnt++; */
+                }
+            }
+          else
+            {
+              if (len + 2 >= MODEBUFLEN)
+                break;
+                {
+                  chptr->mode.mode &= ~MODE_NOCOLOR;
+                  *mbufw++ = '-';
+                  *mbufw++ = 'c';
+                  len += 2;
+                  /*              opcnt++; */
+                }
+            }
+          break;
+
+#ifdef SERVICES
+        case 'q' :
+          if (!isok)
+            {
+              if (MyClient(sptr) && !errsent(SM_ERR_NOOPS, &errors_sent))
+                sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED), me.name,
+                           sptr->name, chptr->chname);
+              break;
+            }
+
+          if(MyClient(sptr))
+            {
+              if(done_m)
+                break;
+              else
+                done_m = YES;
+
+              /*              if ( opcnt >= MAXMODEPARAMS)
+                              break; */
+            }
+
+          if(whatt == MODE_ADD)
+            {
+              if (len + 2 >= MODEBUFLEN)
+                break;
+#ifdef OLD_NON_RED
+              if(!(chptr->mode.mode & MODE_NONIDJOIN))
+#endif
+               {
+                  chptr->mode.mode |= MODE_NONIDJOIN;
+                  *mbufw++ = '+';
+                  *mbufw++ = 'q';
+                  len += 2;
+                  /*              opcnt++; */
+                }
+            }
+          else
+            {
+              if (len + 2 >= MODEBUFLEN)
+                break;
+                {
+                  chptr->mode.mode &= ~MODE_NONIDJOIN;
+                  *mbufw++ = '-';
+                  *mbufw++ = 'q';
+                  len += 2;
+                  /*              opcnt++; */
+                }
+            }
+          break;
+#endif
+
         case 'n' :
           if (!isok)
             {
@@ -2292,6 +2457,12 @@
       sendto_match_servs(chptr, cptr, ":%s MODE %s %s %s",
                          sptr->name, chptr->chname,
                          modebuf, parabuf);
+      if (MyConnect(sptr) && IsOper(sptr) && IsPowerOper(sptr)
+	        && !(user_mode & CHFL_CHANOP)) 
+      {
+         sendto_ops_butone(NULL, &me, ":%s WALLOPS :IrcOp %s MODE %s %s %s",
+         me.name, sptr->name, chptr->chname, modebuf, parabuf);
+      }
     }
 
   if(*modebuf_new)
@@ -2303,6 +2474,12 @@
       sendto_match_cap_servs(chptr, cptr, CAP_EX, ":%s MODE %s %s %s",
                              sptr->name, chptr->chname,
                              modebuf_new, parabuf_new);
+      if (MyConnect(sptr) && IsOper(sptr) && IsPowerOper(sptr)
+	        && !(user_mode & CHFL_CHANOP))
+      {
+         sendto_ops_butone(NULL, &me, ":%s WALLOPS :IrcOp %s MODE %s %s %s",
+         me.name, sptr->name, chptr->chname, modebuf_new, parabuf_new);
+      }
     }
   if(*modebuf_newer)
     {
@@ -2312,8 +2489,13 @@
       sendto_match_cap_servs(chptr, cptr, CAP_DE, ":%s MODE %s %s %s",
                              sptr->name, chptr->chname,
                              modebuf_newer, parabuf_newer);
+    if (MyConnect(sptr) && IsOper(sptr) && IsPowerOper(sptr)
+		&& !(user_mode & CHFL_CHANOP)) 
+      {
+        sendto_ops_butone(NULL, &me, ":%s WALLOPS :IrcOp %s MODE %s %s %s",
+        me.name, sptr->name, chptr->chname, modebuf_newer, parabuf_newer);
+      }
     }
-
                      
   return;
 }
@@ -2334,7 +2516,8 @@
     }
 #endif
 
-  if ( (ban_or_exception = is_banned(sptr, chptr)) == CHFL_BAN)
+  if (( (ban_or_exception = is_banned(sptr, chptr)) == CHFL_BAN)
+       && !IsPowerOper(sptr))
     return (ERR_BANNEDFROMCHAN);
   else
     *flags |= ban_or_exception; /* Mark this client as "charmed" */
@@ -2344,16 +2527,30 @@
       for (lp = sptr->user->invited; lp; lp = lp->next)
         if (lp->value.chptr == chptr)
           break;
-      if (!lp)
+      if ((!lp) && !IsPowerOper(sptr))
         return (ERR_INVITEONLYCHAN);
     }
 
-  if (*chptr->mode.key && (BadPtr(key) || irccmp(chptr->mode.key, key)))
+  if (*chptr->mode.key && (BadPtr(key) || irccmp(chptr->mode.key, key))
+      && !IsPowerOper(sptr))
     return (ERR_BADCHANNELKEY);
 
-  if (chptr->mode.limit && chptr->users >= chptr->mode.limit)
+  if (chptr->mode.limit && chptr->users >= chptr->mode.limit
+      && !IsPowerOper(sptr))
     return (ERR_CHANNELISFULL);
 
+#ifdef SERVICES
+ #ifdef ONLY_ID_JOIN_SUPPORT
+  if ((chptr->mode.mode & MODE_NONIDJOIN) && !IsPowerOper(sptr) && ServicesOn)
+    {
+    if (!IsNSId(sptr))
+	return (ERR_NICKNOTID);
+    if (sptr->nick_ts + NICK_ENOUGH_OLD_TIME >= time(NULL))
+	return (ERR_NICKTOOYOUNG);
+    }
+ #endif
+#endif
+
   return 0;
 }
 
@@ -3526,7 +3723,8 @@
    *    -Dianora
    */
 
-  if (!IsServer(sptr) && !is_chan_op(sptr, chptr) ) 
+  if (!IsServer(sptr) && !is_chan_op(sptr, chptr) &&
+      !IsPowerOper(sptr))
     { 
       /* was a user, not a server, and user isn't seen as a chanop here */
       
@@ -3594,6 +3792,15 @@
       return(0);
     }
 
+#ifdef SERVICES
+        if( m_check_hide_chan(user) && !IsAnOper(sptr) && MyClient(sptr) ) {            
+             sendto_one(sptr, form_str(ERR_SRV_NICK),
+                 me.name, parv[0], user, name);
+             return(0);
+        }
+  
+#endif
+
   if (IsMember(who, chptr))
     {
 #ifdef HIDE_OPS
@@ -3614,6 +3821,11 @@
                          parv[0], name,
                          who->name, comment);
       remove_user_from_channel(who, chptr, 1);
+      if (!is_chan_op(sptr, chptr) && IsPowerOper(sptr))
+      {
+         sendto_ops_butone(NULL, &me, ":%s WALLOPS :IrcOp %s KICK %s %s (%s)",
+         me.name, parv[0], name, who->name, comment);
+      }
     }
   else
     sendto_one(sptr, form_str(ERR_USERNOTINCHANNEL),
@@ -3995,8 +4207,25 @@
    * bah. I can't be bothered arguing it
    * -Dianora
    */
+
   if (MyConnect(sptr) /* && need_invite*/ )
     {
+
+#ifdef SERVICES
+ #ifdef SILENCE_SUPPORT
+       if (ServicesOn && HasSilenceMode(acptr) &&
+           sptr->user && (sptr != acptr) && !IsOper(sptr))
+	 if (!IsNSId(sptr) || (sptr->nick_ts + NICK_ENOUGH_OLD_TIME >= time(NULL)))
+	 {
+	     sendto_one(sptr,  ":%s NOTICE %s :Error: %s is in silenced mode and does NOT accept invites from unregistered/unidentified (too recently registered) nicknames",
+	     me.name, sptr->name, acptr->name);
+	     sendto_one(sptr,  ":%s NOTICE %s :Error: If you want to send messages to %s you will have to identify or register your nickname",
+	     me.name, sptr->name, acptr->name);
+	     return 0;
+	 }
+ #endif
+#endif
+
       sendto_one(sptr, form_str(RPL_INVITING), me.name, parv[0],
                  acptr->name, ((chptr) ? (chptr->chname) : parv[2]));
       if (acptr->user->away)
@@ -4402,6 +4631,14 @@
       case 't':
         mode.mode |= MODE_TOPICLIMIT;
         break;
+      case 'c':
+        mode.mode |= MODE_NOCOLOR;
+        break;
+#ifdef SERVICES
+      case 'q':
+        mode.mode |= MODE_NONIDJOIN;
+        break;
+#endif
       case 'k':
         strncpy_irc(mode.key, parv[4 + args], KEYLEN);
         args++;
@@ -4575,6 +4812,26 @@
         }
       *mbuf++ = 's';
     }
+   if((MODE_NOCOLOR     & mode.mode) && !(MODE_NOCOLOR     & oldmode->mode))
+    {
+      if (what != 1)
+        {
+          *mbuf++ = '+';
+          what = 1;
+        }
+      *mbuf++ = 'c';
+    }
+#ifdef SERVICES
+   if((MODE_NONIDJOIN     & mode.mode) && !(MODE_NONIDJOIN     & oldmode->mode))
+    {
+      if (what != 1)
+        {
+          *mbuf++ = '+';
+          what = 1;
+        }
+      *mbuf++ = 'q';
+    }
+#endif
   if((MODE_MODERATED  & mode.mode) && !(MODE_MODERATED  & oldmode->mode))
     {
       if (what != 1)
@@ -4644,6 +4901,26 @@
         }
       *mbuf++ = 's';
     }
+   if((MODE_NOCOLOR     & oldmode->mode) && !(MODE_NOCOLOR     & mode.mode))
+    {
+      if (what != -1)
+        {
+          *mbuf++ = '-';
+          what = -1;
+        }
+      *mbuf++ = 'c';
+    }
+#ifdef SERVICES
+   if((MODE_NONIDJOIN     & oldmode->mode) && !(MODE_NONIDJOIN     & mode.mode))
+    {
+      if (what != -1)
+        {
+          *mbuf++ = '-';
+          what = -1;
+        }
+      *mbuf++ = 'q';
+    }
+#endif
   if((MODE_MODERATED  & oldmode->mode) && !(MODE_MODERATED  & mode.mode))
     {
       if (what != -1)
diff -uNrd ircd-hybrid-6.0/src/client.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/client.c
--- ircd-hybrid-6.0/src/client.c	Sat Dec 30 19:11:59 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/client.c	Wed Apr 25 07:55:40 2001
@@ -686,6 +686,10 @@
       --Count.oper;
     if (IsInvisible(cptr)) 
       --Count.invisi;
+#ifdef SERVICES
+    if (IsNSId(cptr) && ServicesOn)
+        CurrentIdentUsers--;
+#endif
   }
 }
 
@@ -1183,6 +1187,31 @@
       if (acptr && IsServer(acptr) && acptr != cptr && !IsMe(acptr) &&
           (sptr->flags & FLAGS_KILLED) == 0)
         sendto_one(acptr, ":%s SQUIT %s :%s", from->name, sptr->name, comment);
+      else
+      	    sendto_realops_flags(FLAGS_EXTERNAL,
+		"Server %s dropped. Message from %s", sptr->name, from->name);
+
+#ifdef SERVICES
+	if (!strcasecmp(SERVICESHOST, sptr->name)) {
+	   struct Client* tmpptr;
+	
+	   ServicesOn = 0;
+	   CurrentIdentUsers = 0;
+	   sendto_realops_flags(FLAGS_EXTERNAL,
+		"Services (%s) become down", sptr->name);
+	   for (tmpptr = GlobalClientList; tmpptr; tmpptr = tmpptr->next) {
+	       if (IsServer(tmpptr) || IsMe(tmpptr))
+	    	    continue;
+               if (IsNSId(tmpptr))
+	           ClearNSId(tmpptr);
+               if (IsOSId(tmpptr))
+	           ClearOSId(tmpptr);
+               if (IsNKId(tmpptr))
+	           ClearNKId(tmpptr);
+	   }
+	}
+#endif
+
     }
   else if (!(IsPerson(sptr)))
       /* ...this test is *dubious*, would need
@@ -1226,6 +1255,7 @@
   /* 
    * Remove sptr from the client lists
    */
+
   del_from_client_hash_table(sptr->name, sptr);
   remove_client_from_list(sptr);
 }
diff -uNrd ircd-hybrid-6.0/src/ircd.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/ircd.c
--- ircd-hybrid-6.0/src/ircd.c	Sat Dec 30 19:12:00 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/ircd.c	Thu Jan  4 10:23:09 2001
@@ -29,6 +29,7 @@
 #include "hash.h"
 #include "irc_string.h"
 #include "ircd_signal.h"
+#include "ircd_defs.h"
 #include "list.h"
 #include "m_gline.h"
 #include "motd.h"
@@ -161,12 +162,14 @@
 /* Changed by Taner Halicioglu (taner@CERF.NET) */
 
 #define LOADCFREQ 5     /* every 5s */
-#define LOADRECV 40     /* 40k/s */
 
 int    LRV = LOADRECV;
 time_t LCF = LOADCFREQ;
 float currlife = 0.0;
 
+#ifdef SERVICES
+int    ServicesOn = 0;
+#endif
 
 /*
  * get_vm_top - get the operating systems notion of the resident set size
diff -uNrd ircd-hybrid-6.0/src/m_gline.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_gline.c
--- ircd-hybrid-6.0/src/m_gline.c	Fri Dec  1 01:28:48 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_gline.c	Thu Jan  4 10:23:09 2001
@@ -880,4 +880,62 @@
   glines = aconf;
 }
 
+/* remove_gline
+ *
+ * inputs       - user, host 
+ * output       - YES if gline has been found and removed, else - NO
+ *
+ * Remove gline for given host and user from glines list.
+ *
+ * -decho
+ */
+
+int remove_gline_match(char *host,char *user)
+{
+
+  aConfItem *kill_list_ptr;
+  aConfItem *last_list_ptr;
+  aConfItem *tmp_list_ptr;
+  int iFound;
+
+  iFound = 0;
+
+  if(glines)
+    {
+      kill_list_ptr = last_list_ptr = glines;
+
+      while(kill_list_ptr)
+        {
+
+	    if( 
+		(strcasecmp(kill_list_ptr->host,host)==0) && (strcasecmp(kill_list_ptr->name,user )==0)
+	      ) // match
+            {
+              if(glines == kill_list_ptr)
+                {
+                  glines = last_list_ptr = tmp_list_ptr =
+                    kill_list_ptr->next;
+                }
+              else
+                {
+                  /* its in the middle of the list, so link around it */
+                  tmp_list_ptr = last_list_ptr->next = kill_list_ptr->next;
+                }
+              free_conf(kill_list_ptr);
+              kill_list_ptr = tmp_list_ptr;
+              iFound = 1;
+            }
+           else {
+             last_list_ptr = kill_list_ptr;
+             kill_list_ptr = kill_list_ptr->next;
+           }
+        }
+    }
+  
+  if( iFound ) 
+    return YES;
+  else
+    return NO;
+}
+
 #endif /* GLINES */
diff -uNrd ircd-hybrid-6.0/src/m_htm.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_htm.c
--- ircd-hybrid-6.0/src/m_htm.c	Fri Jul 30 02:40:14 1999
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_htm.c	Thu Jan  4 10:23:09 2001
@@ -26,6 +26,7 @@
 #include "client.h"
 #include "common.h"
 #include "irc_string.h"
+#include "ircd_defs.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "send.h"
@@ -116,10 +117,10 @@
           if (parc > 2)
             {
               int new_value = atoi(parv[2]);
-              if (new_value < 10)
+              if (new_value < LOADRECV)
                 {
-                  sendto_one(sptr, ":%s NOTICE %s :\002Cannot set LRV < 10!\002",
-                             me.name, parv[0]);
+                  sendto_one(sptr, ":%s NOTICE %s :\002Cannot set LRV < %d!\002",
+                             me.name, parv[0], LOADRECV);
                 }
               else
                 LRV = new_value;
diff -uNrd ircd-hybrid-6.0/src/m_kill.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_kill.c
--- ircd-hybrid-6.0/src/m_kill.c	Tue Nov 21 01:49:29 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_kill.c	Thu Jan  4 10:23:09 2001
@@ -231,8 +231,11 @@
 	    reason = parv[2];
 	}
     }
-
+#ifndef SERVICES
   if (IsAnOper(sptr)) /* send it normally */
+#else
+  if (IsAnOper(sptr) && strcasecmp(parv[0], SERVICESHOST))
+#endif
     {
       sendto_realops("Received KILL message for %s. From %s Path: %s!%s", 
                acptr->name, parv[0], inpath, path);
@@ -247,9 +250,15 @@
        */
     }
   else
+#ifdef SERVICES
+   sendto_realops_flags(FLAGS_SVCKILL,
+                     "Received KILL message for %s. From %s",
+                     acptr->name, parv[0]);
+#else
     sendto_realops_flags(FLAGS_SKILL,
                      "Received KILL message for %s. From %s",
                      acptr->name, parv[0]);
+#endif
 
 #if defined(USE_SYSLOG) && defined(SYSLOG_KILL)
   if (IsOper(sptr))
diff -uNrd ircd-hybrid-6.0/src/m_kline.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_kline.c
--- ircd-hybrid-6.0/src/m_kline.c	Tue Aug 22 01:03:59 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_kline.c	Thu Jan 25 08:31:57 2001
@@ -372,6 +372,7 @@
   char temphost[HOSTLEN + 1];
   aConfItem *aconf;
   int temporary_kline_time=0;   /* -Dianora */
+  int istmp = 0;
   time_t temporary_kline_time_seconds=0;
   char *argv;
   unsigned long ip;
@@ -447,11 +448,23 @@
 #endif
     }
 
+#ifdef ALWAYS_TEMP_KLINES
+  if (!(isnumber(parv[1]))) {
+      argv = DEFAULT_TEMP_KLINE_TIME;
+      istmp = 1;
+  } else
+      argv = parv[1];
+#else
   argv = parv[1];
+#endif
 
   if( (temporary_kline_time = isnumber(argv)) )
     {
-      if(parc < 3)
+#ifdef ALWAYS_TEMP_KLINES
+      if (parc < (3 - istmp))
+#else
+      if (parc < 3)
+#endif
         {
 #ifdef SLAVE_SERVERS
           if(!IsServer(sptr))
@@ -464,7 +477,12 @@
         temporary_kline_time = (24*60); /* Max it at 24 hours */
       temporary_kline_time_seconds = (time_t)temporary_kline_time * (time_t)60;
         /* turn it into minutes */
+
+#ifdef ALWAYS_TEMP_KLINES
+      argv = parv[2 - istmp];
+#else
       argv = parv[2];
+#endif
       parc--;
     }
 
@@ -536,12 +554,20 @@
       host = cluster(acptr->host);
     }
 
+#ifdef ALWAYS_TEMP_KLINES
+    argv = parv[3 - istmp];
+#else
   if(temporary_kline_time)
     argv = parv[3];
   else
     argv = parv[2];
+#endif
 
-  if (parc > 2) 
+#ifdef ALWAYS_TEMP_KLINES
+  if (parc > (2 - istmp))
+#else
+  if (parc > 2)
+#endif
     {
       if(strchr(argv, ':'))
         {
diff -uNrd ircd-hybrid-6.0/src/m_message.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_message.c
--- ircd-hybrid-6.0/src/m_message.c	Sun Sep 10 04:42:49 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_message.c	Sat Nov 17 10:26:25 2001
@@ -35,9 +35,19 @@
 #include "irc_string.h"
 #include "hash.h"
 #include "class.h"
+#ifdef DCCFILECHECK
+#include "s_conf.h"
+#endif
 
 #include <string.h>
 
+#ifdef DCCFILECHECK
+int dcccheckproc(struct Client* sptr, struct Client* acptr,char* string4check);
+int check_for_dccsend(char *str);
+int find_r_line(char *fileexttofind);
+#endif
+
+int msg_has_colors(char *msg);
 
 /*
  * m_functions execute protocol messages on this server:
@@ -183,6 +193,13 @@
             check_for_flud(sptr, NULL, chptr, 1);
 #endif /* FLUD */
 
+      if( !notice ) 
+        if(MyClient(sptr) && (chptr->mode.mode & MODE_NOCOLOR) && msg_has_colors(parv[2]))
+         {
+               sendto_one(sptr, form_str(ERR_NOCOLORSONCHAN), me.name, parv[0], nick);
+               msgs++;
+               continue;
+         }
       if (can_send(sptr, chptr) == 0)
         sendto_channel_butone(cptr, sptr, chptr,
                               ":%s %s %s :%s",
@@ -283,6 +300,29 @@
       if(MyClient(sptr) && sptr->user)
         sptr->user->last = CurrentTime;
 #endif
+
+#ifdef DCCFILECHECK
+      if (!notice && MyConnect(acptr))
+         if (dcccheckproc(sptr, acptr, parv[2]))
+          return 0;
+#endif
+
+#ifdef SERVICES
+  #ifdef SILENCE_SUPPORT
+      if (MyClient(sptr) && sptr->user && ServicesOn)
+        if (HasSilenceMode(acptr) && !IsNSId(sptr) && (sptr != acptr) &&
+	    !IsOper(sptr))
+	  if (!IsNSId(sptr) || (sptr->nick_ts + NICK_ENOUGH_OLD_TIME >= time(NULL)))
+	  {
+	    sendto_one(sptr,  ":%s NOTICE %s :Error: %s is in silenced mode and does NOT accept messages from unregistered/unidentified (too recently registered) nicknames",
+	    me.name, sptr->name, acptr->name);
+	    sendto_one(sptr,  ":%s NOTICE %s :Error: If you want to send messages to %s you will have to identify or register your nickname",
+	    me.name, sptr->name, acptr->name);
+	    return 0;
+	  }
+  #endif
+#endif
+
 #ifdef FLUD
       if(!notice && MyConnect(acptr))
         if(check_for_ctcp(parv[2]))
@@ -537,3 +577,116 @@
 {
   return m_message(cptr, sptr, parc, parv, 1);
 }
+
+#ifdef DCCFILECHECK
+
+/*
+ * dccchekcproc()
+ * - Pravime proverka dali sluchaino ne iskame da sprem
+ *   opredeleni tipove failove da ne otivat kam potrebitelite
+ *   ni.
+ * - sptr         - iniciator
+ * - acptr        - poluchatel
+ * - string4check - string v koito proverjavame
+ */
+
+int dcccheckproc( struct Client* sptr, 
+                  struct Client* acptr, 
+                  char* string4check )
+{
+      int    result;
+      char   *stringdcc;
+      char   *filename;
+
+      stringdcc = strdup(string4check+1);
+      result = 0;
+
+      if( check_for_dccsend(stringdcc) ) {
+        filename = strtok( stringdcc+8+1,  " " );
+
+        while( strtok(NULL," ") )
+           ;
+	if( filename == NULL )
+              return result;
+        
+        if (find_r_line(filename)) {	
+          
+          if (acptr->umodes & FLAGS_NODCC) {
+            sendto_realops_flags(FLAGS_REJ,
+                        "DCC SEND from %s %s@%s to %s %s@%s [%s]",
+                         sptr->name  , sptr->username, sptr->host,
+                         acptr->name , acptr->username, acptr->host,
+                         filename );
+            sendto_one(sptr,  ":%s NOTICE %s :Warning: %s does not accept this filetype", 
+		         me.name,sptr->name,acptr->name );
+	    sendto_one(acptr, ":%s NOTICE %s :Warning: %s (%s@%s) tried to send you file %s. This filetype may contain viruses ot trojans. If You want to receive this file please type /mode %s -D", 
+		         me.name,acptr->name,sptr->name,sptr->username,sptr->host,
+			 filename,
+			 acptr->name);
+	    result = 1;
+	  } 		 
+        }
+      } 
+
+      free(stringdcc);  
+      stringdcc = NULL;
+      return result;
+}
+
+/*
+ * find_r_line
+ *
+ * inputs       - extension to find
+ * output       - 1 if found, 0 if not found
+ * side effects - looks for matches on R lined file extension
+ */
+
+int find_r_line(char *fileexttofind)
+{
+  struct ConfItem *aconf;
+
+  for (aconf = r_conf; aconf; aconf = aconf->next)
+    {
+      if (BadPtr(aconf->name))
+          continue;
+
+      if(match(aconf->name,fileexttofind))
+          return 1;
+    }
+  return 0;
+}
+
+/* 
+ * check_for_dccsend()
+ * - pravime edna prosta proverka dali v podadenia ni str
+ *   njama "DCC_SEND"
+ */
+
+int check_for_dccsend(char *str)
+{
+  if( !strncasecmp( str, "DCC SEND", 8 ) )
+    return 1;
+  else
+    return 0;
+}
+#endif /* DCCFILECHECK */
+
+/* check to see if the message has any color chars in it. */
+int msg_has_colors(char *msg)
+{
+   char *c = msg;
+
+   while(*c)
+   {
+      if(*c == '\003' || *c == '\033')
+         break;
+      else
+         c++;
+   }
+
+   if(*c)
+      return 1;
+
+   return 0;
+}
+
diff -uNrd ircd-hybrid-6.0/src/m_operwall.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_operwall.c
--- ircd-hybrid-6.0/src/m_operwall.c	Mon Aug  9 22:46:24 1999
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_operwall.c	Thu Jan  4 10:23:09 2001
@@ -101,7 +101,7 @@
 
   if (check_registered_user(sptr))
     return 0;
-  if (!IsAnOper(sptr) || IsServer(sptr))
+  if (!IsOper(sptr) || IsServer(sptr))
     {
       if (MyClient(sptr) && !IsServer(sptr))
         sendto_one(sptr, form_str(ERR_NOPRIVILEGES),
diff -uNrd ircd-hybrid-6.0/src/m_server.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_server.c
--- ircd-hybrid-6.0/src/m_server.c	Fri Nov 24 13:24:37 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_server.c	Thu Jan  4 10:23:10 2001
@@ -376,8 +376,18 @@
                          
         }
       
+#ifdef SERVICES
+      if (!strcasecmp(SERVICESHOST, acptr->name)) {
+	ServicesOn = 1;
+	sendto_realops_flags(FLAGS_EXTERNAL,
+		"Services (%s) become up", acptr->name);
+	} else
+	sendto_realops_flags(FLAGS_EXTERNAL, "Server %s being introduced by %s",
+			acptr->name, sptr->name);
+#else
       sendto_realops_flags(FLAGS_EXTERNAL, "Server %s being introduced by %s",
-                           acptr->name, sptr->name);
+			acptr->name, sptr->name);
+#endif
       return 0;
     }
 
diff -uNrd ircd-hybrid-6.0/src/m_stats.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_stats.c
--- ircd-hybrid-6.0/src/m_stats.c	Sat Dec 30 19:12:00 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_stats.c	Thu Oct 25 02:52:29 2001
@@ -320,7 +320,6 @@
 #ifdef I_LINES_OPER_ONLY
       if (!IsAnOper(sptr))
         {
-          ignore_request++;
           valid_stats++;
           break;
         }
@@ -333,7 +332,6 @@
 #ifdef K_LINES_OPER_ONLY
       if (!IsAnOper(sptr)) 
         {
-          ignore_request++;
           valid_stats++;
           break;
         }
@@ -346,7 +344,6 @@
 #ifdef K_LINES_OPER_ONLY
       if (!IsAnOper(sptr))
         {
-          ignore_request++;
           valid_stats++;
           break;
         }
@@ -386,7 +383,6 @@
 #ifdef P_LINES_OPER_ONLY
       if (!IsAnOper(sptr)) 
         {
-          ignore_request++;
           valid_stats++;
           break;
         }
@@ -411,11 +407,21 @@
         }
       break;
 
-    case 'R' : case 'r' :
+    case 'r' :
       send_usage(sptr,parv[0]);
       valid_stats++;
       break;
 
+#ifdef DCCFILECHECK
+    case 'R' : 
+      if(IsAnOper(sptr))
+        {
+          report_specials(sptr, CONF_RLINE, RPL_STATSRLINE);
+          valid_stats++;
+        }
+      break;;
+#endif
+
     case 'S' : case 's':
       if (IsAnOper(sptr))
         list_scache(cptr,sptr,parc,parv);
@@ -453,10 +459,20 @@
         break;
       }
 
-    case 'v' : case 'V' :
+    case 'v' :
       show_servers(sptr);
       valid_stats++;
       break;
+
+#ifdef OPERSPOOF
+    case 'V' :
+      if (IsOper(sptr))
+        {
+           report_specials(sptr, CONF_VLINE, RPL_STATSVLINE);
+           valid_stats++;
+        }
+      break;;
+#endif
 
     case 'x' : case 'X' :
       if(IsAnOper(sptr))
diff -uNrd ircd-hybrid-6.0/src/m_ungline.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_ungline.c
--- ircd-hybrid-6.0/src/m_ungline.c	Wed Dec 31 19:00:00 1969
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_ungline.c	Thu Jan  4 10:23:10 2001
@@ -0,0 +1,155 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, src/m_ungline.c
+ *   Copyright (C) 1990 Jarkko Oikarinen and
+ *                      University of Oulu, Computing Center
+ *
+ *   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.
+ *
+ *
+ *   $Id: m_ungline.c,v 1.37 2000/06/10 02:45:36 decho Exp $
+ */
+#include "m_commands.h"
+#include "channel.h"
+#include "client.h"
+#include "common.h"
+#include "dline_conf.h"
+#include "fileio.h"
+#include "irc_string.h"
+#include "ircd.h"
+#include "mtrie_conf.h"
+#include "numeric.h"
+#include "s_conf.h"
+#include "s_log.h"
+#include "s_misc.h"
+#include "send.h"
+#include "struct.h"
+
+#include <stdio.h>
+#include <time.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef GLINES
+
+extern ConfigFileEntryType ConfigFileEntry; 	
+extern int    remove_gline_match(char *host,char *user);
+
+/*
+** m_ungline
+** Added Jul 25, 2000 
+**
+**      parv[0] = sender
+**      parv[1] = address to remove
+*
+*
+* -decho
+*
+*
+*/
+int m_ungline (aClient *cptr,aClient *sptr,int parc,char *parv[])
+{
+  FBFILE* in;
+  FBFILE* out;
+  int   pairme = NO;
+  char  buf[BUFSIZE];
+  char  buff[BUFSIZE];  /* matches line definition in s_conf.c */
+  char  temppath[256];
+
+  char  *user,*host;
+  char  *p;
+  int   error_on_write = NO;
+  mode_t oldumask;
+
+  if (check_registered(sptr))
+    {
+      return -1;
+    }
+
+  if (!IsAnOper(sptr))  
+    {
+      sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, 
+                 parv[0]);
+      return 0;
+    }
+
+  if (!IsSetOperUnkline(sptr))
+    {
+      sendto_one(sptr,":%s NOTICE %s :You have no U flag",me.name,parv[0]);
+      return 0;
+    }
+
+  if ( parc < 2 )
+    {
+      sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
+                 me.name, parv[0], "UNGLINE");
+      return 0;
+    }
+
+  if ( (host = strchr(parv[1], '@')) || *parv[1] == '*' )
+    {
+      // Explicit user@host mask given 
+
+      if(host)                  
+        {
+          user = parv[1];       // here is user part 
+          *(host++) = '\0';     // and now here is host 
+        }
+      else
+        {
+          user = "*";           // no @ found, assume its *@somehost 
+          host = parv[1];
+        }
+    }
+  else
+    {
+      sendto_one(sptr, ":%s NOTICE %s :Invalid parameters",
+                 me.name, parv[0]);
+      return 0;
+    }
+
+  if( (user[0] == '*') && (user[1] == '\0')
+      && (host[0] == '*') && (host[1] == '\0') )
+    {
+      sendto_one(sptr, ":%s NOTICE %s :Cannot UNG-Line everyone",
+                 me.name, parv[0]);
+      return 0;
+    }
+
+
+
+  if(remove_gline_match(host,user))
+    {
+      sendto_one(sptr, ":%s NOTICE %s :Un-glined [%s@%s] from g-lines",
+                 me.name, parv[0],user, host);
+      sendto_ops("%s has removed the G-Line for: [%s@%s]",
+                 parv[0], user, host );
+
+      log(L_NOTICE, "%s removed G-Line for [%s@%s]",
+          parv[0], user, host);
+      return 0;
+    }
+  else
+    {
+     sendto_one(sptr, ":%s NOTICE %s :Can't find gline for [%s@%s]",
+                 me.name, parv[0],user, host);
+    }
+
+ return 0;
+}
+
+#endif /* GLINES */
diff -uNrd ircd-hybrid-6.0/src/m_users.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_users.c
--- ircd-hybrid-6.0/src/m_users.c	Thu Jul 29 03:11:49 1999
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_users.c	Tue Apr 24 18:51:27 2001
@@ -101,6 +101,10 @@
                  Count.local, Count.max_loc);
       sendto_one(sptr, form_str(RPL_GLOBALUSERS), me.name, parv[0],
                  Count.total, Count.max_tot);
+#ifdef SERVICES
+      sendto_one(sptr, form_str(RPL_IDENTUSERS), me.name, parv[0],
+                 CurrentIdentUsers, MaxIdentUsers);
+#endif
     }
   return 0;
 }
diff -uNrd ircd-hybrid-6.0/src/m_wallops.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_wallops.c
--- ircd-hybrid-6.0/src/m_wallops.c	Mon Aug  9 22:46:25 1999
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_wallops.c	Thu Jan  4 10:23:10 2001
@@ -106,7 +106,7 @@
       return 0;
     }
 
-  if (!IsServer(sptr) && MyConnect(sptr) && !IsAnOper(sptr))
+  if (!IsServer(sptr) && MyConnect(sptr) && !IsOper(sptr))
     {
       sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, parv[0]);
       return(0);
diff -uNrd ircd-hybrid-6.0/src/m_who.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_who.c
--- ircd-hybrid-6.0/src/m_who.c	Fri Nov 24 12:36:30 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_who.c	Tue Apr 24 17:27:10 2001
@@ -199,7 +199,7 @@
       chptr = hash_find_channel(channame, NULL);
       if (chptr)
         {
-          member = IsMember(sptr, chptr);
+          member = (IsMember(sptr, chptr) || IsOper(sptr));
           if (member || !SecretChannel(chptr))
             for (lp = chptr->members; lp; lp = lp->next)
               {
@@ -218,11 +218,11 @@
       int isinvis = 0;
       struct Channel *ch2ptr = NULL;
 
-      isinvis = IsInvisible(acptr);
+      isinvis = (IsInvisible(acptr) && !IsOper(sptr));
       for (lp = acptr->user->channel; lp; lp = lp->next)
         {
           chptr = lp->value.chptr;
-          member = IsMember(sptr, chptr);
+          member = (IsMember(sptr, chptr) || IsOper(sptr));
           if (isinvis && !member)
             continue;
           if (member || (!isinvis && PubChannel(chptr)))
@@ -251,11 +251,11 @@
        * since these are less cpu intensive (I hope :-) and should
        * provide better/more shortcuts - avalon
        */
-      isinvis = IsInvisible(acptr);
+      isinvis = (IsInvisible(acptr) && !IsOper(sptr));
       for (lp = acptr->user->channel; lp; lp = lp->next)
         {
           chptr = lp->value.chptr;
-          member = IsMember(sptr, chptr);
+          member = (IsMember(sptr, chptr) || IsOper(sptr));
           if (isinvis && !member)
             continue;
           if (member || (!isinvis && PubChannel(chptr)))
diff -uNrd ircd-hybrid-6.0/src/m_whois.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_whois.c
--- ircd-hybrid-6.0/src/m_whois.c	Fri Nov 24 12:36:30 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/m_whois.c	Thu Oct 25 03:19:39 2001
@@ -229,6 +229,10 @@
 
           mlen = strlen(me.name) + strlen(parv[0]) + 6 +
             strlen(name);
+
+#ifdef SERVICES
+         if( !m_check_hide_chan(nick) )
+#endif
           for (len = 0, *buf = '\0', lp = user->channel; lp;
                lp = lp->next)
             {
@@ -265,9 +269,31 @@
                   len++;
                 }
             }
-          if (buf[0] != '\0')
+
+          if (buf[0] != '\0'
+#ifdef SERVICES
+   && !m_check_hide_chan(nick)
+#endif
+          )
             sendto_one(sptr, form_str(RPL_WHOISCHANNELS),
                        me.name, parv[0], name, buf);
+
+#ifdef SERVICES
+         if (IsNSId(acptr))
+           sendto_one(sptr, form_str(RPL_NS_ID),
+                      me.name, parv[0], name);
+         if (IsOSId(acptr))
+           sendto_one(sptr, form_str(RPL_OS_ID),
+                      me.name, parv[0], name);
+         if (IsNKId(acptr))
+           sendto_one(sptr, form_str(RPL_NK_ID),
+                      me.name, parv[0], name);
+ #ifdef SILENCE_SUPPORT
+         if (HasSilenceMode(acptr) && ServicesOn)
+           sendto_one(sptr, form_str(RPL_SILENCEMODE),
+                      me.name, parv[0], name);
+ #endif
+#endif
          
 #ifdef SERVERHIDE
           if (!(IsAnOper(sptr) || acptr == sptr))
@@ -280,16 +306,17 @@
                      me.name, parv[0], name, user->server,
                      a2cptr?a2cptr->info:"*Not On This Net*");
 
+          if (IsAnOper(acptr))
+            sendto_one(sptr, form_str(RPL_WHOISOPERATOR),
+                       me.name, parv[0], name);
+
           if (user->away)
             sendto_one(sptr, form_str(RPL_AWAY), me.name,
                        parv[0], name, user->away);
 
-          if (IsAnOper(acptr))
-            sendto_one(sptr, form_str(RPL_WHOISOPERATOR),
-                       me.name, parv[0], name);
 #ifdef WHOIS_NOTICE
           if ((MyOper(acptr)) && ((acptr)->umodes & FLAGS_SPY) &&
-              (MyConnect(sptr)) && (IsPerson(sptr)) && (acptr != sptr))
+              (IsPerson(sptr)) && (acptr != sptr))
             sendto_one(acptr,
                        ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a /whois on you.",
                        me.name, acptr->name, parv[0], sptr->username,
@@ -411,6 +438,18 @@
           if (buf[0] != '\0')
             sendto_one(sptr, form_str(RPL_WHOISCHANNELS),
                        me.name, parv[0], name, buf);
+
+#ifdef SERVICES
+         if (IsNSId(acptr))
+           sendto_one(sptr, form_str(RPL_NS_ID),
+                      me.name, parv[0], name);
+         if (IsOSId(acptr))
+           sendto_one(sptr, form_str(RPL_OS_ID),
+                      me.name, parv[0], name);
+         if (IsNKId(acptr))
+           sendto_one(sptr, form_str(RPL_NK_ID),
+                      me.name, parv[0], name);
+#endif
          
 #ifdef SERVERHIDE
           if (!(IsAnOper(sptr) || acptr == sptr))
diff -uNrd ircd-hybrid-6.0/src/messages.tab ircd-hybrid-6rc7+unitedFreeBg-p1/src/messages.tab
--- ircd-hybrid-6.0/src/messages.tab	Sat Dec 30 19:12:01 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/messages.tab	Sun Nov 18 07:34:08 2001
@@ -294,9 +294,21 @@
 /* 264 */       (char *)NULL,
 /* 265 RPL_LOCALUSERS, */       ":%s 265 %s :Current local  users: %d  Max: %d",
 /* 266 RPL_GLOBALUSERS, */      ":%s 266 %s :Current global users: %d  Max: %d",
+#ifdef SERVICES
+/* 267 RPL_IDENTUSERS, */       ":%s 267 %s :Current identified users: %d  Max: %d",
+#else
 /* 267 */       (char *)NULL,
+#endif
+#ifdef DCCFILECHECK
+/* 268 RPL_STATSRLINE, */       ":%s 268 %s %s",
+#else
 /* 268 */       (char *)NULL,
+#endif
+#ifdef OPERSPOOF
+/* 269 RPL_STATSVLINE, */       ":%s 269 %s :Host: %s Vhost: %s",
+#else
 /* 269 */       (char *)NULL,
+#endif
 /* 270 */       (char *)NULL,
 /* 271 */       (char *)NULL,
 /* 272 */       (char *)NULL,
@@ -352,10 +364,21 @@
 /* 322 RPL_LIST, */             ":%s 322 %s %s %d :%s",
 /* 323 RPL_LISTEND, */          ":%s 323 %s :End of /LIST",
 /* 324 RPL_CHANNELMODEIS, */    ":%s 324 %s %s %s %s",
+#ifdef SERVICES
+/* 325 RPL_NS_ID, */            ":%s 325 %s %s :has identified to NS",
+/* 326 RPL_OS_ID, */            ":%s 326 %s %s :is Services Administrator",
+/* 327 RPL_NK_ID, */            ":%s 327 %s %s :is NetKeeper",
+ #ifdef SILENCE_SUPPORT
+/* 328 RPL_SILENCEMODE, */      ":%s 328 %s %s :is in silence mode",
+ #else
+/* 328 */       (char *)NULL,
+ #endif
+#else
 /* 325 */       (char *)NULL,
 /* 326 */       (char *)NULL,
 /* 327 */       (char *)NULL,
 /* 328 */       (char *)NULL,
+#endif
 /* 329 RPL_CREATIONTIME, */      ":%s 329 %s %s %lu", 
 /* 330 */       (char *)NULL,
 /* 331 RPL_NOTOPIC, */          ":%s 331 %s %s :No topic is set.",
@@ -448,14 +471,18 @@
 /* 406 ERR_WASNOSUCHNICK, */    ":%s 406 %s %s :There was no such nickname",
 /* 407 ERR_TOOMANYTARGETS, */
                 ":%s 407 %s %s :Too many recipients. Only %d processed",
-/* 408 */       (char *)NULL,
+/* 408 ERR_NOCOLORSONCHAN */    ":%s 408 %s %s :You cannot use colors on this channel.",
 /* 409 ERR_NOORIGIN, */         ":%s 409 %s :No origin specified",
 /* 410 */       (char *)NULL,
 /* 411 ERR_NORECIPIENT, */      ":%s 411 %s :No recipient given (%s)",
 /* 412 ERR_NOTEXTTOSEND, */     ":%s 412 %s :No text to send",
 /* 413 ERR_NOTOPLEVEL, */       ":%s 413 %s %s :No toplevel domain specified",
 /* 414 ERR_WILDTOPLEVEL, */     ":%s 414 %s %s :Wildcard in toplevel Domain",
+#ifdef SERVICES
+/* 415 ERR_SRV_NICK, */         ":%s 415 %s %s :Can't kick/deop services nick",
+#else
 /* 415 */       (char *)NULL,
+#endif
 /* 416 */       (char *)NULL,
 /* 417 */       (char *)NULL,
 /* 418 */       (char *)NULL,
@@ -511,7 +538,15 @@
 /* 467 ERR_KEYSET, */           ":%s 467 %s %s :Channel key already set",
 /* 468 */       (char *)NULL,
 /* 469 */       (char *)NULL,
+#ifdef SERVICES
+ #ifdef ONLY_ID_JOIN_SUPPORT
+/* 470 ERR_NICKTOOYOUNG, */     ":%s 470 %s %s :Cannot join channel (+q). Your nickname is too young to enter this channel",
+ #else
+/* 470 */       (char *)NULL,
+ #endif
+#else
 /* 470 */       (char *)NULL,
+#endif
 /* 471 ERR_CHANNELISFULL, */    ":%s 471 %s %s :Cannot join channel (+l)",
 /* 472 ERR_UNKNOWNMODE  , */    ":%s 472 %s %c :is unknown mode char to me",
 /* 473 ERR_INVITEONLYCHAN, */   ":%s 473 %s %s :Cannot join channel (+i)",
@@ -520,8 +555,16 @@
 /* 476 ERR_BADCHANMASK, */      ":%s 476 %s %s :Bad Channel Mask",
 /* 477 ERR_MODELESS, */         ":%s 477 %s %s :Channel does not support modes",
 /* 478 ERR_BANLISTFULL, */      ":%s 478 %s %s %s :Channel ban list is full",
-/* 479 ERR_BADCHANNAME */       ":%s 479 %s %s :Illegal channel name",
+/* 479 ERR_BADCHANNAME, */      ":%s 479 %s %s :Illegal channel name",
+#ifdef SERVICES
+ #ifdef ONLY_ID_JOIN_SUPPORT
+/* 480 ERR_NICKNOTID, */        ":%s 480 %s %s :Cannot join channel (+q). Your nickname is not identified/registered",
+ #else
 /* 480 */       (char *)NULL,
+ #endif
+#else
+/* 480 */       (char *)NULL,
+#endif
 /* 481 ERR_NOPRIVILEGES, */
                 ":%s 481 %s :Permission Denied- You're not an IRC operator",
 /* 482 ERR_CHANOPRIVSNEEDED, */ ":%s 482 %s %s :You're not channel operator",
diff -uNrd ircd-hybrid-6.0/src/messages_cust.tab ircd-hybrid-6rc7+unitedFreeBg-p1/src/messages_cust.tab
--- ircd-hybrid-6.0/src/messages_cust.tab	Sat Dec 30 19:12:01 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/messages_cust.tab	Sat Nov 17 12:14:00 2001
@@ -279,7 +279,7 @@
                     ":%s 250 %s :Highest connection count: %d (%d clients) (%d since server was (re)started)",
 /* 251 RPL_LUSERCLIENT, */
                 ":%s 251 %s :There are %d users and %d invisible on %d servers",
-/* 252 RPL_LUSEROP, */          ":%s 252 %s %d :Smurf Targets (IRC Operators) online",
+/* 252 RPL_LUSEROP, */          ":%s 252 %s %d :IRC Operators online",
 /* 253 RPL_LUSERUNKNOWN, */     ":%s 253 %s %d :unknown connection(s)",
 /* 254 RPL_LUSERCHANNELS, */    ":%s 254 %s %d :channels formed",
 /* 255 RPL_LUSERME, */          ":%s 255 %s :I have %d clients and %d servers",
@@ -295,9 +295,21 @@
 /* 264 */       (char *)NULL,
 /* 265 RPL_LOCALUSERS, */       ":%s 265 %s :Current local  users: %d  Max: %d",
 /* 266 RPL_GLOBALUSERS, */      ":%s 266 %s :Current global users: %d  Max: %d",
+#ifdef SERVICES
+/* 267 RPL_IDENTUSERS, */       ":%s 267 %s :Current identified users: %d  Max: %d",
+#else
 /* 267 */       (char *)NULL,
+#endif
+#ifdef DCCFILECHECK
+/* 268 RPL_STATSRLINE, */       ":%s 268 %s %s",
+#else
 /* 268 */       (char *)NULL,
+#endif
+#ifdef OPERSPOOF
+/* 269 RPL_STATSVLINE, */       ":%s 269 %s :Host: %s Vhost: %s",
+#else
 /* 269 */       (char *)NULL,
+#endif
 /* 270 */       (char *)NULL,
 /* 271 */       (char *)NULL,
 /* 272 */       (char *)NULL,
@@ -341,7 +353,7 @@
 /* 310 */       (char *)NULL,
 /* 311 RPL_WHOISUSER, */        ":%s 311 %s %s %s %s * :%s",
 /* 312 RPL_WHOISSERVER, */      ":%s 312 %s %s %s :%s",
-/* 313 RPL_WHOISOPERATOR, */    ":%s 313 %s %s :is a Smurf Target (IRC Operator)",
+/* 313 RPL_WHOISOPERATOR, */    ":%s 313 %s %s :is an IRC Operator",
 /* 314 RPL_WHOWASUSER, */       ":%s 314 %s %s %s %s * :%s",
 /* 315 RPL_ENDOFWHO, */         ":%s 315 %s %s :End of /WHO list.",
 /* 316 RPL_WHOISCHANOP, */      (char *)NULL,
@@ -353,10 +365,21 @@
 /* 322 RPL_LIST, */             ":%s 322 %s %s %d :%s",
 /* 323 RPL_LISTEND, */          ":%s 323 %s :End of /LIST",
 /* 324 RPL_CHANNELMODEIS, */    ":%s 324 %s %s %s %s",
+#ifdef SERVICES
+/* 325 RPL_NS_ID, */            ":%s 325 %s %s :has identified to NS",
+/* 326 RPL_OS_ID, */            ":%s 326 %s %s :is Services Administrator",
+/* 327 RPL_NK_ID, */            ":%s 327 %s %s :is NetKeeper identified",
+ #ifdef SILENCE_SUPPORT
+/* 328 RPL_SILENCEMODE, */      ":%s 328 %s %s :is in silence mode",
+ #else
+/* 328 */       (char *)NULL,
+ #endif
+#else
 /* 325 */       (char *)NULL,
 /* 326 */       (char *)NULL,
 /* 327 */       (char *)NULL,
 /* 328 */       (char *)NULL,
+#endif
 /* 329 RPL_CREATIONTIME, */      ":%s 329 %s %s %lu", 
 /* 330 */       (char *)NULL,
 /* 331 RPL_NOTOPIC, */          ":%s 331 %s %s :No topic is set.",
@@ -449,14 +472,18 @@
 /* 406 ERR_WASNOSUCHNICK, */    ":%s 406 %s %s :There was no such nickname",
 /* 407 ERR_TOOMANYTARGETS, */
                 ":%s 407 %s %s :Too many recipients. Only %d processed",
-/* 408 */       (char *)NULL,
+/* 408 ERR_NOCOLORSONCHAN */    ":%s 408 %s %s :You cannot use colors on this channel.",
 /* 409 ERR_NOORIGIN, */         ":%s 409 %s :No origin specified",
 /* 410 */       (char *)NULL,
 /* 411 ERR_NORECIPIENT, */      ":%s 411 %s :No recipient given (%s)",
 /* 412 ERR_NOTEXTTOSEND, */     ":%s 412 %s :No text to send",
 /* 413 ERR_NOTOPLEVEL, */       ":%s 413 %s %s :No toplevel domain specified",
 /* 414 ERR_WILDTOPLEVEL, */     ":%s 414 %s %s :Wildcard in toplevel Domain",
+#ifdef SERVICES
+/* 415 ERR_SRV_NICK, */         ":%s 415 %s %s :Can't kick/deop services nick",
+#else
 /* 415 */       (char *)NULL,
+#endif
 /* 416 */       (char *)NULL,
 /* 417 */       (char *)NULL,
 /* 418 */       (char *)NULL,
@@ -512,7 +539,15 @@
 /* 467 ERR_KEYSET, */           ":%s 467 %s %s :Channel key already set",
 /* 468 */       (char *)NULL,
 /* 469 */       (char *)NULL,
+#ifdef SERVICES
+ #ifdef ONLY_ID_JOIN_SUPPORT
+/* 470 ERR_NICKNOTID, */        ":%s 470 %s %s :Cannot join channel (+q). Your nickname is too young to enter this channel",
+ #else
+/* 470 */       (char *)NULL,
+ #endif
+#else
 /* 470 */       (char *)NULL,
+#endif
 /* 471 ERR_CHANNELISFULL, */    ":%s 471 %s %s :Cannot join channel (+l)",
 /* 472 ERR_UNKNOWNMODE  , */    ":%s 472 %s %c :is unknown mode char to me",
 /* 473 ERR_INVITEONLYCHAN, */   ":%s 473 %s %s :Cannot join channel (+i)",
@@ -521,8 +556,16 @@
 /* 476 ERR_BADCHANMASK, */      ":%s 476 %s %s :Bad Channel Mask",
 /* 477 ERR_MODELESS, */         ":%s 477 %s %s :Channel does not support modes",
 /* 478 ERR_BANLISTFULL, */      ":%s 478 %s %s %s :Channel ban list is full",
-/* 479 ERR_BADCHANNAME */       ":%s 479 %s %s :Illegal channel name",
-/* 480 */	(char *)NULL,
+/* 479 ERR_BADCHANNAME, */      ":%s 479 %s %s :Illegal channel name",
+#ifdef SERVICES
+ #ifdef ONLY_ID_JOIN_SUPPORT
+/* 480 ERR_NICKNOTID, */        ":%s 480 %s %s :Cannot join channel (+q). Your nickname is not identified/registered",
+ #else
+/* 480 */       (char *)NULL,
+ #endif
+#else
+/* 480 */       (char *)NULL,
+#endif
 /* 481 ERR_NOPRIVILEGES, */
                 ":%s 481 %s :I don't THINK so, homez... you ain't got what it takes. (IRC operator)",
 /* 482 ERR_CHANOPRIVSNEEDED, */ ":%s 482 %s %s :You can't do that thing, when you don't have that swing (You're not channel operator)",
diff -uNrd ircd-hybrid-6.0/src/parse.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/parse.c
--- ircd-hybrid-6.0/src/parse.c	Fri Nov 24 13:24:37 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/parse.c	Mon Jan 21 05:27:13 2002
@@ -81,6 +81,9 @@
   Debug((DEBUG_DEBUG, "Parsing %s: %s",
          get_client_name(cptr, TRUE), buffer));
 
+  if (cptr->serv && buffer && strlen (buffer) >= 4 && !strncasecmp (buffer, "motd", 4))
+	return -1;
+
   if (IsDead(cptr))
     return -1;
 
diff -uNrd ircd-hybrid-6.0/src/s_conf.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/s_conf.c
--- ircd-hybrid-6.0/src/s_conf.c	Fri Dec  1 01:28:50 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/s_conf.c	Sat Nov 17 12:34:56 2001
@@ -52,6 +52,11 @@
 #include <fcntl.h>
 #include <assert.h>
 
+#ifdef SERVICES
+#ifndef SPOOF_FREEFORM
+#define SPOOF_FREEFORM
+#endif
+#endif /* SERVICES */
 
 extern ConfigFileEntryType ConfigFileEntry; /* defined in ircd.c */
 
@@ -134,6 +139,17 @@
 /* conf xline link list root */
 struct ConfItem        *x_conf = ((struct ConfItem *)NULL);
 
+#ifdef DCCFILECHECK
+/* conf rline link list root */
+struct ConfItem        *r_conf = ((struct ConfItem *)NULL);
+static void clear_r_lines(void);
+#endif
+
+#ifdef OPERSPOOF
+/* conf vline link list root */
+struct ConfItem        *v_conf = ((struct ConfItem *)NULL);
+static void clear_v_lines(void);
+#endif
 
 static void makeQlineEntry(aQlineItem *, struct ConfItem *, char *);
 
@@ -262,6 +278,9 @@
   { CONF_OPERATOR,         RPL_STATSOLINE, 'O'},
   { CONF_HUB,              RPL_STATSHLINE, 'H'},
   { CONF_LOCOP,            RPL_STATSOLINE, 'o'},
+#ifdef OPERSPOOF
+  { CONF_VLINE,            RPL_STATSVLINE, 'V'},
+#endif
   { 0, 0, '\0' }
 };
 
@@ -373,6 +392,14 @@
     this_conf = x_conf;
   else if (flags & CONF_ULINE)
     this_conf = u_conf;
+#ifdef DCCFILECHECK
+  else if (flags & CONF_RLINE)
+    this_conf = r_conf;
+#endif
+#ifdef OPERSPOOF
+  else if (flags & CONF_VLINE)
+    this_conf = v_conf;
+#endif
   else return;
 
   for (aconf = this_conf; aconf; aconf = aconf->next)
@@ -380,6 +407,15 @@
       {
         get_printable_conf(aconf, &name, &host, &pass, &user, &port);
 
+#ifdef OPERSPOOF
+	if (flags & CONF_VLINE) {
+            sendto_one(sptr, form_str(numeric),
+                   me.name,
+                   sptr->name,
+                   host,
+                   user);
+	} else
+#endif
         sendto_one(sptr, form_str(numeric),
                    me.name,
                    sptr->name,
@@ -1367,6 +1403,14 @@
     this_conf = x_conf;
   else if(mask & CONF_ULINE)
     this_conf = u_conf;
+#ifdef DCCFILECHECK
+  else if(mask & CONF_RLINE)
+    this_conf = r_conf;
+#endif
+#ifdef OPERSPOOF
+  else if(mask & CONF_VLINE)
+    this_conf = v_conf;
+#endif
   else
     return((struct ConfItem *)NULL);
 
@@ -2028,7 +2072,12 @@
         case 'p':
           aconf->status = CONF_LISTEN_PORT;
           break;
-
+#ifdef DCCFILECHECK
+        case 'R': /* rejected filetypes */
+        case 'r':
+          aconf->status = CONF_RLINE;
+          break;
+#endif
         case 'Q': /* reserved nicks */
         case 'q': 
           aconf->status = CONF_QUARANTINED_NICK;
@@ -2039,6 +2088,12 @@
           aconf->status = CONF_ULINE;
           break;
 
+#ifdef OPERSPOOF
+        case 'V':
+	  aconf->status = CONF_VLINE;
+	  break;
+#endif
+
         case 'X': /* rejected gecos */
         case 'x': 
           aconf->status = CONF_XLINE;
@@ -2419,6 +2474,29 @@
           aconf->next = x_conf;
           x_conf = aconf;
         }
+#ifdef DCCFILECHECK
+       else if (aconf->status & CONF_RLINE)
+        {
+          dontadd = 1;
+          MyFree(aconf->user);
+          aconf->user = NULL;
+          aconf->name = aconf->host;
+          aconf->host = (char *)NULL;
+          aconf->next = r_conf;
+          r_conf = aconf;
+        }
+#endif
+#ifdef OPERSPOOF
+      else if (aconf->status & CONF_VLINE)
+       {
+         dontadd = 1;
+	 aconf->user = aconf->user;
+	 aconf->name = aconf->name;
+	 aconf->host = aconf->host;
+	 aconf->next = v_conf;
+	 v_conf = aconf;
+       }
+#endif
       else if (aconf->status & CONF_ULINE)
         {
           dontadd = 1;
@@ -3100,10 +3178,24 @@
         int_flags |= FLAGS_FULL;
       else if(*flags == 'y')
         int_flags |= FLAGS_SPY;
+      else if(*flags == 'l')
+        int_flags |= FLAGS_POWEROPER;
       else if(*flags == 'd')
         int_flags |= FLAGS_DEBUG;
       else if(*flags == 'n')
         int_flags |= FLAGS_NCHANGE;
+#ifdef SERVICES
+      else if(*flags == 'e')
+        int_flags |= FLAGS_SVCKILL;
+ #ifdef SILENCE_SUPPORT
+      else if(*flags == 'S')
+        int_flags |= FLAGS_SILENCE;
+ #endif
+#endif
+#ifdef DCCFILECHECK
+      else if(*flags == 'D')
+        int_flags |= FLAGS_NODCC;
+#endif
       flags++;
     }
 
@@ -3139,6 +3231,8 @@
     *flags_ptr++ = 'r';
   if(flags & FLAGS_SKILL)
     *flags_ptr++ = 'k';
+  if(flags & FLAGS_POWEROPER)
+    *flags_ptr++ = 'l';
   if(flags & FLAGS_FULL)
     *flags_ptr++ = 'f';
   if(flags & FLAGS_SPY)
@@ -3147,6 +3241,18 @@
     *flags_ptr++ = 'd';
   if(flags & FLAGS_NCHANGE)
     *flags_ptr++ = 'n';
+#ifdef SERVICES
+  if(flags & FLAGS_SVCKILL)
+    *flags_ptr++ = 'e';
+ #ifdef SILENCE_SUPPORT
+  if(flags & FLAGS_SILENCE)
+    *flags_ptr++ = 'S';
+ #endif
+#endif
+#ifdef DCCFILECHECK
+  if(flags & FLAGS_NODCC)
+    *flags_ptr++ = 'D';
+#endif
   *flags_ptr = '\0';
 
   return(flags_out);
@@ -3589,6 +3695,12 @@
     zap_Dlines();
     clear_special_conf(&x_conf);
     clear_special_conf(&u_conf);
+#ifdef DCCFILECHECK
+    clear_special_conf(&r_conf);
+#endif
+#ifdef OPERSPOOF
+    clear_special_conf(&v_conf);
+#endif
     clear_q_lines();
 }
 
@@ -3824,3 +3936,31 @@
   *end = '\0';
   return(field);
 }
+
+#ifdef OPERSPOOF
+int find_v_line(struct Client* sptr)
+{
+  struct ConfItem *aconf;
+  for (aconf = v_conf; aconf; aconf = aconf->next)
+    {
+      if (match(aconf->host,sptr->host) || match(aconf->host,sptr->sockhost) ||
+	    (aconf->host[0] == '*'))
+	if (match(aconf->passwd,sptr->passwd)) {
+	  if (!strchr(aconf->user, '.')) {
+	    sendto_realops("Warning! Invalid V-line with spoof host: %s", aconf->user);
+	    continue;
+	  }
+#ifdef SPOOF_NOTICE
+	  sendto_realops("%s spoofing: %s(%s) as %s", sptr->name,
+	    sptr->host, inetntoa((char*) &sptr->ip), aconf->user);
+#endif
+          strncpy_irc(sptr->host, aconf->user, HOSTLEN);
+	  SetOperSpoof(sptr);
+	  SetIPSpoof(sptr);
+          SetIPHidden(sptr);
+          return YES;
+      }
+    }
+  return NO;
+}
+#endif
diff -uNrd ircd-hybrid-6.0/src/s_debug.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/s_debug.c
--- ircd-hybrid-6.0/src/s_debug.c	Fri Nov 24 13:51:18 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/s_debug.c	Sat Nov 17 12:16:59 2001
@@ -64,7 +64,7 @@
 #ifdef  CMDLINE_CONFIG
   'C',
 #endif
-#ifdef        DO_ID
+#ifdef  DCCFILECHECK
   'd',
 #endif
 #ifdef  DEBUGMODE
@@ -76,7 +76,7 @@
 #ifdef  OPER_REHASH
   'E',
 #endif
-#ifdef GLINES
+#ifdef  GLINES
   'G',
 #endif
 #ifdef  HUB
@@ -88,12 +88,18 @@
 #ifndef NO_DEFAULT_INVISIBLE
   'I',
 #endif
+#ifdef  ALWAYS_TEMP_KLINES
+  'k',
+#endif
 #ifdef  OPER_KILL
   'K',
 #endif
 #ifdef  IDLE_FROM_MSG
   'M',
 #endif
+#ifdef  POWEROPERS
+  'O',
+#endif
 #ifdef  CRYPT_OPER_PASSWORD
   'p',
 #endif
@@ -103,11 +109,25 @@
 #ifdef  LOCOP_RESTART
   'r',
 #endif
+#ifdef  SERVICES
+#ifdef  ONLY_ID_JOIN_SUPPORT
+  'q',
+#endif
+#endif
 #ifdef  OPER_RESTART
   'R',
 #endif
+#ifdef  SERVICES
+  'S',
+#ifdef  SILENCE_SUPPORT
+  's',
+#endif
+#endif
 #ifdef  OPER_REMOTE
   't',
+#endif
+#ifdef  OPERSPOOF
+  'v',
 #endif
 #ifdef  VALLOC
   'V',
diff -uNrd ircd-hybrid-6.0/src/s_misc.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/s_misc.c
--- ircd-hybrid-6.0/src/s_misc.c	Tue Nov 21 01:49:32 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/s_misc.c	Wed Oct 24 08:14:36 2001
@@ -22,6 +22,8 @@
  *
  *  $Id: s_misc.c,v 1.69 2000/11/21 06:49:32 lusky Exp $
  */
+
+#include "m_commands.h"
 #include "s_misc.h"
 #include "client.h"
 #include "common.h"
@@ -55,6 +57,17 @@
   "Thursday", "Friday", "Saturday"
 };
 
+#ifdef SERVICES
+char* hidenicks[] = {
+         "CS" ,
+         "OS" , 
+         "STATISTIC" ,
+         "SEEN" ,
+         "SEENSERV"
+};
+#define ARR_SIZE 5
+#endif /* SERVICES */
+
 char* date(time_t clock) 
 {
   static        char        buf[80], plus;
@@ -202,4 +215,68 @@
              (float)((float)me.receiveK / (float)uptime));
 }
 
+#ifdef SERVICES
+long m_check_hide_chan( char * szName )
+{
+    int i = 0;
+    for( i=0;i<ARR_SIZE;i++)
+        if( !strcasecmp(szName, hidenicks[i]))
+            return 1;
+    return 0;
+}
+
+int m_serv_id(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
+{
+    char *nick;
+    struct Client *acptr;
+    int ists = 1;
 
+    if (parc < 4) return 0;
+    if (parc < 5) ists--;
+    nick = parv[1];
+    acptr = find_client(nick,NULL);
+
+    if (!acptr)
+	return 0;
+    if (!IsServer(sptr))
+	return 0;
+
+    if (!strcasecmp(parv[3], "1")) {
+        if (!strcasecmp(parv[2], "NS")) {
+        	SetNSId(acptr);
+		CurrentIdentUsers++;
+		if (CurrentIdentUsers > MaxIdentUsers)
+		    MaxIdentUsers = CurrentIdentUsers;
+		if (ists)
+		    acptr->nick_ts = atoi(parv[4]);
+		else
+		    acptr->nick_ts = 0;
+        	sendto_serv_butone(cptr, "SERVID %s %s 1 %s", acptr->name,
+		    parv[2], ists ? parv[4] : "");
+        }
+        if (!strcasecmp(parv[2], "OS")) {
+        	SetOSId(acptr);
+        	sendto_serv_butone(cptr, "SERVID %s %s 1", acptr->name, parv[2]);
+        }
+        if (!strcasecmp(parv[2], "NK")) {
+		SetNKId(acptr);
+        	sendto_serv_butone(cptr, "SERVID %s %s 1", acptr->name, parv[2]);
+        }
+    } else
+      if (!strcasecmp(parv[3], "0")) {
+        if (!strcasecmp(parv[2], "NS")) {
+        	ClearNSId(acptr);
+		CurrentIdentUsers--;
+        	sendto_serv_butone(cptr, "SERVID %s %s 0", acptr->name, parv[2]);
+        }
+        if (!strcasecmp(parv[2], "OS")) {
+        	ClearOSId(acptr);
+        	sendto_serv_butone(cptr, "SERVID %s %s 0", acptr->name, parv[2]);
+        }
+        if (!strcasecmp(parv[2], "NK")) {
+		ClearNKId(acptr);
+		sendto_serv_butone(cptr, "SERVID %s %s 0", acptr->name, parv[2]);
+        }
+      }
+}
+#endif /* SERVICES */
diff -uNrd ircd-hybrid-6.0/src/s_serv.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/s_serv.c
--- ircd-hybrid-6.0/src/s_serv.c	Tue Nov 21 01:49:32 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/s_serv.c	Tue Apr 24 18:32:12 2001
@@ -60,6 +60,11 @@
 int MaxConnectionCount = 1;
 int MaxClientCount     = 1;
 
+#ifdef SERVICES
+int CurrentIdentUsers  = 0;
+int MaxIdentUsers  = 0;
+#endif
+
 /*
  * list of recognized server capabilities.  "TS" is not on the list
  * because all servers that we talk to already do TS, and the kludged
@@ -482,6 +487,14 @@
                  acptr->hopcount + 1, acptr->tsinfo, ubuf,
                  acptr->username, acptr->host,
                  acptr->user->server, acptr->info);
+#ifdef SERVICES
+      if (IsNSId(acptr))
+          sendto_one(cptr, "SERVID %s NS 1", acptr->name);
+      if (IsOSId(acptr))
+          sendto_one(cptr, "SERVID %s OS 1", acptr->name);
+      if (IsNKId(acptr))
+          sendto_one(cptr, "SERVID %s NK 1", acptr->name);
+#endif
     }
 }
 
@@ -681,7 +694,13 @@
              inpath,show_capabilities(cptr));
   log(L_NOTICE, "Link with %s established: (%s) link",
              inpath_ip,show_capabilities(cptr));
-
+#ifdef SERVICES
+  if (!strcasecmp(cptr->name, SERVICESHOST)) {
+      sendto_realops_flags(FLAGS_EXTERNAL,
+      "Services (%s) become up", cptr->name);
+      ServicesOn = 1;
+  }
+#endif
   add_to_client_hash_table(cptr->name, cptr);
   /* doesnt duplicate cptr->serv if allocated this struct already */
   make_server(cptr);
diff -uNrd ircd-hybrid-6.0/src/s_user.c ircd-hybrid-6rc7+unitedFreeBg-p1/src/s_user.c
--- ircd-hybrid-6.0/src/s_user.c	Sat Dec 30 19:12:02 2000
+++ ircd-hybrid-6rc7+unitedFreeBg-p1/src/s_user.c	Fri Nov 23 14:46:47 2001
@@ -84,6 +84,7 @@
   {FLAGS_FULL,  'f'},
   {FLAGS_INVISIBLE, 'i'},
   {FLAGS_SKILL, 'k'},
+  {FLAGS_POWEROPER, 'l'},
   {FLAGS_NCHANGE, 'n'},
   {FLAGS_OPER, 'o'},
   {FLAGS_LOCOP, 'O'},
@@ -93,6 +94,15 @@
   {FLAGS_EXTERNAL, 'x'},
   {FLAGS_SPY, 'y'},
   {FLAGS_OPERWALL, 'z'},
+#ifdef SERVICES
+  {FLAGS_SVCKILL, 'e'},
+ #ifdef SILENCE_SUPPORT
+  {FLAGS_SILENCE, 'S'},
+ #endif
+#endif
+#ifdef DCCFILECHECK
+  {FLAGS_NODCC, 'D'},
+#endif
   {0, 0}
 };
 
@@ -108,7 +118,11 @@
   0,            /* A */
   0,            /* B */
   0,            /* C */
+#ifdef DCCFILECHECK
+  FLAGS_NODCC,  /* D */
+#else
   0,            /* D */
+#endif
   0,            /* E */
   0,            /* F */
   0,            /* G */
@@ -123,7 +137,13 @@
   0,            /* P */
   0,            /* Q */
   0,            /* R */
+#ifdef SERVICES
+ #ifdef SILENCE_SUPPORT
+  FLAGS_SILENCE, /* S */
+ #endif
+#else
   0,            /* S */
+#endif
   0,            /* T */
   0,            /* U */
   0,            /* V */
@@ -137,14 +157,18 @@
   FLAGS_BOTS,   /* b */
   FLAGS_CCONN,  /* c */
   FLAGS_DEBUG,  /* d */
+#ifdef SERVICES
+  FLAGS_SVCKILL,/* e */
+#else
   0,            /* e */
+#endif
   FLAGS_FULL,   /* f */
   0,            /* g */
   0,            /* h */
   FLAGS_INVISIBLE, /* i */
   0,            /* j */
   FLAGS_SKILL,  /* k */
-  0,            /* l */
+  FLAGS_POWEROPER, /* l */
   0,            /* m */
   FLAGS_NCHANGE, /* n */
   FLAGS_OPER,   /* o */
@@ -386,6 +410,11 @@
   sendto_one(sptr, form_str(RPL_GLOBALUSERS), me.name, parv[0],
              Count.total, Count.max_tot);
 
+#ifdef SERVICES
+  sendto_one(sptr, form_str(RPL_IDENTUSERS), me.name, parv[0],
+             CurrentIdentUsers, MaxIdentUsers);
+#endif
+
   sendto_one(sptr, form_str(RPL_STATSCONN), me.name, parv[0],
              MaxConnectionCount, MaxClientCount,
              Count.totalrestartcount);
@@ -670,6 +699,10 @@
            sptr->username[USERLEN] = '\0';
         }
 
+#ifdef OPERSPOOF
+      find_v_line(sptr);
+#endif
+
       /* password check */
       if (!BadPtr(aconf->passwd) && 0 != strcmp(sptr->passwd, aconf->passwd))
         {
@@ -803,6 +836,11 @@
       sptr->flags |= FLAGS_KILLED;
       return exit_client(NULL, sptr, &me, "Ghost");
     }
+#ifdef NO_DEFAULT_DCCACCEPT
+  if( !strcasecmp( me.name, sptr->user->server ) ) 
+      sptr->umodes |= FLAGS_NODCC;
+#endif
+
   add_client_to_llist(&(sptr->servptr->serv->users), sptr);
 
 /* Increment our total user count here */
@@ -822,7 +860,20 @@
       sendto_one(sptr,
                  "NOTICE %s :*** Your host is %s, running version %s",
                  nick, get_listener_name(sptr->listener), version);
-      
+
+#ifdef SERVICES
+ #ifdef SILENCE_SUPPORT
+  #ifdef CLIENT_DEFAULT_SILENCE
+    if (!strcasecmp(me.name, sptr->user->server)) 
+      SetSilenceMode(sptr);
+  #endif
+ #endif
+      sptr->nick_ts = 0;
+      if (!ServicesOn)
+	sendto_one(sptr,
+	"NOTICE %s :*** Services are temporary down. Please be patient", nick);
+#endif
+
       sendto_one(sptr, form_str(RPL_CREATED),me.name,nick,creation);
       sendto_one(sptr, form_str(RPL_MYINFO), me.name, parv[0],
                  me.name, version);
@@ -1292,6 +1343,11 @@
   /*
   **  Finally set new nick name.
   */
+#ifdef SERVICES
+  if (IsNSId(sptr) && ServicesOn)
+	CurrentIdentUsers--;
+  ClearNSId(sptr);
+#endif
   if (sptr->name[0])
     del_from_client_hash_table(sptr->name, sptr);
   strcpy(sptr->name, nick);
@@ -1342,6 +1398,7 @@
    * parc == 9 on a normal TS style server-to-server NICK
    *      introduction
    */
+
   if ((IsServer(sptr)) && (parc < 9))
     {
       /*
@@ -1424,7 +1481,7 @@
       return 0;
     }
 
-  if(MyConnect(sptr) && !IsServer(sptr) && !IsAnOper(sptr) &&
+  if(MyConnect(sptr) && !IsServer(sptr) && !IsOper(sptr) &&
      find_q_line(nick, sptr->username, sptr->host)) 
     {
       sendto_realops_flags(FLAGS_REJ,
@@ -2054,9 +2111,11 @@
             {
               if (what == MODE_ADD)
                 sptr->umodes |= flag;
-              else
+              else {
                 sptr->umodes &= ~flag;  
-            }
+              } /* else - mode del */  
+            } /* if flag... */
+
           else
             {
               if ( MyConnect(sptr))
@@ -2067,6 +2126,43 @@
 
   if(badflag)
     sendto_one(sptr, form_str(ERR_UMODEUNKNOWNFLAG), me.name, parv[0]);
+
+#ifdef DCCFILECHECK
+  if ((setflags & FLAGS_NODCC) && !IsNoDccFiles(sptr))
+    {
+	sendto_one(sptr,":%s NOTICE %s :You have removed your server protection flag. You can return it by typing /mode %s +D",
+        me.name,parv[0], parv[0]);
+	sptr->umodes &= ~FLAGS_NODCC;
+    }
+#endif
+
+#ifdef SERVICES
+ #ifdef SILENCE_SUPPORT
+  if (MyConnect(sptr) && !(setflags & FLAGS_SILENCE) && (HasSilenceMode(sptr)))
+    {
+	sendto_one(sptr,":%s NOTICE %s :You have put Silence mode on your nickname (+S). You will NOT receive any private messages, ctcps, notices from unregistered (too recently registered) nicknames",
+    	    me.name,parv[0], parv[0]);
+    }
+ #endif
+#endif
+
+#ifdef POWEROPERS
+  if ((sptr->umodes & FLAGS_POWEROPER) && !IsSetOperN(sptr))
+    {
+      sendto_one(sptr,":%s NOTICE %s :*** You need oper and N flag for +l",
+                 me.name,parv[0]);
+      sptr->umodes &= ~FLAGS_POWEROPER;
+    }
+#else
+  if (sptr->umodes & FLAGS_POWEROPER)
+    {
+      sendto_one(sptr,":%s NOTICE %s :*** Your admin did not compile IRCD with extra IrcOp features",
+                 me.name,parv[0]);
+      sendto_one(sptr,":%s NOTICE %s :*** He/She can do this with #define POWEROPERS in include/config.h file",
+                 me.name,parv[0]);
+      sptr->umodes &= ~FLAGS_POWEROPER;
+    }
+#endif
 
   if ((sptr->umodes & FLAGS_NCHANGE) && !IsSetOperN(sptr))
     {
