diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/client.h ircd-hybrid-6.0/include/client.h
--- ircd-hybrid-6.0.orig/include/client.h	Sun May 27 19:03:38 2001
+++ ircd-hybrid-6.0/include/client.h	Sun May 27 18:54:46 2001
@@ -333,6 +333,7 @@
 #define FLAGS_BOTS         0x0800 /* shows bots */
 #define FLAGS_EXTERNAL     0x1000 /* show servers introduced */
 /* user information flags, only settable by remote mode or local oper */
+#define FLAGS_IMMUNE       0x2000 /* immune from kick/deop */
 #define FLAGS_OPER         0x4000 /* Operator */
 #define FLAGS_LOCOP        0x8000 /* Local operator -- SRB */
 
@@ -354,6 +355,7 @@
 #define FLAGS2_OPER_K           0x0400  /* oper can kill/kline */
 #define FLAGS2_OPER_DIE         0x0800  /* oper can die */
 #define FLAGS2_OPER_REHASH      0x1000  /* oper can rehash */
+#define FLAGS2_OPER_IMMUNE	0x2000	/* oper can umode m */
 #define FLAGS2_OPER_GOD         0x4000000 /* oper can have an apotheosis */
 #define FLAGS2_OPER_FLAGS       (FLAGS2_OPER_GLOBAL_KILL | \
                                  FLAGS2_OPER_GOD | \
@@ -363,7 +365,8 @@
                                  FLAGS2_OPER_N | \
                                  FLAGS2_OPER_K | \
                                  FLAGS2_OPER_DIE | \
-                                 FLAGS2_OPER_REHASH)
+                                 FLAGS2_OPER_REHASH | \
+                                 FLAGS2_OPER_IMMUNE)
 /* ZIP_LINKS */
 
 #define FLAGS2_ZIP           0x4000  /* (server) link is zipped */
@@ -381,12 +384,13 @@
 #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_IMMUNE)
 #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_GOD)
+                      FLAGS_GOD | FLAGS_IMMUNE)
 
 #ifndef OPER_UMODES
 #define OPER_UMODES  (FLAGS_OPER | FLAGS_WALLOP | FLAGS_SERVNOTICE | \
@@ -445,6 +449,7 @@
 #define SendDebugNotice(x)      ((x)->umodes & FLAGS_DEBUG)
 #define SendNickChange(x)       ((x)->umodes & FLAGS_NCHANGE)
 #define SetWallops(x)           ((x)->umodes |= FLAGS_WALLOP)
+#define IsImmune(x)             ((x)->umodes & FLAGS_IMMUNE)
 
 
 #ifdef REJECT_HOLD
@@ -511,6 +516,8 @@
 #define IsOperDie(x)            ((x)->flags2 & FLAGS2_OPER_DIE)
 #define SetOperRehash(x)        ((x)->flags2 |= FLAGS2_OPER_REHASH)
 #define IsOperRehash(x)         ((x)->flags2 & FLAGS2_OPER_REHASH)
+#define IsSetOperM(x)           ((x)->flags2 & FLAGS2_OPER_IMMUNE)
+#define SetOperM(x)             ((x)->flags2 |= FLAGS2_OPER_IMMUNE)
 #define CBurst(x)               ((x)->flags2 & FLAGS2_CBURST)
 
 /*
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/numeric.h ircd-hybrid-6.0/include/numeric.h
--- ircd-hybrid-6.0.orig/include/numeric.h	Thu Dec 23 07:10:51 1999
+++ ircd-hybrid-6.0/include/numeric.h	Sun May 27 18:54:46 2001
@@ -340,6 +340,7 @@
 #define ERR_CHANOPRIVSNEEDED 482
 #define ERR_CANTKILLSERVER   483
 #define ERR_DESYNC           484
+#define ERR_USERISIMMUNE     485    /* should this be something else? -dt */
 
 #define ERR_NOOPERHOST       491
 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/s_conf.h ircd-hybrid-6.0/include/s_conf.h
--- ircd-hybrid-6.0.orig/include/s_conf.h	Sun May 27 19:03:38 2001
+++ ircd-hybrid-6.0/include/s_conf.h	Sun May 27 18:54:46 2001
@@ -327,6 +327,7 @@
 #define CONF_OPER_K          32
 #define CONF_OPER_REHASH     64
 #define CONF_OPER_DIE       128
