diff -urN Unreal-devel/autoconf/configure.in Unreal-devel-mod/autoconf/configure.in
--- Unreal-devel/autoconf/configure.in	2004-11-15 19:10:04.166444960 +0100
+++ Unreal-devel-mod/autoconf/configure.in	2004-11-15 19:10:37.520374392 +0100
@@ -336,6 +336,11 @@
 AC_DEFINE_UNQUOTED(SPATH,"$withval") BINDIR="$withval",AC_DEFINE_UNQUOTED(SPATH,"`pwd`/src/ircd") BINDIR="`pwd`/src/ircd")
 AC_ARG_ENABLE(nospoof, [AC_HELP_STRING([--enable-nospoof],[Enable spoofing protection])], AC_DEFINE(NOSPOOF))
 AC_ARG_ENABLE(prefixaq, [AC_HELP_STRING([--enable-prefixaq],[Enable chanadmin and chanowner prefixes])], AC_DEFINE(PREFIX_AQ))
+AC_ARG_ENABLE(nickindep-auth, [AC_HELP_STRING([--enable-nickindep-auth],[Support for account names in WHOIS using SVSACC])], [NICKINDEP_AUTH="1"], [NICKINDEP_AUTH=""])
+if [[ "x$NICKINDEP_AUTH" == "x1" ]] ; then
+	AC_DEFINE(SUPPORT_NICKINDEP_AUTH)
+fi
+AC_SUBST(NICKINDEP_AUTH)
 AC_ARG_ENABLE(hub, [AC_HELP_STRING([--enable-hub],[Compile as a hub server])], AC_DEFINE(HUB))
 AC_ARG_WITH(showlistmodes, [AC_HELP_STRING([--with-showlistmodes], [Specify whether modes are shown in /list])],
 	AC_DEFINE(LIST_SHOW_MODES))
diff -urN Unreal-devel/Config Unreal-devel-mod/Config
--- Unreal-devel/Config	2004-11-15 19:14:53.518456768 +0100
+++ Unreal-devel-mod/Config	2004-11-15 19:15:28.326165192 +0100
@@ -70,6 +70,9 @@
 if [ "$PREFIXAQ" = "1" ]; then
 ARG="$ARG--enable-prefixaq "
 fi
+if [ "$NICKINDEP_AUTH" = "1" ]; then
+ARG="$ARG--enable-nickindep-auth "
+fi
 ARG="$ARG--with-listen=$LISTEN_SIZE "
 ARG="$ARG--with-dpath=$DPATH "
 ARG="$ARG--with-spath=$SPATH "
@@ -295,6 +298,7 @@
 REMOTEINC=""
 CURLDIR=""
 PREFIXAQ=""
+NICKINDEP_AUTH=""
 SHOWLISTMODES="1"
 TOPICNICKISNUH=""
 SHUNNOTICES=""
@@ -686,6 +690,38 @@
     esac
 done
 
+TEST=""
+while [ -z "$TEST" ] ; do
+	if [ "$NICKINDEP_AUTH" = "1" ] ; then
+		TEST="Yes"
+	else
+		TEST="No"
+	fi
+	echo ""
+	echo "Do you want to enable the SVSACC command for services with"
+	echo "nick-independent account handling? Your services will beable to"
+	echo "display the account name in /WHOIS then."
+	echo "It doesn't change the behaviour of your ircd if SVSACC isn't used."
+	echo "This feature should be enabled/disabled network-wide."
+	echo $n "[$TEST] -> $c"
+		read cc
+	if [ -z "$cc" ] ; then
+		cc=$TEST
+	fi
+	case "$cc" in
+		[Yy]*)
+			NICKINDEP_AUTH="1"
+			;;
+		[Nn]*)
+			NICKINDEP_AUTH=""
+			;;
+		*)
+			echo ""
+			echo "You must enter either Yes or No"
+			TEST=""
+			;;
+	esac
+done
 
 TEST=""
 while [ -z "$TEST" ] ; do
@@ -822,6 +858,7 @@
 SPATH="$SPATH"
 INET6="$INET6"
 PREFIXAQ="$PREFIXAQ"
+NICKINDEP_AUTH="$NICKINDEP_AUTH"
 LISTEN_SIZE="$LISTEN_SIZE"
 MAXSENDQLENGTH="$MAXSENDQLENGTH"
 BUFFERPOOL="$BUFFERPOOL"
diff -urN Unreal-devel/include/msg.h Unreal-devel-mod/include/msg.h
--- Unreal-devel/include/msg.h	2004-11-15 19:10:04.426405440 +0100
+++ Unreal-devel-mod/include/msg.h	2004-11-15 19:10:37.528373176 +0100
@@ -289,7 +289,7 @@
 
 #define MSG_MODULE	"MODULE"
 #define TOK_MODULE	"BQ"
