December 21st 2002 - 9:24 AM EST - Last Revised February 20th 2003 - 2:21 PM EST
It seems like every friend I have likes a more verbose ircd under their command. I personally agree  to an 
extent, I like to at least know what my Opers are doing with a server. I am starting this modification off
by coding certain options into the core modules, then moving what I can to contrib modules and attempting 
to preserve the original core as much as possible. Options I must leave in the core will later on just be 
configurable via config.h at compile time as any other option.

Addoper/deloper and other similar functionality will also later be implemented. I am attempting to make the 
config file modifyable via the irc client, this option has security concerns though, which is why it's 
presence will also be optional. I expect all of this to be ready by the first Major release.

The first major release of the mod will come after a few conditions are met. First off I want it to be on 
the first version of Hybrid7 full release. Second, I would like several more options I have in mind that
have yet to be implemented. These beta copies are built on a beta copy. The perfect time to test my version
of things.

I /might/ put these changes into hybrid6 as well, but if hybrid7 final comes out before I get bored enough 
to feel a need to do that, I doubt i'll bother. Also when it goes final, i'm toying with a couple options 
for names, like mpbmod or modmpb, maybe even something not using my initials, no clue. For now while it's
beta it'll retain the version scheme +mpb-r<x>, x signifying the release. If this advances beyond Release Z, 
before the final comes out I will resort to double characters (Release Y ... Release Z ... Release AA ...
Release AB ... etc).


Features:
Operators with the +A (administrator) flag will show an added line in /whois "Admin is an IRC Administrator"
Operators with the +A flag will see local spoofed users real ips in /whois.
Operators with the +A flag will see propagated remote /whois's. This only works when the remote user has 
        requested an idle time check.
Operators can send mass messages to all users, rather than just those on the specified top level domain. The 
        messages will only go serverwide if your server's hub has this functionality enabled. This feature
        must be enabled network wide for this feature to allow network broadcasts.
Administrators with the ChannelSpy Flag (+e) can see local channel /joins, /parts and /kicks.
Administrators will see Secret and Private channels in /list and /whois (local users only).
        Channels that are hidden, but still seen by admins names will be shown surrounded by ()s.
Administrators can join channels past user modes such as +i, +k, +b, +l.
Administrator channel kick exemption, only blocks local users from kicking administrators from channels.
Administrator kill exemption, only blocks local operators from killing administrators.
Some contrib modules have been added to the core modules directory.
Setup script that creates a config.h based on user input, then walks the user through the build process.
TCMs and OOMons modified to set umode +B will display in whois as Server Administrative Bots.


Core Files modified: s_conf.c, s_user.c, channel.c, ircd_parser.y, ircd_lexer.l, messages.tab

Core Modules modified: m_part.c, m_message.c, m_kick.c, m_kill.c

System Modules modified: m_join.c, m_whois.c, m_version.c, m_trace.c

Definition files modified: client.h, channel.h, config.h(config.h.pre, config.h.post, config.h.dist), numeric.h, 
        patchlevel.h

Contrib Modules moved to default install:
m_map.c - Displays a network map to the irc client via the "map" command.
m_mkpasswd.c - Generates an encryption string from plaintext input to be used by ircd as an oper password.
m_ojoin.c - Allows Administrators to gain channel ops on channel join.
m_opme.c - Allows Administrators to obtain Channel Operator status in a channel they are in.
m_force.c - Allows Administrators to force users to join or part a specified channel.
m_flags.c - Adds support for Comstud user modes.
spy_admin_notice.c - Notifies Operators with the spy flag (+y) of /admin requests.
spy_info_notice.c - Notifies Operators with the spy flag (+y) of /info requests.
spy_links_notice.c - Notifies Operators with the spy flag (+y) of /links requests.
spy_motd_notice.c - Notifies Operators with the spy flag (+y) of /motd requests.
spy_stats_notice.c - Notifies Operators with the spy flag (+y) of /stats requests.
spy_trace_notice.c - Notifies Operators with the spy flag (+y) of /trace requests.
spy_whois_notice.c - Notifies Operators with the spy flag (+y) of /whois requests.

Contrib Modules modified:
m_ojoin.c - Modified to notify server operators of it's use.
m_opme.c - Modified to notify server operators of it's use.
m_force.c - Modified to be way more verbose, can no longer be used on administrators, remote forcejoin/part
        requests are denied.
m_flags.c - Added support for +mpb added user modes.