+#define CONF_OPER_M         256
 #define CONF_OPER_GOD      2048
 
 typedef struct
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/channel.c ircd-hybrid-6.0/src/channel.c
--- ircd-hybrid-6.0.orig/src/channel.c	Sun May 27 19:03:39 2001
+++ ircd-hybrid-6.0/src/channel.c	Sun May 27 18:54:46 2001
@@ -1350,7 +1350,17 @@
                            sptr->name, chptr->chname);
               break;
             }
-        
+
+          /* Immune users */
+          if ((c == 'o') && whatt == MODE_DEL && !IsPrivileged(sptr)
+              && IsImmune(who))
+            {
+              sendto_one(sptr, form_str(ERR_USERISIMMUNE),
+                         me.name, sptr->name,
+                         who->name, chptr->chname);
+              break;
+            }
+
           tmp = strlen(arg);
           if (len + tmp + 2 >= MODEBUFLEN)
             break;
@@ -3596,6 +3606,14 @@
 
   if (IsMember(who, chptr))
     {
+      /* Immune users */
+      if( !IsPrivileged(sptr) && IsImmune(who) )
+        {
+          sendto_one(sptr, form_str(ERR_USERISIMMUNE),
+                     me.name, parv[0], user, name);
+          return(0);
+        }
+
 #ifdef HIDE_OPS
       sendto_channel_chanops_butserv(chptr, sptr,
                              ":%s KICK %s %s :%s", parv[0],
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_oper.c ircd-hybrid-6.0/src/m_oper.c
--- ircd-hybrid-6.0.orig/src/m_oper.c	Sun May 27 19:03:38 2001
+++ ircd-hybrid-6.0/src/m_oper.c	Sun May 27 18:54:46 2001
@@ -202,6 +202,8 @@
                 sptr->umodes &= ~FLAGS_NCHANGE;
               if( !IsSetOperGod(sptr) )
                 sptr->umodes &= ~FLAGS_GOD;
+              if( !IsSetOperM(sptr) )
+                sptr->umodes &= ~FLAGS_IMMUNE;
               
               sendto_one(sptr, ":%s NOTICE %s :*** Oper flags set from conf",
                          me.name,parv[0]);
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/messages.tab ircd-hybrid-6.0/src/messages.tab
--- ircd-hybrid-6.0.orig/src/messages.tab	Sun Dec 31 00:12:01 2000
+++ ircd-hybrid-6.0/src/messages.tab	Sun May 27 18:54:46 2001
@@ -527,7 +527,7 @@
 /* 482 ERR_CHANOPRIVSNEEDED, */ ":%s 482 %s %s :You're not channel operator",
 /* 483 ERR_CANTKILLSERVER, */   ":%s 483 %s :You can't kill a server!",
 /* 484 */       (char *)NULL,
-/* 485 */       (char *)NULL,
+/* 485 ERR_USERISIMMUNE, */     ":%s 485 %s %s %s :User is immune from kick/deop",
 /* 486 */       (char *)NULL,
 /* 487 */       (char *)NULL,
 /* 488 */       (char *)NULL,
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/messages_cust.tab ircd-hybrid-6.0/src/messages_cust.tab
--- ircd-hybrid-6.0.orig/src/messages_cust.tab	Sun May 27 19:03:37 2001
+++ ircd-hybrid-6.0/src/messages_cust.tab	Sun May 27 18:54:46 2001
@@ -28,7 +28,7 @@
 /* 001  RPL_WELCOME, */ ":%s 001 %s :Welcome to the Internet Relay Network %s",
 /* 002  RPL_YOURHOST,*/ ":%s 002 %s :Your host is %s, running version %s",
 /* 003  RPL_CREATED, */ ":%s 003 %s :This server was cobbled together %s",
-/* 004  RPL_MYINFO, */ ":%s 004 %s %s %s oiwszcrkfydnxb biklmnopstved",
+/* 004  RPL_MYINFO, */ ":%s 004 %s %s %s oiwszcrkfydnxbm biklmnopstved",
 /* 005 */       (char *)NULL,
 /* 006 */       (char *)NULL,
 /* 007 */       (char *)NULL,
@@ -528,7 +528,7 @@
 /* 482 ERR_CHANOPRIVSNEEDED, */ ":%s 482 %s %s :You need to be an operator to do that",
 /* 483 ERR_CANTKILLSERVER, */    ":%s 483 %s :You can't actually kill an IRC server that way.",
 /* 484 */       (char *)NULL,
-/* 485 */       (char *)NULL,
+/* 485 ERR_USERISIMMUNE, */     ":%s 485 %s %s %s :User is immune from kick/deop",
 /* 486 */       (char *)NULL,
 /* 487 */       (char *)NULL,
 /* 488 */       (char *)NULL,
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/s_conf.c ircd-hybrid-6.0/src/s_conf.c
--- ircd-hybrid-6.0.orig/src/s_conf.c	Sun May 27 19:03:38 2001
+++ ircd-hybrid-6.0/src/s_conf.c	Sun May 27 18:54:46 2001
@@ -2977,8 +2977,14 @@
         int_privs |= CONF_OPER_DIE;         /* allow die */
       else if(*privs == 'd')
         int_privs &= ~CONF_OPER_DIE;        /* disallow die */
+      else if(*privs == 'M')
+        int_privs |= CONF_OPER_M;           /* allow immunity */
+      else if(*privs == 'm')
+        int_privs &= ~CONF_OPER_M;          /* disallow immunity */
+
       privs++;
     }
+
   return(int_privs);
 }
 