-/* BR and BT are in use */
+/* BR, BT and BU are in use */
 
 #define MSG_SENDSNO	"SENDSNO"
 #define TOK_SENDSNO	"Ss"
diff -urN Unreal-devel/include/numeric.h Unreal-devel-mod/include/numeric.h
--- Unreal-devel/include/numeric.h	2004-11-15 19:10:04.427405288 +0100
+++ Unreal-devel-mod/include/numeric.h	2004-11-15 19:10:37.529373024 +0100
@@ -178,6 +178,7 @@
 #define RPL_LISTEND          323
 #define RPL_CHANNELMODEIS    324
 #define RPL_CREATIONTIME     329
+#define RPL_WHOISAUTH        330
 #define RPL_NOTOPIC          331
 #define RPL_TOPIC            332
 #define RPL_TOPICWHOTIME     333
diff -urN Unreal-devel/include/struct.h Unreal-devel-mod/include/struct.h
--- Unreal-devel/include/struct.h	2004-11-15 19:10:04.434404224 +0100
+++ Unreal-devel-mod/include/struct.h	2004-11-15 19:10:37.530372872 +0100
@@ -745,6 +745,9 @@
 		unsigned char away_c;	/* number of times away has been set */
 #endif
 	} flood;
+#ifdef SUPPORT_NICKINDEP_AUTH
+	char *account;
+#endif
 };
 
 struct Server {
diff -urN Unreal-devel/src/modules/l_commands.c Unreal-devel-mod/src/modules/l_commands.c
--- Unreal-devel/src/modules/l_commands.c	2004-11-15 19:10:04.556385680 +0100
+++ Unreal-devel-mod/src/modules/l_commands.c	2004-11-15 19:10:37.530372872 +0100
@@ -119,6 +119,9 @@
 #ifdef GUEST
 extern int m_guest_Init(ModuleInfo *modinfo);
 #endif
+#ifdef SUPPORT_NICKINDEP_AUTH
+extern int m_svsacc_Init(ModuleInfo *modinfo);
+#endif
 
 extern int m_sethost_Load(int module_load), m_setname_Load(int module_load), m_chghost_Load(int module_load);
 extern int m_chgident_Load(int module_load), m_setident_Load(int module_load), m_sdesc_Load(int module_load);
@@ -161,6 +164,9 @@
 #ifdef GUEST
 extern int m_guest_Load(int module_load);
 #endif
+#ifdef SUPPORT_NICKINDEP_AUTH
+extern int m_svsacc_Load(int module_load);
+#endif
 
 extern int m_sethost_Unload(), m_setname_Unload(), m_chghost_Unload(), m_chgident_Unload();
 extern int m_setident_Unload(), m_sdesc_Unload(), m_svsmode_Unload(), m_swhois_Unload();
@@ -192,6 +198,9 @@
 #ifdef GUEST
 extern int m_guest_Unload();
 #endif
+#ifdef SUPPORT_NICKINDEP_AUTH
+extern int m_svsacc_Load(int module_load);
+#endif
 
 #ifdef DYNAMIC_LINKING
 DLLFUNC int Mod_Test(ModuleInfo *modinfo)
@@ -314,6 +323,9 @@
 #ifdef GUEST
 	m_guest_Init(ModCmdsInfo);
 #endif
+#ifdef SUPPORT_NICKINDEP_AUTH
+	m_svsacc_Init(ModCmdsInfo);
+#endif
 	MARK_AS_OFFICIAL_MODULE(modinfo);
 	return MOD_SUCCESS;
 }
@@ -415,6 +427,9 @@
 #ifdef GUEST
 	m_guest_Load(module_load);
 #endif
+#ifdef SUPPORT_NICKINDEP_AUTH
+	m_svsacc_Load(module_load);
+#endif
 	return MOD_SUCCESS;
 }
 
@@ -516,6 +531,9 @@
 #ifdef GUEST
 	m_guest_Unload();
 #endif
+#ifdef SUPPORT_NICKINDEP_AUTH
+	m_svsacc_Unload();
+#endif
 	return MOD_SUCCESS;
 }
 
diff -urN Unreal-devel/src/modules/Makefile.in Unreal-devel-mod/src/modules/Makefile.in
--- Unreal-devel/src/modules/Makefile.in	2004-11-15 19:10:04.557385528 +0100
+++ Unreal-devel-mod/src/modules/Makefile.in	2004-11-15 19:10:37.531372720 +0100
@@ -48,6 +48,10 @@
 	 m_svsfline.so m_dccdeny.so m_undccdeny.so m_whowas.so \
 	 m_connect.so m_dccallow.so m_userip.so cloak.so oldcloak.so
 
