X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fconf.c;h=369a2e03d27b25d265458836cc0a9c506fa83e59;hb=14aba7c1b2b26c8ddbf193c761bd4103997e5dfc;hp=6c3660b87fbcbaf409e1d9c9e9ddc7d1b4213cdd;hpb=2e289b50848f4146bc12ea8f6afef20277b4b6eb;p=ngircd-alex.git diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index 6c3660b8..369a2e03 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -9,11 +9,20 @@ * 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.11 2002/01/05 16:51:49 alex Exp $ + * $Id: conf.c,v 1.14 2002/03/03 17:17:01 alex Exp $ * * conf.h: Konfiguration des ngircd * * $Log: conf.c,v $ + * Revision 1.14 2002/03/03 17:17:01 alex + * - strncpy() und vsnprintf() kopieren nun etwas "optimierter" (1 Byte weniger) :-) + * + * 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. * @@ -168,7 +177,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++; } @@ -212,21 +221,21 @@ GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg ) if( strcasecmp( Var, "Name" ) == 0 ) { /* Der Server-Name */ - strncpy( Conf_ServerName, Arg, CLIENT_ID_LEN ); + strncpy( Conf_ServerName, Arg, CLIENT_ID_LEN - 1 ); Conf_ServerName[CLIENT_ID_LEN - 1] = '\0'; return; } if( strcasecmp( Var, "Info" ) == 0 ) { /* Server-Info-Text */ - strncpy( Conf_ServerInfo, Arg, CLIENT_INFO_LEN ); + strncpy( Conf_ServerInfo, Arg, CLIENT_INFO_LEN - 1 ); Conf_ServerInfo[CLIENT_INFO_LEN - 1] = '\0'; return; } if( strcasecmp( Var, "Password" ) == 0 ) { - /* Der Server-Name */ - strncpy( Conf_ServerPwd, Arg, CLIENT_PASS_LEN ); + /* Server-Passwort */ + strncpy( Conf_ServerPwd, Arg, CLIENT_PASS_LEN - 1 ); Conf_ServerPwd[CLIENT_PASS_LEN - 1] = '\0'; return; } @@ -252,7 +261,7 @@ GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg ) if( strcasecmp( Var, "MotdFile" ) == 0 ) { /* Datei mit der "message of the day" (MOTD) */ - strncpy( Conf_MotdFile, Arg, FNAME_LEN ); + strncpy( Conf_MotdFile, Arg, FNAME_LEN - 1 ); Conf_MotdFile[FNAME_LEN - 1] = '\0'; return; } @@ -292,14 +301,14 @@ GLOBAL VOID Handle_OPERATOR( INT Line, CHAR *Var, CHAR *Arg ) if( strcasecmp( Var, "Name" ) == 0 ) { /* Name des IRC Operator */ - strncpy( Conf_Oper[Conf_Oper_Count - 1].name, Arg, CLIENT_ID_LEN ); + strncpy( Conf_Oper[Conf_Oper_Count - 1].name, Arg, CLIENT_ID_LEN - 1 ); Conf_Oper[Conf_Oper_Count - 1].name[CLIENT_ID_LEN - 1] = '\0'; return; } if( strcasecmp( Var, "Password" ) == 0 ) { /* Passwort des IRC Operator */ - strncpy( Conf_Oper[Conf_Oper_Count - 1].pwd, Arg, CLIENT_PASS_LEN ); + strncpy( Conf_Oper[Conf_Oper_Count - 1].pwd, Arg, CLIENT_PASS_LEN - 1 ); Conf_Oper[Conf_Oper_Count - 1].pwd[CLIENT_PASS_LEN - 1] = '\0'; return; } @@ -319,21 +328,21 @@ GLOBAL VOID Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg ) if( strcasecmp( Var, "Host" ) == 0 ) { /* Hostname des Servers */ - strncpy( Conf_Server[Conf_Server_Count - 1].host, Arg, HOST_LEN ); + strncpy( Conf_Server[Conf_Server_Count - 1].host, Arg, HOST_LEN - 1 ); Conf_Server[Conf_Server_Count - 1].host[HOST_LEN - 1] = '\0'; return; } if( strcasecmp( Var, "Name" ) == 0 ) { /* Name des Servers ("Nick") */ - strncpy( Conf_Server[Conf_Server_Count - 1].name, Arg, CLIENT_ID_LEN ); + strncpy( Conf_Server[Conf_Server_Count - 1].name, Arg, CLIENT_ID_LEN - 1 ); Conf_Server[Conf_Server_Count - 1].name[CLIENT_ID_LEN - 1] = '\0'; return; } if( strcasecmp( Var, "Password" ) == 0 ) { /* Passwort des Servers */ - strncpy( Conf_Server[Conf_Server_Count - 1].pwd, Arg, CLIENT_PASS_LEN ); + strncpy( Conf_Server[Conf_Server_Count - 1].pwd, Arg, CLIENT_PASS_LEN - 1 ); Conf_Server[Conf_Server_Count - 1].pwd[CLIENT_PASS_LEN - 1] = '\0'; return; } @@ -357,7 +366,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 ); }