diff -urN bahamut-release/doc/reference.conf 
operhost-bahamut/doc/reference.conf
--- bahamut-release/doc/reference.conf	Fri Feb 25 17:24:14 2005
+++ operhost-bahamut/doc/reference.conf	Wed Mar 30 02:01:03 2005
@@ -450,6 +450,7 @@
 
     // optional tokens
     class   opers;          # Place authenticated client in this class
+    operhost johndoe.my.net;  # Give this oper his own operhostmasking 
host
 };
 
 # The name and passwd tokens match the parameters of the OPER command.  
If
diff -urN bahamut-release/include/confparse.h 
operhost-bahamut/include/confparse.h
--- bahamut-release/include/confparse.h	Wed Oct 13 04:26:07 2004
+++ operhost-bahamut/include/confparse.h	Wed Mar 30 01:42:44 2005
@@ -110,6 +110,9 @@
 #define SCONFF_MASK                 0x100000
 #define SCONFT_IPMASK   "IPMASK"
 #define SCONFF_IPMASK               0x200000
+#define SCONFT_OPERHOST "OPERHOST"
+#define SCONFF_OPERHOST             0x400000
+
 
 #define SCONFF_STRING               0x800000    /* allow freeform strings 
*/
 
@@ -250,6 +253,7 @@
     {SCONFT_PASSWD, SCONFF_PASSWD, VARTYPE_NAME},
     {SCONFT_ACCESS, SCONFF_ACCESS, VARTYPE_NAME},
     {SCONFT_CLASS, SCONFF_CLASS, VARTYPE_NAME},
+    {SCONFT_OPERHOST, SCONFF_OPERHOST, VARTYPE_NAME},
     {(char *) 0, 0, 0}
 };
 
diff -urN bahamut-release/include/patchlevel.h 
operhost-bahamut/include/patchlevel.h
--- bahamut-release/include/patchlevel.h	Fri Oct  8 06:06:34 2004
+++ operhost-bahamut/include/patchlevel.h	Wed Mar 30 02:07:46 2005
@@ -33,7 +33,7 @@
 #define MINOR 8
 #define PATCH 3
 
-#define PATCHES ""
+#define PATCHES "+operhost"
 
 void build_version(void);
 
diff -urN bahamut-release/include/struct.h 
operhost-bahamut/include/struct.h
--- bahamut-release/include/struct.h	Fri Feb 25 17:24:14 2005
+++ operhost-bahamut/include/struct.h	Wed Mar 30 01:44:20 2005
@@ -719,6 +719,7 @@
     int   opers;    /* number of opers currently using this */
     char *class_name;
 	aClass *class;
+	char *operhost;
 	aOper *next;
 };
 
diff -urN bahamut-release/src/s_conf.c operhost-bahamut/src/s_conf.c
--- bahamut-release/src/s_conf.c	Fri Feb 25 17:24:15 2005
+++ operhost-bahamut/src/s_conf.c	Wed Mar 30 01:49:26 2005
@@ -169,6 +169,7 @@
     MyFree(ptr->passwd);
     MyFree(ptr->nick);
     MyFree(ptr->class_name);
+    MyFree(ptr->operhost);
     MyFree(ptr);
     return;
 }
@@ -671,6 +672,17 @@
             tmp->type = NULL;
             DupString(x->class_name, tmp->value);
         }
+        else if(tmp->type && (tmp->type->flag & SCONFF_OPERHOST))
+        {
+            if(x->operhost)
+            {
+                confparse_error("Multiple operhost definitions", lnum);
+                free_oper(x);
+                return -1;
+            }
+            tmp->type = NULL;
+            DupString(x->operhost, tmp->value);
+        }
     }
     if(!x->nick)
     {
@@ -1929,6 +1941,13 @@
             old_oper->class->refs++;
             old_oper->flags = aoper->flags;
             old_oper->legal = 1;
+
+           MyFree(old_oper->operhost);
+           if (aoper->operhost)
+               DupString(old_oper->operhost, aoper->operhost);
+           else
+               old_oper->operhost = NULL;
+
 
             MyFree(aoper->nick);
             MyFree(aoper);
diff -urN bahamut-release/src/s_user.c operhost-bahamut/src/s_user.c
--- bahamut-release/src/s_user.c	Mon Feb 28 17:08:00 2005
+++ operhost-bahamut/src/s_user.c	Wed Mar 30 03:48:09 2005
@@ -366,7 +366,7 @@
 }
 
 #if (RIDICULOUS_PARANOIA_LEVEL>=1)
-static int
+static char *
 check_oper_can_mask(aClient *sptr, char *name, char *password, char 
**onick)
 {
     aOper *aoper;
@@ -379,7 +379,7 @@
         sendto_realops("Failed OPERMASK attempt by %s (%s@%s) [No Entry 
for "
                        "%s]", sptr->name, sptr->user->username,
                        sptr->user->host, name);
-        return 0;
+        return NULL;
     }
 
     /* use first two chars of the password they send in as salt */
@@ -403,13 +403,13 @@
         *onick = aoper->nick;
         sendto_realops("%s [%s] (%s@<hidden>) has masked their 
hostname.",
                        sptr->name, aoper->nick, sptr->user->username);
-        return 1;
+        return (aoper->operhost ? aoper->operhost : Staff_Address);
     }
 
     sendto_realops("Failed OPERMASK attempt by %s (%s@%s) [Bad 
Password]",
                    sptr->name, sptr->user->username, sptr->user->host);
 
-    return 0;
+    return NULL;
 }
 #endif
 
@@ -920,6 +920,7 @@
                 char *opptr;
                 char *onick;
                 char *tmpptr;
+		char *ohost;
                 char tmppwd[PASSWDLEN + 1];
                 
                 if(!(opptr = strchr(onptr, ':')))
@@ -928,7 +929,7 @@
                 *opptr++ = '\0';
                 if((tmpptr = strchr(opptr, ':')))
                     *tmpptr++ = '\0';
-                if(check_oper_can_mask(sptr, onptr, opptr, &onick) != 0)
+                if((ohost = check_oper_can_mask(sptr, onptr, opptr, 
&onick)) != NULL)
                 {
                     sendto_one(sptr, ":%s NOTICE %s :*** Your hostname 
has "
                                "been masked.",
@@ -948,13 +949,13 @@
                     strcpy(sptr->user->real_oper_host, sptr->user->host);
                     strcpy(sptr->user->real_oper_username, 
sptr->user->username);
                     strcpy(sptr->user->real_oper_ip, sptr->hostip);
-                    strncpyzt(sptr->user->host, Staff_Address, HOSTLEN + 
1);
+                    strncpyzt(sptr->user->host, ohost, HOSTLEN + 1);
                     strncpyzt(sptr->user->username, onick, USERLEN + 1);
                     strncpyzt(sptr->username, onick, USERLEN + 1);
                     sptr->flags |= FLAGS_GOTID; /* fake ident */
                     sptr->ip.s_addr = 0;
                     strcpy(sptr->hostip, "0.0.0.0");
-                    strncpy(sptr->sockhost, Staff_Address, HOSTLEN + 1);
+                    strncpy(sptr->sockhost, ohost, HOSTLEN + 1);
                 }
 
                 if(tmpptr)

