]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/irc-login.c
Fixed some warnings of non-gcc-compilers (e. g. original Apple compiler on
[ngircd.git] / src / ngircd / irc-login.c
index a077f16aa73403ddc2b0e221bb74df61434f6c7d..149cbfe94ccda4b431c7dc66502ed8e2a2fa5c93 100644 (file)
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-login.c,v 1.36 2003/12/04 14:05:16 alex Exp $";
+static char UNUSED id[] = "$Id: irc-login.c,v 1.40 2004/03/11 22:16:31 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"
@@ -285,6 +286,10 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
 GLOBAL BOOLEAN
 IRC_USER( CLIENT *Client, REQUEST *Req )
 {
+#ifdef IDENTAUTH
+       CHAR *ptr;
+#endif
+
        assert( Client != NULL );
        assert( Req != NULL );
 
@@ -294,11 +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 == '~' ) 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 );
@@ -494,7 +509,7 @@ Kill_Nick( CHAR *Nick, CHAR *Reason )
        assert( Nick != NULL );
        assert( Reason != NULL );
 
-       r.prefix = Client_ThisServer( );
+       r.prefix = (CHAR *)Client_ThisServer( );
        r.argv[0] = Nick;
        r.argv[1] = Reason;
        r.argc = 2;