X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Firc-login.c;h=02251658ee59a656188e4b2779d71221ecec3748;hp=cd3fcc61784f1207010dc39d840e9286a80bdc4f;hb=9f122037aecc327e689a2681c25540688621c630;hpb=55ee4c9553b2c6e6361fbdab39ee31c74608e871 diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c index cd3fcc61..02251658 100644 --- a/src/ngircd/irc-login.c +++ b/src/ngircd/irc-login.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: irc-login.c,v 1.20 2002/09/03 20:58:43 alex Exp $ + * $Id: irc-login.c,v 1.26 2002/12/03 18:56:33 alex Exp $ * * irc-login.c: Anmeldung und Abmeldung im IRC */ @@ -32,7 +32,7 @@ #include "log.h" #include "messages.h" #include "parse.h" -#include "irc.h" +#include "irc-info.h" #include "irc-write.h" #include "exp.h" @@ -65,7 +65,7 @@ IRC_PASS( CLIENT *Client, REQUEST *Req ) } else if((( Client_Type( Client ) == CLIENT_UNKNOWN ) || ( Client_Type( Client ) == CLIENT_UNKNOWNSERVER )) && (( Req->argc == 3 ) || ( Req->argc == 4 ))) { - CHAR c2, c4, *type, *impl, *serverver, *flags, *ptr; + CHAR c2, c4, *type, *impl, *serverver, *flags, *ptr, *ircflags; INT protohigh, protolow; /* noch nicht registrierte Server-Verbindung */ @@ -94,6 +94,10 @@ IRC_PASS( CLIENT *Client, REQUEST *Req ) if( strlen( Req->argv[1] ) > 4 ) type = &Req->argv[1][4]; else type = NULL; + /* IRC-Flags (nach RFC 2813) */ + if( Req->argc >= 4 ) ircflags = Req->argv[3]; + else ircflags = ""; + /* Implementation, Version und ngIRCd-Flags */ impl = Req->argv[2]; ptr = strchr( impl, '|' ); @@ -111,12 +115,16 @@ IRC_PASS( CLIENT *Client, REQUEST *Req ) flags++; } else flags = ""; - Log( LOG_INFO, "Connection %d: Peer announces itself as %s-%s (flags: \"%s\") using protocol version %d.%d+.", Client_Conn( Client ), impl, serverver, flags, protohigh, protolow ); + Log( LOG_INFO, "Peer announces itself as %s-%s using protocol %d.%d/IRC+ (flags: \"%s\").", impl, serverver, protohigh, protolow, flags ); } else { - serverver = flags = ""; - Log( LOG_INFO, "Connection %d: Peer announces itself as \"%s\" using protocol version %d.%d.", Client_Conn( Client ), impl, protohigh, protolow ); + /* auf der anderen Seite laeuft ein Server, der + * nur das Originalprotokoll unterstuetzt */ + serverver = ""; + if( strchr( ircflags, 'Z' )) flags = "Z"; + else flags = ""; + Log( LOG_INFO, "Peer announces itself as \"%s\" using protocol %d.%d (flags: \"%s\").", impl, protohigh, protolow, flags ); } Client_SetType( Client, CLIENT_GOTPASSSERVER ); @@ -354,8 +362,6 @@ IRC_PING( CLIENT *Client, REQUEST *Req ) assert( Client != NULL ); assert( Req != NULL ); - if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); - /* Falsche Anzahl Parameter? */ if( Req->argc < 1 ) return IRC_WriteStrClient( Client, ERR_NOORIGIN_MSG, Client_ID( Client )); #ifdef STRICT_RFC @@ -390,8 +396,6 @@ IRC_PONG( CLIENT *Client, REQUEST *Req ) assert( Client != NULL ); assert( Req != NULL ); - if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); - /* Falsche Anzahl Parameter? */ if( Req->argc < 1 ) return IRC_WriteStrClient( Client, ERR_NOORIGIN_MSG, Client_ID( Client )); if( Req->argc > 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); @@ -441,7 +445,7 @@ Hello_User( CLIENT *Client ) IRC_WriteStrServers( NULL, "NICK %s 1 %s %s 1 +%s :%s", Client_ID( Client ), Client_User( Client ), Client_Hostname( Client ), Client_Modes( Client ), Client_Info( Client )); if( ! IRC_WriteStrClient( Client, RPL_WELCOME_MSG, Client_ID( Client ), Client_Mask( Client ))) return FALSE; - if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), VERSION, TARGET_CPU, TARGET_CPU, TARGET_OS )) return FALSE; + if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), VERSION, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) return FALSE; if( ! IRC_WriteStrClient( Client, RPL_CREATED_MSG, Client_ID( Client ), NGIRCd_StartStr )) return FALSE; if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), VERSION, USERMODES, CHANMODES )) return FALSE;