X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fconf.c;h=e94dd2a16f36dcc93ee7108d9ad6b9bfce0c59de;hp=8b945e82da53a89ab66796fb8900292c8217def2;hb=b60f369266d895009642fab4c8cef3953938f0d3;hpb=21a8a278fb354526c58a16220a0a4a12704d524b diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index 8b945e82..e94dd2a1 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -9,11 +9,23 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: conf.c,v 1.9 2002/01/02 02:49:15 alex Exp $ + * $Id: conf.c,v 1.13 2002/01/18 15:51:44 alex Exp $ * * conf.h: Konfiguration des ngircd * * $Log: conf.c,v $ + * Revision 1.13 2002/01/18 15:51:44 alex + * - Server-Verbinungen werden beim Start erst nach kurzer Pause aufgebaut. + * + * Revision 1.12 2002/01/05 23:26:24 alex + * - Fehlermeldungen korrigiert. + * + * Revision 1.11 2002/01/05 16:51:49 alex + * - Bug bei Remote-Server-Namen entfernt: diese wurden falsch gekuerzt. + * + * Revision 1.10 2002/01/03 02:27:20 alex + * - das Server-Passwort kann nun konfiguriert werden. + * * Revision 1.9 2002/01/02 02:49:15 alex * - Konfigurationsdatei "Samba like" umgestellt. * - es koennen nun mehrere Server und Oprtatoren konfiguriert werden. @@ -79,6 +91,7 @@ GLOBAL VOID Conf_Init( VOID ) strcpy( Conf_ServerName, "" ); strcpy( Conf_ServerInfo, PACKAGE" "VERSION ); + strcpy( Conf_ServerPwd, "" ); strcpy( Conf_MotdFile, "/usr/local/etc/ngircd.motd" ); @@ -161,7 +174,7 @@ LOCAL VOID Read_Config( VOID ) strcpy( Conf_Server[Conf_Server_Count].name, "" ); strcpy( Conf_Server[Conf_Server_Count].pwd, "" ); Conf_Server[Conf_Server_Count].port = 0; - Conf_Server[Conf_Server_Count].lasttry = 0; + Conf_Server[Conf_Server_Count].lasttry = time( NULL ) - Conf_ConnectRetry + STARTUP_DELAY; Conf_Server[Conf_Server_Count].res_stat = NULL; Conf_Server_Count++; } @@ -216,6 +229,13 @@ GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg ) Conf_ServerInfo[CLIENT_INFO_LEN - 1] = '\0'; return; } + if( strcasecmp( Var, "Password" ) == 0 ) + { + /* Der Server-Name */ + strncpy( Conf_ServerPwd, Arg, CLIENT_PASS_LEN ); + Conf_ServerPwd[CLIENT_PASS_LEN - 1] = '\0'; + return; + } if( strcasecmp( Var, "Ports" ) == 0 ) { /* Ports, durch "," getrennt, auf denen der Server @@ -312,8 +332,8 @@ GLOBAL VOID Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg ) if( strcasecmp( Var, "Name" ) == 0 ) { /* Name des Servers ("Nick") */ - strncpy( Conf_Server[Conf_Server_Count - 1].name, Arg, CLIENT_PASS_LEN ); - Conf_Server[Conf_Server_Count - 1].name[CLIENT_PASS_LEN - 1] = '\0'; + strncpy( Conf_Server[Conf_Server_Count - 1].name, Arg, CLIENT_ID_LEN ); + Conf_Server[Conf_Server_Count - 1].name[CLIENT_ID_LEN - 1] = '\0'; return; } if( strcasecmp( Var, "Password" ) == 0 ) @@ -343,7 +363,7 @@ LOCAL VOID Validate_Config( VOID ) if( ! Conf_ServerName[0] ) { /* Kein Servername konfiguriert */ - Log( LOG_ALERT, "No server name configured (use \"ServerName\")!", Conf_File, strerror( errno )); + Log( LOG_ALERT, "No server name configured in \"%s\"!", Conf_File ); Log( LOG_ALERT, PACKAGE" exiting due to fatal errors!" ); exit( 1 ); }