]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-login.c
Better logging while establishing and shutting down connections.
[ngircd-alex.git] / src / ngircd / irc-login.c
index 10188c5e0203c8dfb4c2b8179fc51ca4ad6029a0..6f9ab92b20a7e55efda1c6c29c8349fa7eae67a7 100644 (file)
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-login.c,v 1.37 2003/12/27 13:01:12 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 <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 
 #include "ngircd.h"
 #include "resolve.h"
@@ -298,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 );