+ifeq (x@NICKINDEP_AUTH@,x1)
+R_MODULES=${R_MODULES} m_svsacc.so
+endif
+
 #note change of .c to .o
 COMMANDS=m_sethost.o m_chghost.o m_chgident.o m_setname.o m_setident.o \
 	 m_sdesc.o m_svsmode.o m_swhois.o m_svsmotd.o m_svsnline.o \
@@ -68,6 +72,9 @@
 	 m_svsfline.o m_dccdeny.o m_undccdeny.o m_whowas.o \
 	 m_connect.o m_dccallow.o m_userip.o
 
+ifeq (x@NICKINDEP_AUTH@,x1)
+COMMANDS=${COMMANDS} m_svsacc.so
+endif
 
 MODULES=commands.so $(R_MODULES)
 MODULEFLAGS=@MODULEFLAGS@
@@ -358,6 +365,9 @@
 m_userip.o: m_userip.c $(INCLUDES)
 	$(CC) $(CFLAGS) $(MODULEFLAGS)  -c m_userip.c
 
+m_svsacc.o: m_svsacc.c $(INCLUDES)
+	$(CC) $(CFLAGS) $(MODULEFLAGS)  -c m_svsacc.c
+
 #############################################################################
 #             .so's section
 #############################################################################
@@ -722,6 +732,10 @@
 	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
 	       -o m_userip.so m_userip.c
 
+m_svsacc.so: m_svsacc.c $(INCLUDES)
+	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
+	      -o m_svsacc.so m_svsacc.c
+
 #############################################################################
 #             and now the remaining modules...
 #############################################################################
diff -urN Unreal-devel/src/modules/m_svsacc.c Unreal-devel-mod/src/modules/m_svsacc.c
--- Unreal-devel/src/modules/m_svsacc.c	1970-01-01 01:00:00.000000000 +0100
+++ Unreal-devel-mod/src/modules/m_svsacc.c	2004-11-15 19:10:37.531372720 +0100
@@ -0,0 +1,125 @@
+/*
+ *   IRC - Internet Relay Chat, src/modules/m_setident.c
+ *   (C) 1999-2001 Carsten Munk (Techie/Stskeeps) <stskeeps@tspre.org>
+ *
+ *   See file AUTHORS in IRC package for additional names of
+ *   the programmers. 
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include "config.h"
+#include "struct.h"
+#include "common.h"
+#include "sys.h"
+#include "numeric.h"
+#include "msg.h"
+#include "channel.h"
+#include <time.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef _WIN32
+#include <io.h>
+#endif
+#include <fcntl.h>
+#include "h.h"
+#include "proto.h"
+#ifdef STRIPBADWORDS
+#include "badwords.h"
+#endif
+#ifdef _WIN32
+#include "version.h"
+#endif
+
+/* Derived from m_chgident.c */
+
+#define MSG_SVSACC 	"SVSACC"
+#define	TOK_SVSACC	"BU"
+
+DLLFUNC int m_svsacc(aClient *cptr, aClient *sptr, int parc, char *parv[]);
+
+ModuleHeader MOD_HEADER(m_svsacc)
+  = {
+	"svsacc",	/* Name of module */
+	"$Id: m_svsacc.c,v 1.1.2.20 2003/11/11 20:20:22 syzop Exp $", /* Version */
+	"/svsacc", /* Short description of module */
+	"3.2-cvs-devel", /* You'd probably have to replace */
+	NULL 
+    };
+
+DLLFUNC int MOD_INIT(m_svsacc)(ModuleInfo *modinfo)
+{
+	/*
+	 * We call our add_Command crap here
+	*/
+	add_Command(MSG_SVSACC, TOK_SVSACC, m_svsacc, MAXPARA);
+	MARK_AS_OFFICIAL_MODULE(modinfo);
+	return MOD_SUCCESS;
+}
+
+DLLFUNC int MOD_LOAD(m_svsacc)(int module_load)
+{
+	return MOD_SUCCESS;
+}
+
+DLLFUNC int MOD_UNLOAD(m_svsacc)(int module_unload)
+{
+	if (del_Command(MSG_SVSACC, TOK_SVSACC, m_svsacc) < 0)
+	{
+		sendto_realops("Failed to delete commands when unloading %s",
+				MOD_HEADER(m_svsacc).name);
+	}
+	return MOD_SUCCESS;
+}
+
+/* m_svsacc - 15/11/2004 - Fips
+ *  :prefix SETIDENT newaccount
+ *  parv[0] - sender
+ *  parv[1] - nickname of subject
+ *  parv[2] - 
+ *  D: Will change subject's account name to newaccount & set it registered
+ *     (for services; shows up in /WHOIS)
+*/
+
+DLLFUNC int m_svsacc(aClient *cptr, aClient *sptr, int parc, char *parv[])
+{
+	if (MyConnect(sptr) && !IsULine(sptr))
+	{
+		sendto_one(sptr, ":%s NOTICE %s :You aren't allowed to do this.", me.name, sptr->name);
+		return 0;
+	}
+	if (parc < 3)
+	{
+		sendto_one(sptr, ":%s NOTICE %s :SVSACC Syntax: SVSACC nick account-name", me.name, sptr->name);
+		return 0;
+	}
+	aClient *subject;
+	if (!(0 < strlen(parv[1]) < NICKLEN) || !(subject = find_person(parv[1])) || !subject->user)
+	{
+		/* The jungle of send.c... let's hope this works */
+		sendto_one(sptr, ":%s NOTICE %s :No such user.", me.name, sptr->name);
+		return 0;
+	}
+	
+	/* No check, 'cause services shouldn't put crap to us, should they? */
+	subject->umodes |= UMODE_REGNICK;
+	ircsprintf(subject->user->account, "%s", parv[2]);
+
+	sendto_serv_butone_token(cptr, sptr->name, MSG_SVSACC, TOK_SVSACC, "%s :%s", subject->name, parv[2]);
+	
+	return 0;
+}
+
diff -urN Unreal-devel/src/modules/m_whois.c Unreal-devel-mod/src/modules/m_whois.c
--- Unreal-devel/src/modules/m_whois.c	2004-11-15 19:10:04.628374736 +0100
+++ Unreal-devel-mod/src/modules/m_whois.c	2004-11-15 19:10:37.532372568 +0100
@@ -193,7 +193,14 @@
 			}
 
 			if (IsARegNick(acptr))
