mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-31 22:13:00 +00:00 
			
		
		
		
	- neue Konfigurations-Variablen ServerUID und ServerGID.
This commit is contained in:
		| @@ -9,7 +9,7 @@ | |||||||
|  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste |  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste | ||||||
|  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. |  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. | ||||||
|  * |  * | ||||||
|  * $Id: conf.c,v 1.21 2002/03/27 16:39:22 alex Exp $ |  * $Id: conf.c,v 1.22 2002/03/29 23:33:05 alex Exp $ | ||||||
|  * |  * | ||||||
|  * conf.h: Konfiguration des ngircd |  * conf.h: Konfiguration des ngircd | ||||||
|  */ |  */ | ||||||
| @@ -62,7 +62,7 @@ GLOBAL INT Conf_Test( VOID ) | |||||||
| { | { | ||||||
| 	/* Konfiguration einlesen, ueberpruefen und ausgeben. */ | 	/* Konfiguration einlesen, ueberpruefen und ausgeben. */ | ||||||
|  |  | ||||||
| 	INT i; | 	UINT i; | ||||||
|  |  | ||||||
| 	Use_Log = FALSE; | 	Use_Log = FALSE; | ||||||
| 	Set_Defaults( ); | 	Set_Defaults( ); | ||||||
| @@ -87,10 +87,11 @@ GLOBAL INT Conf_Test( VOID ) | |||||||
| 	for( i = 0; i < Conf_ListenPorts_Count; i++ ) | 	for( i = 0; i < Conf_ListenPorts_Count; i++ ) | ||||||
| 	{ | 	{ | ||||||
| 		if( i != 0 ) printf( ", " ); | 		if( i != 0 ) printf( ", " ); | ||||||
| 		printf( "%d", Conf_ListenPorts[i] ); | 		printf( "%u", Conf_ListenPorts[i] ); | ||||||
| 	} | 	} | ||||||
| 	if( Conf_ListenPorts_Count < 1 ) puts( "<none>"); | 	puts( "" ); | ||||||
| 	else puts( "" ); | 	printf( "  ServerUID = %ld\n", (INT32)Conf_UID ); | ||||||
|  | 	printf( "  ServerGID = %ld\n", (INT32)Conf_GID ); | ||||||
| 	printf( "  PingTimeout = %d\n", Conf_PingTimeout ); | 	printf( "  PingTimeout = %d\n", Conf_PingTimeout ); | ||||||
| 	printf( "  PongTimeout = %d\n", Conf_PongTimeout ); | 	printf( "  PongTimeout = %d\n", Conf_PongTimeout ); | ||||||
| 	printf( "  ConnectRetry = %d\n", Conf_ConnectRetry ); | 	printf( "  ConnectRetry = %d\n", Conf_ConnectRetry ); | ||||||
| @@ -136,6 +137,8 @@ LOCAL VOID Set_Defaults( VOID ) | |||||||
| 	strcpy( Conf_MotdFile, MOTD_FILE ); | 	strcpy( Conf_MotdFile, MOTD_FILE ); | ||||||
|  |  | ||||||
| 	Conf_ListenPorts_Count = 0; | 	Conf_ListenPorts_Count = 0; | ||||||
|  |  | ||||||
|  | 	Conf_UID = Conf_GID = 0; | ||||||
| 	 | 	 | ||||||
| 	Conf_PingTimeout = 120; | 	Conf_PingTimeout = 120; | ||||||
| 	Conf_PongTimeout = 20; | 	Conf_PongTimeout = 20; | ||||||
| @@ -279,7 +282,7 @@ GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg ) | |||||||
| 			if( Conf_ListenPorts_Count + 1 > MAX_LISTEN_PORTS ) Config_Error( LOG_ERR, "Too many listen ports configured. Port %ld ignored.", port ); | 			if( Conf_ListenPorts_Count + 1 > MAX_LISTEN_PORTS ) Config_Error( LOG_ERR, "Too many listen ports configured. Port %ld ignored.", port ); | ||||||
| 			else | 			else | ||||||
| 			{ | 			{ | ||||||
| 				if( port > 0 && port < 0xFFFF ) Conf_ListenPorts[Conf_ListenPorts_Count++] = (INT)port; | 				if( port > 0 && port < 0xFFFF ) Conf_ListenPorts[Conf_ListenPorts_Count++] = (UINT)port; | ||||||
| 				else Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Illegal port number %ld!", NGIRCd_ConfFile, Line, port ); | 				else Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Illegal port number %ld!", NGIRCd_ConfFile, Line, port ); | ||||||
| 			} | 			} | ||||||
| 			ptr = strtok( NULL, "," ); | 			ptr = strtok( NULL, "," ); | ||||||
| @@ -293,6 +296,18 @@ GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg ) | |||||||
| 		Conf_MotdFile[FNAME_LEN - 1] = '\0'; | 		Conf_MotdFile[FNAME_LEN - 1] = '\0'; | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
|  | 	if( strcasecmp( Var, "ServerUID" ) == 0 ) | ||||||
|  | 	{ | ||||||
|  | 		/* UID, mit der der Daemon laufen soll */ | ||||||
|  | 		Conf_UID = (UINT)atoi( Arg ); | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
|  | 	if( strcasecmp( Var, "ServerGID" ) == 0 ) | ||||||
|  | 	{ | ||||||
|  | 		/* GID, mit der der Daemon laufen soll */ | ||||||
|  | 		Conf_GID = (UINT)atoi( Arg ); | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
| 	if( strcasecmp( Var, "PingTimeout" ) == 0 ) | 	if( strcasecmp( Var, "PingTimeout" ) == 0 ) | ||||||
| 	{ | 	{ | ||||||
| 		/* PING-Timeout */ | 		/* PING-Timeout */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Alexander Barton
					Alexander Barton