]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conf.c
- neuer Befehl IRC_TIME().
[ngircd-alex.git] / src / ngircd / conf.c
index d87db500355933ccb7e3b8749a0be442c4b80cc1..12a84d696a24ad06f3a6059078a1590c6b969395 100644 (file)
@@ -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: conf.c,v 1.36 2002/11/08 23:09:26 alex Exp $
+ * $Id: conf.c,v 1.39 2002/11/22 17:57:40 alex Exp $
  *
  * conf.h: Konfiguration des ngircd
  */
@@ -96,7 +96,7 @@ Conf_Test( VOID )
        printf( "  AdminInfo2 = %s\n", Conf_ServerAdmin2 );
        printf( "  AdminEMail = %s\n", Conf_ServerAdminMail );
        printf( "  MotdFile = %s\n", Conf_MotdFile );
-       printf( "  ListenPorts = " );
+       printf( "  Ports = " );
        for( i = 0; i < Conf_ListenPorts_Count; i++ )
        {
                if( i != 0 ) printf( ", " );
@@ -138,7 +138,8 @@ Conf_Test( VOID )
                printf( "  Name = %s\n", Conf_Server[i].name );
                printf( "  Host = %s\n", Conf_Server[i].host );
                printf( "  Port = %d\n", Conf_Server[i].port );
-               printf( "  Password = %s\n", Conf_Server[i].pwd );
+               printf( "  MyPassword = %s\n", Conf_Server[i].pwd_in );
+               printf( "  PeerPassword = %s\n", Conf_Server[i].pwd_out );
                printf( "  Group = %d\n", Conf_Server[i].group );
                puts( "" );
        }
@@ -211,6 +212,8 @@ Read_Config( VOID )
                exit( 1 );
        }
 
+       Config_Error( LOG_INFO, "Reading configuration from \"%s\" ...", NGIRCd_ConfFile );
+
        line = 0;
        strcpy( section, "" );
        while( TRUE )
@@ -248,7 +251,8 @@ Read_Config( VOID )
                                        strcpy( Conf_Server[Conf_Server_Count].host, "" );
                                        strcpy( Conf_Server[Conf_Server_Count].ip, "" );
                                        strcpy( Conf_Server[Conf_Server_Count].name, "" );
-                                       strcpy( Conf_Server[Conf_Server_Count].pwd, "" );
+                                       strcpy( Conf_Server[Conf_Server_Count].pwd_in, "" );
+                                       strcpy( Conf_Server[Conf_Server_Count].pwd_out, "" );
                                        Conf_Server[Conf_Server_Count].port = 0;
                                        Conf_Server[Conf_Server_Count].group = -1;
                                        Conf_Server[Conf_Server_Count].lasttry = time( NULL ) - Conf_ConnectRetry + STARTUP_DELAY;
@@ -492,11 +496,18 @@ Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg )
                Conf_Server[Conf_Server_Count - 1].name[CLIENT_ID_LEN - 1] = '\0';
                return;
        }
-       if( strcasecmp( Var, "Password" ) == 0 )
+       if( strcasecmp( Var, "MyPassword" ) == 0 )
        {
-               /* Passwort des Servers */
-               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';
+               /* Passwort dieses Servers, welches empfangen werden muss */
+               strncpy( Conf_Server[Conf_Server_Count - 1].pwd_in, Arg, CLIENT_PASS_LEN - 1 );
+               Conf_Server[Conf_Server_Count - 1].pwd_in[CLIENT_PASS_LEN - 1] = '\0';
+               return;
+       }
+       if( strcasecmp( Var, "PeerPassword" ) == 0 )
+       {
+               /* Passwort des anderen Servers, welches gesendet werden muss */
+               strncpy( Conf_Server[Conf_Server_Count - 1].pwd_out, Arg, CLIENT_PASS_LEN - 1 );
+               Conf_Server[Conf_Server_Count - 1].pwd_out[CLIENT_PASS_LEN - 1] = '\0';
                return;
        }
        if( strcasecmp( Var, "Port" ) == 0 )
@@ -577,7 +588,7 @@ Validate_Config( VOID )
        if( ! Conf_ServerAdmin1[0] && ! Conf_ServerAdmin2[0] && ! Conf_ServerAdminMail[0] )
        {
                /* Keine Server-Information konfiguriert */
-               Log( LOG_WARNING, "No server information configured but required by RFC!" );
+               Log( LOG_WARNING, "No administrative information configured but required by RFC!" );
        }
 } /* Validate_Config */