Blame


1 cbc1e59f 2001-12-12 alex /*
2 cbc1e59f 2001-12-12 alex * ngIRCd -- The Next Generation IRC Daemon
3 03d971d9 2002-01-02 alex * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
4 cbc1e59f 2001-12-12 alex *
5 cbc1e59f 2001-12-12 alex * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
6 cbc1e59f 2001-12-12 alex * der GNU General Public License (GPL), wie von der Free Software Foundation
7 cbc1e59f 2001-12-12 alex * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
8 cbc1e59f 2001-12-12 alex * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
9 cbc1e59f 2001-12-12 alex * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
10 804b1ec4 2001-12-31 alex * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
11 cbc1e59f 2001-12-12 alex *
12 b2615bcc 2002-11-19 alex * $Id: conf.c,v 1.38 2002/11/19 12:50:20 alex Exp $
13 cbc1e59f 2001-12-12 alex *
14 cbc1e59f 2001-12-12 alex * conf.h: Konfiguration des ngircd
15 cbc1e59f 2001-12-12 alex */
16 cbc1e59f 2001-12-12 alex
17 cbc1e59f 2001-12-12 alex
18 ca33cbda 2002-03-12 alex #include "portab.h"
19 cbc1e59f 2001-12-12 alex
20 ca33cbda 2002-03-12 alex #include "imp.h"
21 cbc1e59f 2001-12-12 alex #include <assert.h>
22 9856253d 2001-12-30 alex #include <errno.h>
23 f86083a0 2002-03-27 alex #include <stdarg.h>
24 9856253d 2001-12-30 alex #include <stdio.h>
25 b20fa7c6 2002-01-01 alex #include <stdlib.h>
26 9856253d 2001-12-30 alex #include <string.h>
27 f86083a0 2002-03-27 alex #include <unistd.h>
28 ae39724a 2002-11-08 alex #include <pwd.h>
29 ae39724a 2002-11-08 alex #include <grp.h>
30 ae39724a 2002-11-08 alex #include <sys/types.h>
31 cbc1e59f 2001-12-12 alex
32 f86083a0 2002-03-27 alex #include "ngircd.h"
33 c2f60abe 2002-05-27 alex #include "conn.h"
34 9856253d 2001-12-30 alex #include "client.h"
35 ca33cbda 2002-03-12 alex #include "defines.h"
36 9856253d 2001-12-30 alex #include "log.h"
37 c2f60abe 2002-05-27 alex #include "resolve.h"
38 9856253d 2001-12-30 alex #include "tool.h"
39 9856253d 2001-12-30 alex
40 ca33cbda 2002-03-12 alex #include "exp.h"
41 cbc1e59f 2001-12-12 alex #include "conf.h"
42 cbc1e59f 2001-12-12 alex
43 cbc1e59f 2001-12-12 alex
44 f86083a0 2002-03-27 alex LOCAL BOOLEAN Use_Log = TRUE;
45 f86083a0 2002-03-27 alex
46 f86083a0 2002-03-27 alex
47 c2f60abe 2002-05-27 alex LOCAL VOID Set_Defaults PARAMS(( VOID ));
48 c2f60abe 2002-05-27 alex LOCAL VOID Read_Config PARAMS(( VOID ));
49 c2f60abe 2002-05-27 alex LOCAL VOID Validate_Config PARAMS(( VOID ));
50 03d971d9 2002-01-02 alex
51 c2f60abe 2002-05-27 alex LOCAL VOID Handle_GLOBAL PARAMS(( INT Line, CHAR *Var, CHAR *Arg ));
52 c2f60abe 2002-05-27 alex LOCAL VOID Handle_OPERATOR PARAMS(( INT Line, CHAR *Var, CHAR *Arg ));
53 c2f60abe 2002-05-27 alex LOCAL VOID Handle_SERVER PARAMS(( INT Line, CHAR *Var, CHAR *Arg ));
54 c2f60abe 2002-05-27 alex LOCAL VOID Handle_CHANNEL PARAMS(( INT Line, CHAR *Var, CHAR *Arg ));
55 03d971d9 2002-01-02 alex
56 c2f60abe 2002-05-27 alex LOCAL VOID Config_Error PARAMS(( CONST INT Level, CONST CHAR *Format, ... ));
57 574ae82c 2001-12-26 alex
58 574ae82c 2001-12-26 alex
59 c2f60abe 2002-05-27 alex GLOBAL VOID
60 c2f60abe 2002-05-27 alex Conf_Init( VOID )
61 cbc1e59f 2001-12-12 alex {
62 f86083a0 2002-03-27 alex Set_Defaults( );
63 f86083a0 2002-03-27 alex Read_Config( );
64 f86083a0 2002-03-27 alex Validate_Config( );
65 f86083a0 2002-03-27 alex } /* Config_Init */
66 9856253d 2001-12-30 alex
67 9856253d 2001-12-30 alex
68 c2f60abe 2002-05-27 alex GLOBAL INT
69 c2f60abe 2002-05-27 alex Conf_Test( VOID )
70 f86083a0 2002-03-27 alex {
71 f86083a0 2002-03-27 alex /* Konfiguration einlesen, ueberpruefen und ausgeben. */
72 f86083a0 2002-03-27 alex
73 ae39724a 2002-11-08 alex struct passwd *pwd;
74 ae39724a 2002-11-08 alex struct group *grp;
75 74ff9828 2002-10-03 alex INT i;
76 f86083a0 2002-03-27 alex
77 f86083a0 2002-03-27 alex Use_Log = FALSE;
78 f86083a0 2002-03-27 alex Set_Defaults( );
79 f86083a0 2002-03-27 alex
80 f86083a0 2002-03-27 alex printf( "Using \"%s\" as configuration file ...\n", NGIRCd_ConfFile );
81 f86083a0 2002-03-27 alex Read_Config( );
82 f86083a0 2002-03-27 alex
83 f86083a0 2002-03-27 alex /* Wenn stdin ein ein TTY ist: auf Taste warten */
84 f86083a0 2002-03-27 alex if( isatty( fileno( stdout )))
85 f86083a0 2002-03-27 alex {
86 f86083a0 2002-03-27 alex puts( "OK, press enter to see a dump of your service configuration ..." );
87 f86083a0 2002-03-27 alex getchar( );
88 f86083a0 2002-03-27 alex }
89 f86083a0 2002-03-27 alex else puts( "Ok, dump of your server configuration follows:\n" );
90 f86083a0 2002-03-27 alex
91 f86083a0 2002-03-27 alex puts( "[GLOBAL]" );
92 f86083a0 2002-03-27 alex printf( " ServerName = %s\n", Conf_ServerName );
93 f86083a0 2002-03-27 alex printf( " ServerInfo = %s\n", Conf_ServerInfo );
94 f86083a0 2002-03-27 alex printf( " ServerPwd = %s\n", Conf_ServerPwd );
95 b615d128 2002-09-16 alex printf( " AdminInfo1 = %s\n", Conf_ServerAdmin1 );
96 b615d128 2002-09-16 alex printf( " AdminInfo2 = %s\n", Conf_ServerAdmin2 );
97 b615d128 2002-09-16 alex printf( " AdminEMail = %s\n", Conf_ServerAdminMail );
98 f86083a0 2002-03-27 alex printf( " MotdFile = %s\n", Conf_MotdFile );
99 7bbdfb3d 2002-11-18 alex printf( " Ports = " );
100 f86083a0 2002-03-27 alex for( i = 0; i < Conf_ListenPorts_Count; i++ )
101 f86083a0 2002-03-27 alex {
102 f86083a0 2002-03-27 alex if( i != 0 ) printf( ", " );
103 1c2d0ae5 2002-03-29 alex printf( "%u", Conf_ListenPorts[i] );
104 f86083a0 2002-03-27 alex }
105 1c2d0ae5 2002-03-29 alex puts( "" );
106 ae39724a 2002-11-08 alex pwd = getpwuid( Conf_UID );
107 ae39724a 2002-11-08 alex if( pwd ) printf( " ServerUID = %s\n", pwd->pw_name );
108 ae39724a 2002-11-08 alex else printf( " ServerUID = %ld\n", (LONG)Conf_UID );
109 ae39724a 2002-11-08 alex grp = getgrgid( Conf_GID );
110 ae39724a 2002-11-08 alex if( grp ) printf( " ServerGID = %s\n", grp->gr_name );
111 ae39724a 2002-11-08 alex else printf( " ServerGID = %ld\n", (LONG)Conf_GID );
112 f86083a0 2002-03-27 alex printf( " PingTimeout = %d\n", Conf_PingTimeout );
113 f86083a0 2002-03-27 alex printf( " PongTimeout = %d\n", Conf_PongTimeout );
114 f86083a0 2002-03-27 alex printf( " ConnectRetry = %d\n", Conf_ConnectRetry );
115 7e1b3b91 2002-09-02 alex printf( " OperCanUseMode = %s\n", Conf_OperCanMode == TRUE ? "yes" : "no" );
116 0d32a3b4 2002-11-02 alex if( Conf_MaxConnections > 0 ) printf( " MaxConnections = %ld\n", Conf_MaxConnections );
117 0d32a3b4 2002-11-02 alex else printf( " MaxConnections = -1\n" );
118 f86083a0 2002-03-27 alex puts( "" );
119 f86083a0 2002-03-27 alex
120 f86083a0 2002-03-27 alex for( i = 0; i < Conf_Oper_Count; i++ )
121 f86083a0 2002-03-27 alex {
122 c23535bc 2002-05-22 alex if( ! Conf_Oper[i].name[0] ) continue;
123 c23535bc 2002-05-22 alex
124 c23535bc 2002-05-22 alex /* gueltiger Operator-Block: ausgeben */
125 f86083a0 2002-03-27 alex puts( "[OPERATOR]" );
126 f86083a0 2002-03-27 alex printf( " Name = %s\n", Conf_Oper[i].name );
127 f86083a0 2002-03-27 alex printf( " Password = %s\n", Conf_Oper[i].pwd );
128 f86083a0 2002-03-27 alex puts( "" );
129 f86083a0 2002-03-27 alex }
130 f86083a0 2002-03-27 alex
131 f86083a0 2002-03-27 alex for( i = 0; i < Conf_Server_Count; i++ )
132 f86083a0 2002-03-27 alex {
133 c23535bc 2002-05-22 alex if( ! Conf_Server[i].name[0] ) continue;
134 c23535bc 2002-05-22 alex if( ! Conf_Server[i].host[0] ) continue;
135 c23535bc 2002-05-22 alex
136 c23535bc 2002-05-22 alex /* gueltiger Server-Block: ausgeben */
137 f86083a0 2002-03-27 alex puts( "[SERVER]" );
138 f86083a0 2002-03-27 alex printf( " Name = %s\n", Conf_Server[i].name );
139 f86083a0 2002-03-27 alex printf( " Host = %s\n", Conf_Server[i].host );
140 f86083a0 2002-03-27 alex printf( " Port = %d\n", Conf_Server[i].port );
141 b2615bcc 2002-11-19 alex printf( " MyPassword = %s\n", Conf_Server[i].pwd_in );
142 b2615bcc 2002-11-19 alex printf( " PeerPassword = %s\n", Conf_Server[i].pwd_out );
143 f86083a0 2002-03-27 alex printf( " Group = %d\n", Conf_Server[i].group );
144 f86083a0 2002-03-27 alex puts( "" );
145 f86083a0 2002-03-27 alex }
146 040f5422 2002-05-21 alex
147 040f5422 2002-05-21 alex for( i = 0; i < Conf_Channel_Count; i++ )
148 040f5422 2002-05-21 alex {
149 c23535bc 2002-05-22 alex if( ! Conf_Channel[i].name[0] ) continue;
150 c23535bc 2002-05-22 alex
151 c23535bc 2002-05-22 alex /* gueltiger Channel-Block: ausgeben */
152 040f5422 2002-05-21 alex puts( "[CHANNEL]" );
153 040f5422 2002-05-21 alex printf( " Name = %s\n", Conf_Channel[i].name );
154 040f5422 2002-05-21 alex printf( " Modes = %s\n", Conf_Channel[i].modes );
155 040f5422 2002-05-21 alex printf( " Topic = %s\n", Conf_Channel[i].topic );
156 040f5422 2002-05-21 alex puts( "" );
157 040f5422 2002-05-21 alex }
158 f86083a0 2002-03-27 alex
159 f86083a0 2002-03-27 alex return 0;
160 f86083a0 2002-03-27 alex } /* Conf_Test */
161 f86083a0 2002-03-27 alex
162 f86083a0 2002-03-27 alex
163 c2f60abe 2002-05-27 alex LOCAL VOID
164 c2f60abe 2002-05-27 alex Set_Defaults( VOID )
165 f86083a0 2002-03-27 alex {
166 f86083a0 2002-03-27 alex /* Konfigurationsvariablen initialisieren, d.h. auf Default-Werte setzen. */
167 f86083a0 2002-03-27 alex
168 9856253d 2001-12-30 alex strcpy( Conf_ServerName, "" );
169 f7327524 2002-05-30 alex sprintf( Conf_ServerInfo, "%s %s", PACKAGE, VERSION );
170 ed406b4a 2002-01-03 alex strcpy( Conf_ServerPwd, "" );
171 9856253d 2001-12-30 alex
172 b615d128 2002-09-16 alex strcpy( Conf_ServerAdmin1, "" );
173 b615d128 2002-09-16 alex strcpy( Conf_ServerAdmin2, "" );
174 b615d128 2002-09-16 alex strcpy( Conf_ServerAdminMail, "" );
175 b615d128 2002-09-16 alex
176 10aa35cc 2002-03-06 alex strcpy( Conf_MotdFile, MOTD_FILE );
177 9856253d 2001-12-30 alex
178 9856253d 2001-12-30 alex Conf_ListenPorts_Count = 0;
179 1c2d0ae5 2002-03-29 alex
180 1c2d0ae5 2002-03-29 alex Conf_UID = Conf_GID = 0;
181 574ae82c 2001-12-26 alex
182 08cf5607 2001-12-26 alex Conf_PingTimeout = 120;
183 281d8e45 2002-03-25 alex Conf_PongTimeout = 20;
184 574ae82c 2001-12-26 alex
185 03d971d9 2002-01-02 alex Conf_ConnectRetry = 60;
186 03d971d9 2002-01-02 alex
187 03d971d9 2002-01-02 alex Conf_Oper_Count = 0;
188 03d971d9 2002-01-02 alex Conf_Server_Count = 0;
189 040f5422 2002-05-21 alex Conf_Channel_Count = 0;
190 7e1b3b91 2002-09-02 alex
191 7e1b3b91 2002-09-02 alex Conf_OperCanMode = FALSE;
192 0d32a3b4 2002-11-02 alex
193 0d32a3b4 2002-11-02 alex Conf_MaxConnections = 0;
194 f86083a0 2002-03-27 alex } /* Set_Defaults */
195 03d971d9 2002-01-02 alex
196 cbc1e59f 2001-12-12 alex
197 c2f60abe 2002-05-27 alex LOCAL VOID
198 c2f60abe 2002-05-27 alex Read_Config( VOID )
199 574ae82c 2001-12-26 alex {
200 574ae82c 2001-12-26 alex /* Konfigurationsdatei einlesen. */
201 9856253d 2001-12-30 alex
202 03d971d9 2002-01-02 alex CHAR section[LINE_LEN], str[LINE_LEN], *var, *arg, *ptr;
203 9856253d 2001-12-30 alex INT line;
204 9856253d 2001-12-30 alex FILE *fd;
205 9856253d 2001-12-30 alex
206 f86083a0 2002-03-27 alex fd = fopen( NGIRCd_ConfFile, "r" );
207 9856253d 2001-12-30 alex if( ! fd )
208 9856253d 2001-12-30 alex {
209 9856253d 2001-12-30 alex /* Keine Konfigurationsdatei gefunden */
210 f86083a0 2002-03-27 alex Config_Error( LOG_ALERT, "Can't read configuration \"%s\": %s", NGIRCd_ConfFile, strerror( errno ));
211 f7327524 2002-05-30 alex Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
212 9856253d 2001-12-30 alex exit( 1 );
213 9856253d 2001-12-30 alex }
214 9856253d 2001-12-30 alex
215 9856253d 2001-12-30 alex line = 0;
216 03d971d9 2002-01-02 alex strcpy( section, "" );
217 9856253d 2001-12-30 alex while( TRUE )
218 9856253d 2001-12-30 alex {
219 804b1ec4 2001-12-31 alex if( ! fgets( str, LINE_LEN, fd )) break;
220 9856253d 2001-12-30 alex ngt_TrimStr( str );
221 9856253d 2001-12-30 alex line++;
222 9856253d 2001-12-30 alex
223 9856253d 2001-12-30 alex /* Kommentarzeilen und leere Zeilen ueberspringen */
224 9856253d 2001-12-30 alex if( str[0] == ';' || str[0] == '#' || str[0] == '\0' ) continue;
225 9856253d 2001-12-30 alex
226 03d971d9 2002-01-02 alex /* Anfang eines Abschnittes? */
227 03d971d9 2002-01-02 alex if(( str[0] == '[' ) && ( str[strlen( str ) - 1] == ']' ))
228 03d971d9 2002-01-02 alex {
229 03d971d9 2002-01-02 alex strcpy( section, str );
230 03d971d9 2002-01-02 alex if( strcasecmp( section, "[GLOBAL]" ) == 0 ) continue;
231 03d971d9 2002-01-02 alex if( strcasecmp( section, "[OPERATOR]" ) == 0 )
232 03d971d9 2002-01-02 alex {
233 f86083a0 2002-03-27 alex if( Conf_Oper_Count + 1 > MAX_OPERATORS ) Config_Error( LOG_ERR, "Too many operators configured." );
234 03d971d9 2002-01-02 alex else
235 03d971d9 2002-01-02 alex {
236 03d971d9 2002-01-02 alex /* neuen Operator initialisieren */
237 03d971d9 2002-01-02 alex strcpy( Conf_Oper[Conf_Oper_Count].name, "" );
238 03d971d9 2002-01-02 alex strcpy( Conf_Oper[Conf_Oper_Count].pwd, "" );
239 03d971d9 2002-01-02 alex Conf_Oper_Count++;
240 03d971d9 2002-01-02 alex }
241 03d971d9 2002-01-02 alex continue;
242 03d971d9 2002-01-02 alex }
243 03d971d9 2002-01-02 alex if( strcasecmp( section, "[SERVER]" ) == 0 )
244 03d971d9 2002-01-02 alex {
245 f86083a0 2002-03-27 alex if( Conf_Server_Count + 1 > MAX_SERVERS ) Config_Error( LOG_ERR, "Too many servers configured." );
246 03d971d9 2002-01-02 alex else
247 03d971d9 2002-01-02 alex {
248 03d971d9 2002-01-02 alex /* neuen Server ("Peer") initialisieren */
249 03d971d9 2002-01-02 alex strcpy( Conf_Server[Conf_Server_Count].host, "" );
250 03d971d9 2002-01-02 alex strcpy( Conf_Server[Conf_Server_Count].ip, "" );
251 03d971d9 2002-01-02 alex strcpy( Conf_Server[Conf_Server_Count].name, "" );
252 b2615bcc 2002-11-19 alex strcpy( Conf_Server[Conf_Server_Count].pwd_in, "" );
253 b2615bcc 2002-11-19 alex strcpy( Conf_Server[Conf_Server_Count].pwd_out, "" );
254 03d971d9 2002-01-02 alex Conf_Server[Conf_Server_Count].port = 0;
255 d67d94ea 2002-03-10 alex Conf_Server[Conf_Server_Count].group = -1;
256 6debfc31 2002-01-18 alex Conf_Server[Conf_Server_Count].lasttry = time( NULL ) - Conf_ConnectRetry + STARTUP_DELAY;
257 03d971d9 2002-01-02 alex Conf_Server[Conf_Server_Count].res_stat = NULL;
258 03d971d9 2002-01-02 alex Conf_Server_Count++;
259 040f5422 2002-05-21 alex }
260 040f5422 2002-05-21 alex continue;
261 040f5422 2002-05-21 alex }
262 040f5422 2002-05-21 alex if( strcasecmp( section, "[CHANNEL]" ) == 0 )
263 040f5422 2002-05-21 alex {
264 040f5422 2002-05-21 alex if( Conf_Channel_Count + 1 > MAX_DEFCHANNELS ) Config_Error( LOG_ERR, "Too many pre-defined channels configured." );
265 040f5422 2002-05-21 alex else
266 040f5422 2002-05-21 alex {
267 040f5422 2002-05-21 alex /* neuen vordefinierten Channel initialisieren */
268 040f5422 2002-05-21 alex strcpy( Conf_Channel[Conf_Channel_Count].name, "" );
269 040f5422 2002-05-21 alex strcpy( Conf_Channel[Conf_Channel_Count].modes, "" );
270 040f5422 2002-05-21 alex strcpy( Conf_Channel[Conf_Channel_Count].topic, "" );
271 040f5422 2002-05-21 alex Conf_Channel_Count++;
272 03d971d9 2002-01-02 alex }
273 03d971d9 2002-01-02 alex continue;
274 03d971d9 2002-01-02 alex }
275 f86083a0 2002-03-27 alex Config_Error( LOG_ERR, "%s, line %d: Unknown section \"%s\"!", NGIRCd_ConfFile, line, section );
276 03d971d9 2002-01-02 alex section[0] = 0x1;
277 03d971d9 2002-01-02 alex }
278 03d971d9 2002-01-02 alex if( section[0] == 0x1 ) continue;
279 03d971d9 2002-01-02 alex
280 03d971d9 2002-01-02 alex /* In Variable und Argument zerlegen */
281 9856253d 2001-12-30 alex ptr = strchr( str, '=' );
282 9856253d 2001-12-30 alex if( ! ptr )
283 9856253d 2001-12-30 alex {
284 f86083a0 2002-03-27 alex Config_Error( LOG_ERR, "%s, line %d: Syntax error!", NGIRCd_ConfFile, line );
285 9856253d 2001-12-30 alex continue;
286 9856253d 2001-12-30 alex }
287 9856253d 2001-12-30 alex *ptr = '\0';
288 9856253d 2001-12-30 alex var = str; ngt_TrimStr( var );
289 9856253d 2001-12-30 alex arg = ptr + 1; ngt_TrimStr( arg );
290 03d971d9 2002-01-02 alex
291 03d971d9 2002-01-02 alex if( strcasecmp( section, "[GLOBAL]" ) == 0 ) Handle_GLOBAL( line, var, arg );
292 03d971d9 2002-01-02 alex else if( strcasecmp( section, "[OPERATOR]" ) == 0 ) Handle_OPERATOR( line, var, arg );
293 03d971d9 2002-01-02 alex else if( strcasecmp( section, "[SERVER]" ) == 0 ) Handle_SERVER( line, var, arg );
294 040f5422 2002-05-21 alex else if( strcasecmp( section, "[CHANNEL]" ) == 0 ) Handle_CHANNEL( line, var, arg );
295 f86083a0 2002-03-27 alex else Config_Error( LOG_ERR, "%s, line %d: Variable \"%s\" outside section!", NGIRCd_ConfFile, line, var );
296 03d971d9 2002-01-02 alex }
297 03d971d9 2002-01-02 alex
298 03d971d9 2002-01-02 alex fclose( fd );
299 1c99b837 2002-03-30 alex
300 1c99b837 2002-03-30 alex /* Wenn kein Port definiert wurde, Port 6667 als Default benutzen */
301 1c99b837 2002-03-30 alex if( Conf_ListenPorts_Count < 1 )
302 1c99b837 2002-03-30 alex {
303 1c99b837 2002-03-30 alex Conf_ListenPorts_Count = 1;
304 1c99b837 2002-03-30 alex Conf_ListenPorts[0] = 6667;
305 1c99b837 2002-03-30 alex }
306 03d971d9 2002-01-02 alex } /* Read_Config */
307 03d971d9 2002-01-02 alex
308 03d971d9 2002-01-02 alex
309 c2f60abe 2002-05-27 alex LOCAL VOID
310 c2f60abe 2002-05-27 alex Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
311 03d971d9 2002-01-02 alex {
312 ae39724a 2002-11-08 alex struct passwd *pwd;
313 ae39724a 2002-11-08 alex struct group *grp;
314 03d971d9 2002-01-02 alex CHAR *ptr;
315 c7b55aa6 2002-10-09 alex LONG port;
316 03d971d9 2002-01-02 alex
317 03d971d9 2002-01-02 alex assert( Line > 0 );
318 03d971d9 2002-01-02 alex assert( Var != NULL );
319 03d971d9 2002-01-02 alex assert( Arg != NULL );
320 03d971d9 2002-01-02 alex
321 03d971d9 2002-01-02 alex if( strcasecmp( Var, "Name" ) == 0 )
322 03d971d9 2002-01-02 alex {
323 03d971d9 2002-01-02 alex /* Der Server-Name */
324 10363b39 2002-03-03 alex strncpy( Conf_ServerName, Arg, CLIENT_ID_LEN - 1 );
325 03d971d9 2002-01-02 alex Conf_ServerName[CLIENT_ID_LEN - 1] = '\0';
326 03d971d9 2002-01-02 alex return;
327 03d971d9 2002-01-02 alex }
328 03d971d9 2002-01-02 alex if( strcasecmp( Var, "Info" ) == 0 )
329 03d971d9 2002-01-02 alex {
330 03d971d9 2002-01-02 alex /* Server-Info-Text */
331 10363b39 2002-03-03 alex strncpy( Conf_ServerInfo, Arg, CLIENT_INFO_LEN - 1 );
332 03d971d9 2002-01-02 alex Conf_ServerInfo[CLIENT_INFO_LEN - 1] = '\0';
333 03d971d9 2002-01-02 alex return;
334 03d971d9 2002-01-02 alex }
335 ed406b4a 2002-01-03 alex if( strcasecmp( Var, "Password" ) == 0 )
336 ed406b4a 2002-01-03 alex {
337 10363b39 2002-03-03 alex /* Server-Passwort */
338 10363b39 2002-03-03 alex strncpy( Conf_ServerPwd, Arg, CLIENT_PASS_LEN - 1 );
339 ed406b4a 2002-01-03 alex Conf_ServerPwd[CLIENT_PASS_LEN - 1] = '\0';
340 b615d128 2002-09-16 alex return;
341 b615d128 2002-09-16 alex }
342 b615d128 2002-09-16 alex if( strcasecmp( Var, "AdminInfo1" ) == 0 )
343 b615d128 2002-09-16 alex {
344 b615d128 2002-09-16 alex /* Server-Info-Text */
345 b615d128 2002-09-16 alex strncpy( Conf_ServerAdmin1, Arg, CLIENT_INFO_LEN - 1 );
346 b615d128 2002-09-16 alex Conf_ServerAdmin1[CLIENT_INFO_LEN - 1] = '\0';
347 b615d128 2002-09-16 alex return;
348 b615d128 2002-09-16 alex }
349 b615d128 2002-09-16 alex if( strcasecmp( Var, "AdminInfo2" ) == 0 )
350 b615d128 2002-09-16 alex {
351 b615d128 2002-09-16 alex /* Server-Info-Text */
352 b615d128 2002-09-16 alex strncpy( Conf_ServerAdmin2, Arg, CLIENT_INFO_LEN - 1 );
353 b615d128 2002-09-16 alex Conf_ServerAdmin2[CLIENT_INFO_LEN - 1] = '\0';
354 b615d128 2002-09-16 alex return;
355 b615d128 2002-09-16 alex }
356 b615d128 2002-09-16 alex if( strcasecmp( Var, "AdminEMail" ) == 0 )
357 b615d128 2002-09-16 alex {
358 b615d128 2002-09-16 alex /* Server-Info-Text */
359 b615d128 2002-09-16 alex strncpy( Conf_ServerAdminMail, Arg, CLIENT_INFO_LEN - 1 );
360 b615d128 2002-09-16 alex Conf_ServerAdminMail[CLIENT_INFO_LEN - 1] = '\0';
361 ed406b4a 2002-01-03 alex return;
362 ed406b4a 2002-01-03 alex }
363 03d971d9 2002-01-02 alex if( strcasecmp( Var, "Ports" ) == 0 )
364 03d971d9 2002-01-02 alex {
365 03d971d9 2002-01-02 alex /* Ports, durch "," getrennt, auf denen der Server
366 03d971d9 2002-01-02 alex * Verbindungen annehmen soll */
367 03d971d9 2002-01-02 alex ptr = strtok( Arg, "," );
368 03d971d9 2002-01-02 alex while( ptr )
369 9856253d 2001-12-30 alex {
370 03d971d9 2002-01-02 alex ngt_TrimStr( ptr );
371 03d971d9 2002-01-02 alex port = atol( ptr );
372 f86083a0 2002-03-27 alex if( Conf_ListenPorts_Count + 1 > MAX_LISTEN_PORTS ) Config_Error( LOG_ERR, "Too many listen ports configured. Port %ld ignored.", port );
373 03d971d9 2002-01-02 alex else
374 03d971d9 2002-01-02 alex {
375 1c2d0ae5 2002-03-29 alex if( port > 0 && port < 0xFFFF ) Conf_ListenPorts[Conf_ListenPorts_Count++] = (UINT)port;
376 f86083a0 2002-03-27 alex else Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Illegal port number %ld!", NGIRCd_ConfFile, Line, port );
377 03d971d9 2002-01-02 alex }
378 03d971d9 2002-01-02 alex ptr = strtok( NULL, "," );
379 9856253d 2001-12-30 alex }
380 03d971d9 2002-01-02 alex return;
381 03d971d9 2002-01-02 alex }
382 03d971d9 2002-01-02 alex if( strcasecmp( Var, "MotdFile" ) == 0 )
383 03d971d9 2002-01-02 alex {
384 03d971d9 2002-01-02 alex /* Datei mit der "message of the day" (MOTD) */
385 10363b39 2002-03-03 alex strncpy( Conf_MotdFile, Arg, FNAME_LEN - 1 );
386 03d971d9 2002-01-02 alex Conf_MotdFile[FNAME_LEN - 1] = '\0';
387 03d971d9 2002-01-02 alex return;
388 03d971d9 2002-01-02 alex }
389 1c2d0ae5 2002-03-29 alex if( strcasecmp( Var, "ServerUID" ) == 0 )
390 1c2d0ae5 2002-03-29 alex {
391 1c2d0ae5 2002-03-29 alex /* UID, mit der der Daemon laufen soll */
392 ae39724a 2002-11-08 alex pwd = getpwnam( Arg );
393 ae39724a 2002-11-08 alex if( pwd ) Conf_UID = pwd->pw_uid;
394 ae39724a 2002-11-08 alex else Conf_UID = (UINT)atoi( Arg );
395 1c2d0ae5 2002-03-29 alex return;
396 1c2d0ae5 2002-03-29 alex }
397 1c2d0ae5 2002-03-29 alex if( strcasecmp( Var, "ServerGID" ) == 0 )
398 1c2d0ae5 2002-03-29 alex {
399 1c2d0ae5 2002-03-29 alex /* GID, mit der der Daemon laufen soll */
400 ae39724a 2002-11-08 alex grp = getgrnam( Arg );
401 ae39724a 2002-11-08 alex if( grp ) Conf_GID = grp->gr_gid;
402 ae39724a 2002-11-08 alex else Conf_GID = (UINT)atoi( Arg );
403 1c2d0ae5 2002-03-29 alex return;
404 1c2d0ae5 2002-03-29 alex }
405 03d971d9 2002-01-02 alex if( strcasecmp( Var, "PingTimeout" ) == 0 )
406 03d971d9 2002-01-02 alex {
407 03d971d9 2002-01-02 alex /* PING-Timeout */
408 03d971d9 2002-01-02 alex Conf_PingTimeout = atoi( Arg );
409 03d971d9 2002-01-02 alex if(( Conf_PingTimeout ) < 5 ) Conf_PingTimeout = 5;
410 03d971d9 2002-01-02 alex return;
411 03d971d9 2002-01-02 alex }
412 03d971d9 2002-01-02 alex if( strcasecmp( Var, "PongTimeout" ) == 0 )
413 03d971d9 2002-01-02 alex {
414 03d971d9 2002-01-02 alex /* PONG-Timeout */
415 03d971d9 2002-01-02 alex Conf_PongTimeout = atoi( Arg );
416 03d971d9 2002-01-02 alex if(( Conf_PongTimeout ) < 5 ) Conf_PongTimeout = 5;
417 03d971d9 2002-01-02 alex return;
418 03d971d9 2002-01-02 alex }
419 03d971d9 2002-01-02 alex if( strcasecmp( Var, "ConnectRetry" ) == 0 )
420 03d971d9 2002-01-02 alex {
421 03d971d9 2002-01-02 alex /* Sekunden zwischen Verbindungsversuchen zu anderen Servern */
422 03d971d9 2002-01-02 alex Conf_ConnectRetry = atoi( Arg );
423 03d971d9 2002-01-02 alex if(( Conf_ConnectRetry ) < 5 ) Conf_ConnectRetry = 5;
424 7e1b3b91 2002-09-02 alex return;
425 7e1b3b91 2002-09-02 alex }
426 7e1b3b91 2002-09-02 alex if( strcasecmp( Var, "OperCanUseMode" ) == 0 )
427 7e1b3b91 2002-09-02 alex {
428 7e1b3b91 2002-09-02 alex /* Koennen IRC-Operatoren immer MODE benutzen? */
429 7e1b3b91 2002-09-02 alex if( strcasecmp( Arg, "yes" ) == 0 ) Conf_OperCanMode = TRUE;
430 7e1b3b91 2002-09-02 alex else if( strcasecmp( Arg, "true" ) == 0 ) Conf_OperCanMode = TRUE;
431 7e1b3b91 2002-09-02 alex else if( atoi( Arg ) != 0 ) Conf_OperCanMode = TRUE;
432 7e1b3b91 2002-09-02 alex else Conf_OperCanMode = FALSE;
433 03d971d9 2002-01-02 alex return;
434 03d971d9 2002-01-02 alex }
435 0d32a3b4 2002-11-02 alex if( strcasecmp( Var, "MaxConnections" ) == 0 )
436 0d32a3b4 2002-11-02 alex {
437 0d32a3b4 2002-11-02 alex /* Maximale Anzahl von Verbindungen. Werte <= 0 stehen
438 0d32a3b4 2002-11-02 alex * fuer "kein Limit". */
439 0d32a3b4 2002-11-02 alex Conf_MaxConnections = atol( Arg );
440 0d32a3b4 2002-11-02 alex return;
441 0d32a3b4 2002-11-02 alex }
442 9856253d 2001-12-30 alex
443 f86083a0 2002-03-27 alex Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Unknown variable \"%s\"!", NGIRCd_ConfFile, Line, Var );
444 03d971d9 2002-01-02 alex } /* Handle_GLOBAL */
445 03d971d9 2002-01-02 alex
446 03d971d9 2002-01-02 alex
447 c2f60abe 2002-05-27 alex LOCAL VOID
448 c2f60abe 2002-05-27 alex Handle_OPERATOR( INT Line, CHAR *Var, CHAR *Arg )
449 03d971d9 2002-01-02 alex {
450 03d971d9 2002-01-02 alex assert( Line > 0 );
451 03d971d9 2002-01-02 alex assert( Var != NULL );
452 03d971d9 2002-01-02 alex assert( Arg != NULL );
453 03d971d9 2002-01-02 alex assert( Conf_Oper_Count > 0 );
454 03d971d9 2002-01-02 alex
455 03d971d9 2002-01-02 alex if( strcasecmp( Var, "Name" ) == 0 )
456 03d971d9 2002-01-02 alex {
457 03d971d9 2002-01-02 alex /* Name des IRC Operator */
458 b615d128 2002-09-16 alex strncpy( Conf_Oper[Conf_Oper_Count - 1].name, Arg, CLIENT_PASS_LEN - 1 );
459 b615d128 2002-09-16 alex Conf_Oper[Conf_Oper_Count - 1].name[CLIENT_PASS_LEN - 1] = '\0';
460 03d971d9 2002-01-02 alex return;
461 9856253d 2001-12-30 alex }
462 03d971d9 2002-01-02 alex if( strcasecmp( Var, "Password" ) == 0 )
463 03d971d9 2002-01-02 alex {
464 03d971d9 2002-01-02 alex /* Passwort des IRC Operator */
465 10363b39 2002-03-03 alex strncpy( Conf_Oper[Conf_Oper_Count - 1].pwd, Arg, CLIENT_PASS_LEN - 1 );
466 03d971d9 2002-01-02 alex Conf_Oper[Conf_Oper_Count - 1].pwd[CLIENT_PASS_LEN - 1] = '\0';
467 03d971d9 2002-01-02 alex return;
468 03d971d9 2002-01-02 alex }
469 574ae82c 2001-12-26 alex
470 f86083a0 2002-03-27 alex Config_Error( LOG_ERR, "%s, line %d (section \"Operator\"): Unknown variable \"%s\"!", NGIRCd_ConfFile, Line, Var );
471 03d971d9 2002-01-02 alex } /* Handle_OPERATOR */
472 574ae82c 2001-12-26 alex
473 574ae82c 2001-12-26 alex
474 c2f60abe 2002-05-27 alex LOCAL VOID
475 c2f60abe 2002-05-27 alex Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg )
476 03d971d9 2002-01-02 alex {
477 c7b55aa6 2002-10-09 alex LONG port;
478 03d971d9 2002-01-02 alex
479 03d971d9 2002-01-02 alex assert( Line > 0 );
480 03d971d9 2002-01-02 alex assert( Var != NULL );
481 03d971d9 2002-01-02 alex assert( Arg != NULL );
482 03d971d9 2002-01-02 alex
483 03d971d9 2002-01-02 alex if( strcasecmp( Var, "Host" ) == 0 )
484 03d971d9 2002-01-02 alex {
485 03d971d9 2002-01-02 alex /* Hostname des Servers */
486 10363b39 2002-03-03 alex strncpy( Conf_Server[Conf_Server_Count - 1].host, Arg, HOST_LEN - 1 );
487 03d971d9 2002-01-02 alex Conf_Server[Conf_Server_Count - 1].host[HOST_LEN - 1] = '\0';
488 03d971d9 2002-01-02 alex return;
489 03d971d9 2002-01-02 alex }
490 03d971d9 2002-01-02 alex if( strcasecmp( Var, "Name" ) == 0 )
491 03d971d9 2002-01-02 alex {
492 03d971d9 2002-01-02 alex /* Name des Servers ("Nick") */
493 10363b39 2002-03-03 alex strncpy( Conf_Server[Conf_Server_Count - 1].name, Arg, CLIENT_ID_LEN - 1 );
494 2e289b50 2002-01-05 alex Conf_Server[Conf_Server_Count - 1].name[CLIENT_ID_LEN - 1] = '\0';
495 03d971d9 2002-01-02 alex return;
496 03d971d9 2002-01-02 alex }
497 b2615bcc 2002-11-19 alex if( strcasecmp( Var, "MyPassword" ) == 0 )
498 03d971d9 2002-01-02 alex {
499 b2615bcc 2002-11-19 alex /* Passwort dieses Servers, welches empfangen werden muss */
500 b2615bcc 2002-11-19 alex strncpy( Conf_Server[Conf_Server_Count - 1].pwd_in, Arg, CLIENT_PASS_LEN - 1 );
501 b2615bcc 2002-11-19 alex Conf_Server[Conf_Server_Count - 1].pwd_in[CLIENT_PASS_LEN - 1] = '\0';
502 03d971d9 2002-01-02 alex return;
503 03d971d9 2002-01-02 alex }
504 b2615bcc 2002-11-19 alex if( strcasecmp( Var, "PeerPassword" ) == 0 )
505 b2615bcc 2002-11-19 alex {
506 b2615bcc 2002-11-19 alex /* Passwort des anderen Servers, welches gesendet werden muss */
507 b2615bcc 2002-11-19 alex strncpy( Conf_Server[Conf_Server_Count - 1].pwd_out, Arg, CLIENT_PASS_LEN - 1 );
508 b2615bcc 2002-11-19 alex Conf_Server[Conf_Server_Count - 1].pwd_out[CLIENT_PASS_LEN - 1] = '\0';
509 b2615bcc 2002-11-19 alex return;
510 b2615bcc 2002-11-19 alex }
511 03d971d9 2002-01-02 alex if( strcasecmp( Var, "Port" ) == 0 )
512 03d971d9 2002-01-02 alex {
513 03d971d9 2002-01-02 alex /* Port, zu dem Verbunden werden soll */
514 03d971d9 2002-01-02 alex port = atol( Arg );
515 d67d94ea 2002-03-10 alex if( port > 0 && port < 0xFFFF ) Conf_Server[Conf_Server_Count - 1].port = (INT)port;
516 f86083a0 2002-03-27 alex else Config_Error( LOG_ERR, "%s, line %d (section \"Server\"): Illegal port number %ld!", NGIRCd_ConfFile, Line, port );
517 03d971d9 2002-01-02 alex return;
518 03d971d9 2002-01-02 alex }
519 d67d94ea 2002-03-10 alex if( strcasecmp( Var, "Group" ) == 0 )
520 d67d94ea 2002-03-10 alex {
521 d67d94ea 2002-03-10 alex /* Server-Gruppe */
522 d67d94ea 2002-03-10 alex Conf_Server[Conf_Server_Count - 1].group = atoi( Arg );
523 d67d94ea 2002-03-10 alex return;
524 d67d94ea 2002-03-10 alex }
525 03d971d9 2002-01-02 alex
526 f86083a0 2002-03-27 alex Config_Error( LOG_ERR, "%s, line %d (section \"Server\"): Unknown variable \"%s\"!", NGIRCd_ConfFile, Line, Var );
527 03d971d9 2002-01-02 alex } /* Handle_SERVER */
528 040f5422 2002-05-21 alex
529 040f5422 2002-05-21 alex
530 c2f60abe 2002-05-27 alex LOCAL VOID
531 c2f60abe 2002-05-27 alex Handle_CHANNEL( INT Line, CHAR *Var, CHAR *Arg )
532 040f5422 2002-05-21 alex {
533 040f5422 2002-05-21 alex assert( Line > 0 );
534 040f5422 2002-05-21 alex assert( Var != NULL );
535 040f5422 2002-05-21 alex assert( Arg != NULL );
536 03d971d9 2002-01-02 alex
537 040f5422 2002-05-21 alex if( strcasecmp( Var, "Name" ) == 0 )
538 040f5422 2002-05-21 alex {
539 040f5422 2002-05-21 alex /* Hostname des Servers */
540 040f5422 2002-05-21 alex strncpy( Conf_Channel[Conf_Channel_Count - 1].name, Arg, CHANNEL_NAME_LEN - 1 );
541 040f5422 2002-05-21 alex Conf_Channel[Conf_Channel_Count - 1].name[CHANNEL_NAME_LEN - 1] = '\0';
542 040f5422 2002-05-21 alex return;
543 040f5422 2002-05-21 alex }
544 040f5422 2002-05-21 alex if( strcasecmp( Var, "Modes" ) == 0 )
545 040f5422 2002-05-21 alex {
546 040f5422 2002-05-21 alex /* Name des Servers ("Nick") */
547 040f5422 2002-05-21 alex strncpy( Conf_Channel[Conf_Channel_Count - 1].modes, Arg, CHANNEL_MODE_LEN - 1 );
548 040f5422 2002-05-21 alex Conf_Channel[Conf_Channel_Count - 1].modes[CHANNEL_MODE_LEN - 1] = '\0';
549 040f5422 2002-05-21 alex return;
550 040f5422 2002-05-21 alex }
551 040f5422 2002-05-21 alex if( strcasecmp( Var, "Topic" ) == 0 )
552 040f5422 2002-05-21 alex {
553 040f5422 2002-05-21 alex /* Passwort des Servers */
554 040f5422 2002-05-21 alex strncpy( Conf_Channel[Conf_Channel_Count - 1].topic, Arg, CHANNEL_TOPIC_LEN - 1 );
555 040f5422 2002-05-21 alex Conf_Channel[Conf_Channel_Count - 1].topic[CHANNEL_TOPIC_LEN - 1] = '\0';
556 040f5422 2002-05-21 alex return;
557 040f5422 2002-05-21 alex }
558 03d971d9 2002-01-02 alex
559 040f5422 2002-05-21 alex Config_Error( LOG_ERR, "%s, line %d (section \"Channel\"): Unknown variable \"%s\"!", NGIRCd_ConfFile, Line, Var );
560 040f5422 2002-05-21 alex } /* Handle_CHANNEL */
561 040f5422 2002-05-21 alex
562 040f5422 2002-05-21 alex
563 c2f60abe 2002-05-27 alex LOCAL VOID
564 c2f60abe 2002-05-27 alex Validate_Config( VOID )
565 9856253d 2001-12-30 alex {
566 9856253d 2001-12-30 alex /* Konfiguration ueberpruefen */
567 9856253d 2001-12-30 alex
568 9856253d 2001-12-30 alex if( ! Conf_ServerName[0] )
569 9856253d 2001-12-30 alex {
570 9856253d 2001-12-30 alex /* Kein Servername konfiguriert */
571 b615d128 2002-09-16 alex Config_Error( LOG_ALERT, "No server name configured in \"%s\" ('ServerName')!", NGIRCd_ConfFile );
572 f7327524 2002-05-30 alex Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
573 9856253d 2001-12-30 alex exit( 1 );
574 9856253d 2001-12-30 alex }
575 b615d128 2002-09-16 alex
576 b615d128 2002-09-16 alex #ifdef STRICT_RFC
577 12cad28e 2002-10-21 alex if( ! Conf_ServerAdminMail[0] )
578 b615d128 2002-09-16 alex {
579 b615d128 2002-09-16 alex /* Keine Server-Information konfiguriert */
580 b615d128 2002-09-16 alex Config_Error( LOG_ALERT, "No administrator email address configured in \"%s\" ('AdminEMail')!", NGIRCd_ConfFile );
581 b615d128 2002-09-16 alex Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
582 b615d128 2002-09-16 alex exit( 1 );
583 b615d128 2002-09-16 alex }
584 b615d128 2002-09-16 alex #endif
585 b615d128 2002-09-16 alex
586 33bda862 2002-09-19 alex if( ! Conf_ServerAdmin1[0] && ! Conf_ServerAdmin2[0] && ! Conf_ServerAdminMail[0] )
587 b615d128 2002-09-16 alex {
588 b615d128 2002-09-16 alex /* Keine Server-Information konfiguriert */
589 b615d128 2002-09-16 alex Log( LOG_WARNING, "No server information configured but required by RFC!" );
590 b615d128 2002-09-16 alex }
591 9856253d 2001-12-30 alex } /* Validate_Config */
592 9856253d 2001-12-30 alex
593 f86083a0 2002-03-27 alex
594 f7327524 2002-05-30 alex #ifdef PROTOTYPES
595 f7327524 2002-05-30 alex LOCAL VOID Config_Error( CONST INT Level, CONST CHAR *Format, ... )
596 f7327524 2002-05-30 alex #else
597 f7327524 2002-05-30 alex LOCAL VOID Config_Error( Level, Format, va_alist )
598 f7327524 2002-05-30 alex CONST INT Level;
599 f7327524 2002-05-30 alex CONST CHAR *Format;
600 f7327524 2002-05-30 alex va_dcl
601 f7327524 2002-05-30 alex #endif
602 f86083a0 2002-03-27 alex {
603 f86083a0 2002-03-27 alex /* Fehler! Auf Console und/oder ins Log schreiben */
604 f86083a0 2002-03-27 alex
605 f86083a0 2002-03-27 alex CHAR msg[MAX_LOG_MSG_LEN];
606 f86083a0 2002-03-27 alex va_list ap;
607 f86083a0 2002-03-27 alex
608 f86083a0 2002-03-27 alex assert( Format != NULL );
609 f86083a0 2002-03-27 alex
610 f86083a0 2002-03-27 alex /* String mit variablen Argumenten zusammenbauen ... */
611 f7327524 2002-05-30 alex #ifdef PROTOTYPES
612 f86083a0 2002-03-27 alex va_start( ap, Format );
613 f7327524 2002-05-30 alex #else
614 f7327524 2002-05-30 alex va_start( ap );
615 f7327524 2002-05-30 alex #endif
616 f86083a0 2002-03-27 alex vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap );
617 f86083a0 2002-03-27 alex va_end( ap );
618 f86083a0 2002-03-27 alex
619 f86083a0 2002-03-27 alex /* Im "normalen Betrieb" soll der Log-Mechanismus des ngIRCd verwendet
620 f86083a0 2002-03-27 alex * werden, beim Testen der Konfiguration jedoch nicht, hier sollen alle
621 f86083a0 2002-03-27 alex * Meldungen direkt auf die Konsole ausgegeben werden: */
622 ec474a4b 2002-10-04 alex if( Use_Log ) Log( Level, "%s", msg );
623 f86083a0 2002-03-27 alex else puts( msg );
624 f86083a0 2002-03-27 alex } /* Config_Error */
625 f86083a0 2002-03-27 alex
626 f86083a0 2002-03-27 alex
627 cbc1e59f 2001-12-12 alex /* -eof- */