+			{
+#ifdef SUPPORT_NICKINDEP_AUTH
+				if (user->account)
+					sendto_one(sptr, rpl_str(RPL_WHOISAUTH), me.name, parv[0], user->account);
+				else
+#endif
 				sendto_one(sptr, rpl_str(RPL_WHOISREGNICK), me.name, parv[0], name);
+			}
 			
 			found = 1;
 			mlen = strlen(me.name) + strlen(parv[0]) + 10 + strlen(name);
@@ -271,7 +278,6 @@
 				sendto_one(sptr, rpl_str(RPL_WHOISSERVER),
 				    me.name, parv[0], name, user->server,
 				    a2cptr ? a2cptr->info : "*Not On This Net*");
-
 			if (user->away)
 				sendto_one(sptr, rpl_str(RPL_AWAY), me.name,
 				    parv[0], name, user->away);
diff -urN Unreal-devel/src/s_err.c Unreal-devel-mod/src/s_err.c
--- Unreal-devel/src/s_err.c	2004-11-15 19:10:04.629374584 +0100
+++ Unreal-devel-mod/src/s_err.c	2004-11-15 19:10:37.532372568 +0100
@@ -367,7 +367,7 @@
 /* 327 */ NULL, /* Used */
 /* 328 */ NULL, /* bahamut, austhex */
 /* 329    RPL_CREATIONTIME */ ":%s 329 %s %s %lu",
-/* 330 */ NULL, /* Used */
+/* 330    RPL_WHOISAUTH */ "%s 330 %s %s %s :is authenticated as",
 /* 331    RPL_NOTOPIC */ ":%s 331 %s %s :No topic is set.",
 /* 332    RPL_TOPIC */ ":%s 332 %s %s :%s",
 /* 333    RPL_TOPICWHOTIME */ ":%s 333 %s %s %s %lu",
diff -urN Unreal-devel/src/s_user.c Unreal-devel-mod/src/s_user.c
--- Unreal-devel/src/s_user.c	2004-11-15 19:10:04.638373216 +0100
+++ Unreal-devel-mod/src/s_user.c	2004-11-15 19:10:37.594363144 +0100
@@ -1014,6 +1014,9 @@
 		sptr->srvptr->serv->users++;
 	user->virthost =
 	    (char *)make_virthost(user->realhost, user->virthost, 1);
+#ifdef SUPPORT_USERINDEP_ACC
+	user->account = NULL; // If someone sets +r but doesn't set user->account... avoid a dilemma :-)
+#endif
 	if (MyConnect(sptr))
 	{
 		IRCstats.unknown--;
