repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 6667bb6b772a05cb0327ddae23f1f72ceb194ef1:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 6667bb6b772a05cb0327ddae23f1f72ceb194ef1
Author: Alexander Barton 
Date:   Wed Feb 4 19:56:04 2004 +0000

    The info text ("real name") of users is set to "-" if none has been
    specified using the USER command (e. g. "USER user * * :"). Reason:
    the original ircd doesn't like empty ones and would KILL such users.

diff --git a/ChangeLog b/ChangeLog
index 10b6ee71e90bae4d2f2a42023ea1ebc02d52def3..
index ..9acfc8aeae185a9bda84565c6b5ec291d8fcc50c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@

 ngIRCd CVSHEAD

+  - The info text ("real name") of users is set to "-" if none has been
+    specified using the USER command (e. g. "USER user * * :"). Reason:
+    the original ircd doesn't like empty ones and would KILL such users.
   - Fixed (optional) TCP Wrapper test which was broken and could result in
     false results. Thanks to Fuminori Tanizaki !
   - The type of service (TOS) of all sockets is set to "interactive" now.
@@ -495,4 +498,4 @@ ngIRCd 0.0.1, 31.12.2001


 -- 
-$Id: ChangeLog,v 1.224 2004/02/03 20:28:30 alex Exp $
+$Id: ChangeLog,v 1.225 2004/02/04 19:56:04 alex Exp $
diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c
index 185dd1246ac868d8255506c115be9023b30af9f9..
index ..6f9ab92b20a7e55efda1c6c29c8349fa7eae67a7 100644
--- a/src/ngircd/irc-login.c
+++ b/src/ngircd/irc-login.c
@@ -14,7 +14,7 @@

 #include "portab.h"

-static char UNUSED id[] = "$Id: irc-login.c,v 1.38 2004/01/17 03:17:49 alex Exp $";
+static char UNUSED id[] = "$Id: irc-login.c,v 1.39 2004/02/04 19:56:05 alex Exp $";

 #include "imp.h"
 #include 
@@ -299,15 +299,21 @@ IRC_USER( CLIENT *Client, REQUEST *Req )
 	if( Client_Type( Client ) == CLIENT_GOTNICK || Client_Type( Client ) == CLIENT_GOTPASS )
 #endif
 	{
-		/* Falsche Anzahl Parameter? */
+		/* Wrong number of parameters? */
 		if( Req->argc != 4 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );

+		/* User name */
 #ifdef IDENTAUTH
 		ptr = Client_User( Client );
-		if( ! ptr || ! *ptr || *ptr == '~' )
-#endif
+		if( ! ptr || ! *ptr || *ptr == '~' ) Client_SetUser( Client, Req->argv[0], FALSE );
+#else
 		Client_SetUser( Client, Req->argv[0], FALSE );
-		Client_SetInfo( Client, Req->argv[3] );
+#endif
+
+		/* "Real name" or user info text: Don't set it to the empty string, the original ircd
+		 * can't deal with such "real names" (e. g. "USER user * * :") ... */
+		if( *Req->argv[3] ) Client_SetInfo( Client, Req->argv[3] );
+		else Client_SetInfo( Client, "-" );

 		Log( LOG_DEBUG, "Connection %d: got valid USER command ...", Client_Conn( Client ));
 		if( Client_Type( Client ) == CLIENT_GOTNICK ) return Hello_User( Client );

-----END OF PAGE-----