@@ -3018,6 +3024,15 @@
   else
     *privs_ptr++ = 'k';
 
+  if(port & CONF_OPER_M)
+    {
+      if(cptr)
+        SetOperM(cptr);
+      *privs_ptr++ = 'M';
+    }
+  else
+    *privs_ptr++ = 'm';
+  
   if(port & CONF_OPER_N)
     {
       if(cptr)
@@ -3124,6 +3139,8 @@
         int_flags |= FLAGS_DEBUG;
       else if(*flags == 'n')
         int_flags |= FLAGS_NCHANGE;
+      else if(*flags == 'm')
+        int_flags |= FLAGS_IMMUNE;
       flags++;
     }
 
@@ -3171,6 +3188,8 @@
     *flags_ptr++ = 'd';
   if(flags & FLAGS_NCHANGE)
     *flags_ptr++ = 'n';
+  if(flags & FLAGS_IMMUNE)
+    *flags_ptr++ = 'm';
   *flags_ptr = '\0';
 
   return(flags_out);
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/s_user.c ircd-hybrid-6.0/src/s_user.c
--- ircd-hybrid-6.0.orig/src/s_user.c	Sun May 27 19:03:39 2001
+++ ircd-hybrid-6.0/src/s_user.c	Sun May 27 19:03:23 2001
@@ -86,6 +86,7 @@
   {FLAGS_FULL,  'f'},
   {FLAGS_INVISIBLE, 'i'},
   {FLAGS_SKILL, 'k'},
+  {FLAGS_IMMUNE, 'm'},
   {FLAGS_NCHANGE, 'n'},
   {FLAGS_OPER, 'o'},
   {FLAGS_LOCOP, 'O'},
@@ -150,7 +151,7 @@
   0,            /* j */
   FLAGS_SKILL,  /* k */
   0,            /* l */
-  0,            /* m */
+  FLAGS_IMMUNE, /* m */
   FLAGS_NCHANGE, /* n */
   FLAGS_OPER,   /* o */
 #ifdef GODOPERS
@@ -2016,6 +2017,10 @@
                             if (IsSetOperN(sptr))
                               *(m2++) = *m;
                             break;
+                          case FLAGS_IMMUNE:
+                            if (IsSetOperM(sptr))
+                              *(m2++) = *m;
+                            break;
 #ifdef GODOPERS
 			  case FLAGS_GOD:
 			    if (IsSetOperGod(sptr))
@@ -2137,7 +2142,8 @@
 #ifdef GODOPERS
   			            FLAGS2_OPER_GOD|
 #endif
-                                    FLAGS2_OPER_K);
+                                    FLAGS2_OPER_K|
+                                    FLAGS2_OPER_IMMUNE);
                   while(cur_cptr)
                     {
                       if(acptr == cur_cptr) 
@@ -2189,6 +2195,15 @@
       sendto_one(sptr,":%s NOTICE %s :*** You need oper and N flag for +n",
                  me.name,parv[0]);
       acptr->umodes &= ~FLAGS_NCHANGE; /* only tcm's really need this */
+    }
+
+  if ((acptr->umodes & FLAGS_IMMUNE) && !IsSetOperM(sptr) && MyClient(sptr) && !IsServer(cptr))
+    {
+      sendto_one(sptr,":%s NOTICE %s :*** You need oper and M flag for +m",
+                 me.name,parv[0]);
+      acptr->umodes &= ~FLAGS_IMMUNE; /* only services really need this,
+                                        though it could be useful for
+                                        opers once in a while */
     }
 
 #ifdef GODOPERS