Contrib Modules created:
admin_line.c - Shows an added line when a whois is done on an admin. "TARGET is an IRC Server Administrator"
realipinwhois.c - Shows an added line when a whois is done by an admin on a local user revealing their ip.
serverbot.c - Shows an added line when a whois is done on a server bot. "TARGET is an IRC Server Administrative Bot"

Other files created:
Setup.sh - Setup utility to assist with configuration and compile time options
OldSetup.sh - Converts +MPB to OldStyle Hybrid configuration


Installation:
There are two methods of installing ircd-hybrid-7+mpb. As of +mpb-ri administrators may now run the "Setup.sh"
script, located at the root of the source installation. This will walk them through many of the config.h
options, all the way through to the installation step itself. It does not yet, however generate an ircd.conf,
that is planned for the near future though. You may also elect to use the "Old Style" method, and run ./configure,
modify config.h manually, and build the program from command line.

Some versions you can upgrade to by just reloading modules, and some have core server changes that require 
a complete restart of the server. Further documentation about wether or not this is possible will come with 
later releases, as this is a rather early stage of the project anyone who's using the code probably has a 
direct line of contact with me anyway.


Version Flags:
Upon requesting a server's version information, you are presented with dialog familiar to experienced IRC 
server administrators, but probably greek to a newbie who wouldn't likely be reading this document anyway. 
The first line is the only one important to this section. This is what would be displayed in reply to a 
version check in Release E:

hybrid-7rc6+mpb-re(20021221_0).: irc.vulnerable.org egGHIMpZ TS5ow

The section of characters directly following the server name (in this case, irc.vulnerable.org) "egGHIMpZ"
describe several configuration options that are enabled in Hybrid7. I have added new flags that report
certain options within my modifications. These flags are listed as follows:

C ... CHANNELSPY - Admins see all local users channel join/part information.
W ... RWHOIS_NOTICE - Admins with spy flag see remote whois requests.
A ... ADMINSSEEALLCHANS - Admins see all secret/private channels in /list and /whois.
O ... ADMINOWNAGE - Admins can join any channel regardless of channel's mode.
D ... ADMINKICKEXEMPT - Blocks local users from kicking administrators from channels.
K ... ADMINKILLEXEMPT - Blocks local opers from killing administrators.

Lets give an example. Here is a version request from irc.null.com running Release F
hybrid-7rc6+mpb-rf(20021225_0).: irc.null.com egGHIMpZCWA TS5ow

irc.null.com has enabled the options RWHOIS_NOTICE, ADMINSSEEALLCHANS and CHANNELSPY, as per it's version 
information. This info makes it simple for network admins to enforce network policy for users running this 
mod. It also helps a (knowledgable) user determine wether or not the server in question is a suitable chat 
environment for him.


Config file options added:
operator tree - serverbot = yes/no ... For TCMs/OOMons (configure them to set umode +B)

Hybrid User Modes:
e ... See Channelspy information.
B ... Reserved for TCM/OOmon only (just adds the "server bot" message)

Comstud User Modes:
CHANNELSPY ... See Channelspy information.
SERVERBOT  ... See Serverbot information.


Release History:
Release M - Internal Release (still under works) - April 15th 2003
Several clean up and touch ups to the code base. Nothing major on this part.
Fixed a bug in the ban code that outputted a garbled message to the banned user under certain circumstances.
Changed Setup.sh to output commenting as well to the config.h file, for simpler after editing.

Release L - Internal Release (still under works) - February 20th 2003
+mpb mod changes applied to ircd-hybrid7.0rc9, please view the release notes for hybrid7rc9 to obtain a detailed
	list of changes.
Fixed a major screwup with the allowwildtoplevel option, it works again, my mistake.
Quite a bit of new comments in this release, should help me with porting to future versions.

Release K - Internal Release (still under works) - February 8th 2003
Added the B usermode which is for TCMs and OOMons, adds a message to users doing a whois on them stating that it
        is a server administrative bot.
A great deal of cleanup, and an even greater deal more commenting. I forgot how much I like comments as much
        as I jump around the code (and as frequently as I take breaks from coding alltogether).
Replaced the existance of config.h in default installations, you no longer need to run "OldSetup.sh" in order
	to use the old style setup method (unless you've already run the Setup.sh script, without finishing the
        configuration section of it. Setup.sh removes config.h if it exists in favor of generating a new one).

Release J - Internal Release (still under works) - January 27th 2003
Ported modifications to latest ircd-hybrid-7 release hybrid7-rc8. 
Final cleanup of a few deprecated features.
Several other misc cleanup procedures, primarily temporary stuff.

Release I - Internal Release (still under works) - January 12th 2003
This is primarily a maintenance release, though it's been a bit since i've released a version so might as
        well put out what I have during the dev box transfer.
Config.h is no longer in the default installation of +MPB, however config.h.dist (same file) can be copied in place.
A new setup script was added, which will walk you through the setup process. It's really quite simple, it
        generates a config.h based on replies to the scripts questions, then runs the configure and make steps.
OldSetup.sh was also added, this script restores config.h.dist to the location of config.h, so that initializing
        old-style installation becomes one single step.
ConfSetup.sh is not setup yet, I expect to have this available in the next release.

Release H - Internal Release (still under works) - January 3rd 2003
Modified the contrib m_force.c module to prevent it from being used against Administrators. This function could
        possibly be useful for administrative purposes. The module installs by default now.
Began adding support for +mpb added usermodes in the contrib/m_flags.so "comstud userflags compatability" module.
Moved m_flags.c to the default installation modules directory.
Added code that shows secret channel names in whois surrounded by ()s. In this version, if you whois a user, and
        a channel name similar to the following (@#blah), that means the channel @blah is secret (or private), but 
        only shown to you because of your administrator status.
Trace now shows Administrators as "Root" instead of "Oper".

Release G - Internal Release (still under works) - December 29th 2002
Fixed a problem with CHANNELSPY reporting kicks not pertaining to the local server at all. Limited the
        output of kicks reported to only local users.
Added ADMINKICKEXEMPT functionality. This is experimental and should not be used on a network unless
        the entire network runs this piece of code. The function only works when the kick is executed by a
        local user, and will not try to block remote users from kicking local administrators. This is to 
        make it a little friendlier with servers that do not run this code. Attempting to block remote user
        kicks only causes desync.
Added the D Version Flag to report use of ADMINKICKEXEMPT in version requests.
Added ADMINKILLEXEMPT function. This is highly experimental, but so far looks like it works. It's based
        off the same approach I took with ADMINKICKEXEMPT, and only blocks local opers from killing admins.
        Sort of pointless unless by a whole network.
Added the K Version Flag to report use of ADMINKILLEXEMPT in version requests.

Release F - Internal Release (still under works) - December 27th 2002
Added the "REPORT_ADMINOWNAGE" option to config.h, when enabled hybrid will report (ab)use of functions 
        tied to the ADMINOWNAGE option. Take care not to define REPORT_ADMINOWNAGE without defining 
        ADMINOWNAGE as this will yield unpredictable results.
Added flags to the version module that report what options of mpb mod are enabled. Refer to the new 
        "Version Flags" section of this document for more information.
Renamed spoofed_ipin_whois.c to realipinwhois.c, and show_admin_whois.c to admin_line.c. Made 
        necessary adjustments to modules/Makefile.in
Modified the m_opme.c m_ojoin.c modules to notify local operators when they are used.
Fixed Channelspy, it was broadcasting info to all opers, regardless of user modes.
Added the "e" usermode, Channelspy will now send to opers with the "A" and "e" user modes.

Release E - Internal Release (still under works) - Christmas Day 2002
Fixed an issue with server showing remote user channel parts.
Added the "ALLOWWILDTOPLEVEL" option to config.h, when defined this allows Opers to use wildcards in place 
        of the TLD in the /msg $* mass message command. The entire network you're linked to will need this code
        in place in order to execute a network wide mass message command.
Administrators with the +y flag will now see channel kicks.
Added the "ADMINOWNAGE" option to config.h, when defined this allows Admins to join channels past modes such 
        as bans, limits, keys and invite status.

Release D - Internal Release (still under works) - December 23rd 2002
Option added to config.h to toggle remote whois feature's availability. RWHOIS_NOTICE
Administrators will see all channels a user is in (even secret/private).
Option added to config.h to toggle admins seeing all chans. ADMINSSEEALLCHANS
If CHANNELSPY is defined, Admins with the spy flag will see users join/create/leave channels.

Release C - Internal Release (still under works) - December 21st 2002
Fixed a problem with local admins seeing remote whois requests.
Moved some contrib modules to the core modules directory.
See Spoofed IP in whois added as a new module. spoofed_ipin_whois.c
Moved "Show Admin info in /whois" code into it's own module show_admin_whois.c
Fixed a problem with unspoofed users whois's showing the "user is spoofed" line.

Release B - Internal Release (still under works) - December 21st 2002
All changes from Release A are now implemented to ircd-hybrid-rc6

Release A - Internal Release (still under works) - December 20th 2002
Server admins with umode +a get "user is an IRC Administrator" message in /whois.
Server admins see spoofed users' real ip in /whois.
Opers will see remote /whois's being done on them.
Modified m_opme.c to not check to see if a channel is opless. Also it will no longer broadcast it's use.


Revision File Change History

include/client.h                F,J,K,L
include/channel.h               D,H,J,L,M
include/config.h                D,E,F,G,I,J,L-Deprecated
include/config.h.pre            I,J,L
include/config.h.post           I,J,L
include/config.h.dist           I,J,L
include/numeric.h               A,B,H,J,K,L
include/patchlevel.h            Changed every version.
include/s_conf.h		K,L
src/s_conf.c                    F,J,K,L
src/s_user.c                    F,J,K,L
src/channel.c                   E,F,J,L
src/ircd_lexer.l		K,L
src/ircd_parser.y               F,J,K,L
src/messages.tab                A,B,H,J,K,L
modules/m_join.c                D,F,J,L
modules/m_flags.c               H,J,L
modules/m_whois.c               A,B,C,D,H,J,L
modules/m_version.c             F,G,J,L
modules/m_trace.c               H,J,L
modules/Makefile.in             C,F,H,J,K,L
modules/m_opme.c                A,B,C,J,L
modules/m_ojoin.c               F,J,L
modules/realipinwhois.c         C,F,J,L
modules/admin_line.c            C,F,G,J,L
modules/serverbot.c		K,L
modules/m_force.c               H,J,L
modules/core/m_part.c           D,E,F,J,L
modules/core/m_message.c        E,J,L
modules/core/m_kick.c           F,G,J,L
modules/core/m_kill.c           G,J,L
contrib/Makefile.in             C,H,J,L
doc/mpb.txt                     Changed every version.
Setup.sh                        I,J,M
OldSetup.sh                     I,J
ConfSetup.sh			I,J


To Do:
Before 1.0:
Port all modifications to each new version of ircd-hybrid7 released, at least until 1.0.
Patiently await the arrival of ircd-hybrid7 1.0.
Create diff files and some internal procedure to applying my modifications to a new version of hybrid7.
Commands to allow server administrators manage their server configuration from their IRC client. Commands such as addoper
	and addhub for Server Administrators so they don't have to hit the conf file quite so often.
ConfSetup.sh script to simplify configuration of the ircd config files. This script will also prepare the files
	for the setup needed to work with many of +MPB's enhanced features.
SetHost command for Server Administrators to dynamicly change the hostname of a local user. This command won't change their
	spoof in the configuration, there will be addspoof/delspoof commands for that.
Improve upon the current Setup.sh script more.
More CHANNELSPY functionality. For one thing, some admins would like to be spammed with channel modes too, that'll have 
	to have another flag attached though.

For Feature Versions beyond 1.0:
Implement a more logical gline method, that doesn't require the server it was issued from to be present in order to 
	keep a gline resident.
Setup script will have more options added, and more source files will be generated in response to user input. I have a couple 
	of features in particular in mind with this, such as the ability to compile the modules staticly, and modify the
	source file which acts as the list of modules to compile in during a static compile. Options to include contrib 
	modules in the install will also be added.
Network Administrator status. Users with extended powers beyond Server Administrators. This status will be written
	to have some prestigue to it, as the functionality will need to be enabled network-wide, and the Network Administrator
	will have to be recognized by all hubs. More theory needs to be put into this concept, but it's on the list.
Network Administration Bot - Status for hybserv, this needs alot of looking into still, conceptual and codewise. This
	feature will be required network wide to work.
New channel mode to designate a channel an IRC Operations Channel. This will prevent the use of some +MPB features in it,
	and the channel mode can only be set by a user with a status of Server Administrator or above. This feature will
	obviously be required network wide to work.
Feature to modify part of the hostname of users without a specified spoof. This will leave enough of the mask visible
	for people to add an adequate channel ban, and IRC Administrators will still see their real ip.


Special Thanks:
Matthew Scott - Ideas, Moral Support, UNIX Workspace, Testing Environment
Brent Smith - Ideas, Moral Support, Code Help
John Rowan - Ideas, Code Help
The IRCD Hybrid Team - Love your work guys. =)
The EFNet IRC Network - For showing myself and the world how well Hybrid does its job.
The WFNet IRC Network - For allowing my test code to run.


Contact:
You can contact me either via email or IRC.
I usually live on both irc.vulnerable.org and EFNet as Eblan.
My Email address is mike@vulnerable.org


ircd-hybrid-7 by the IRCD Hybrid Team - http://www.ircd-hybrid.net
Modifications by Michael P. Bramel - http://www.vulnerable.org/mpb
Programming interface provided by FreeBSD - http://www.freebsd.org
