[NeoStats-Devel] [Commits] r2679 - in trunk: . include src

[email protected]
Newsgroups gmane.comp.neostats.devel
Message-ID <[email protected]>
Author: Mark
Date: Wed Jul 20 04:39:47 2005
New Revision: 2679

Modified:
   trunk/include/neostats.h
   trunk/makeconf
   trunk/src/auth.c
   trunk/src/conf.c
   trunk/src/sock.c
Log:
update serviceroot config to reflect singular nature

Modified: trunk/include/neostats.h
==============================================================================
--- trunk/include/neostats.h	(original)
+++ trunk/include/neostats.h	Wed Jul 20 04:39:47 2005
@@ -397,12 +397,12 @@
 #define MAXINFO			128
 #define B64SIZE			16
 
-#define KEYLEN		(32 + 1)
+#define KEYLEN			(32 + 1)
 
 /* MAXCHANLENLIST
  * the max length a string can be that holds channel lists 
  */
-#define MAXCHANLENLIST		1024 
+#define MAXCHANLENLIST	1024 
 
 /* MAXPATH 
  * used to determine buffer sizes for file system operations
@@ -439,7 +439,7 @@
 
 #define IsNeoStatsSynched()		me.synched
 
-#define IsModuleSynched()	GET_CUR_MODULE()->synched
+#define IsModuleSynched()		GET_CUR_MODULE()->synched
 
 /* Unified return values and error system */
 
@@ -495,21 +495,21 @@
 
 
 /* NeoStats levels */
-#define NS_ULEVEL_ROOT	200
-#define NS_ULEVEL_ADMIN	185
-#define NS_ULEVEL_OPER	50
-#define NS_ULEVEL_LOCOPER 40
-#define NS_ULEVEL_REG	10
+#define NS_ULEVEL_ROOT		200
+#define NS_ULEVEL_ADMIN		185
+#define NS_ULEVEL_OPER		50
+#define NS_ULEVEL_LOCOPER	40
+#define NS_ULEVEL_REG		10
 
 /* transfer stuff */
 typedef enum NS_TRANSFER {
-	NS_FILE=0,
-	NS_MEMORY=1,
+	NS_FILE = 0,
+	NS_MEMORY,
 } NS_TRANSFER;
 
 #define SEGV_LOCATION_BUFSIZE	255
-#define SET_SEGV_LOCATION() ircsnprintf(segv_location,SEGV_LOCATION_BUFSIZE,"%s %d %s", __FILE__, __LINE__, __PRETTY_FUNCTION__ ); 
-#define SET_SEGV_LOCATION_EXTRA(debug_text) ircsnprintf(segv_location,SEGV_LOCATION_BUFSIZE,"%s %d %s %s", __FILE__, __LINE__, __PRETTY_FUNCTION__,(debug_text) ); 
+#define SET_SEGV_LOCATION() ircsnprintf( segv_location, SEGV_LOCATION_BUFSIZE, "%s %d %s", __FILE__, __LINE__, __PRETTY_FUNCTION__ ); 
+#define SET_SEGV_LOCATION_EXTRA( debug_text ) ircsnprintf( segv_location, SEGV_LOCATION_BUFSIZE, "%s %d %s %s", __FILE__, __LINE__, __PRETTY_FUNCTION__, (debug_text) ); 
 #define CLEAR_SEGV_LOCATION() segv_location[0]='\0';
 
 EXPORTVAR extern char segv_location[SEGV_LOCATION_BUFSIZE];

Modified: trunk/makeconf
==============================================================================
--- trunk/makeconf	(original)
+++ trunk/makeconf	Wed Jul 20 04:39:47 2005
@@ -564,7 +564,7 @@
 ########################################
 
 
-ServiceRoots {
+ServiceRoot {
 #MASK="<nick!ident@host>" [REQUIRED]
 #    Who should get master access to manage NeoStats regardless of 
 #    authentication systems. Only one entry allowed. e.g.

Modified: trunk/src/auth.c
==============================================================================
--- trunk/src/auth.c	(original)
+++ trunk/src/auth.c	Wed Jul 20 04:39:47 2005
@@ -66,9 +66,8 @@
 	if( ( match( nsconfig.rootuser.nick, u->name ) ) &&
 		( match( nsconfig.rootuser.user, u->user->username ) ) &&
 		( match( nsconfig.rootuser.host, u->user->hostname ) ||
-		  match( nsconfig.rootuser.host, u->hostip ) ) ) {
+		  match( nsconfig.rootuser.host, u->hostip ) ) )
 		return NS_TRUE;
-	}
 	return NS_FALSE;
 }
 
@@ -91,25 +90,23 @@
 #ifdef DEBUG
 #ifdef CODERHACK
 	/* See comments at top of file */
-	if( !ircstrcasecmp( u->name, CODERHACK ) ) {
+	if( !ircstrcasecmp( u->name, CODERHACK ) )
 		return NS_ULEVEL_ROOT;
-	} else
 #endif /* CODERHACK */
 #endif /* DEBUG */
 	/* Check for master service root first */
-	if( IsServiceRoot( u ) ) {
+	if( IsServiceRoot( u ) )
 		return NS_ULEVEL_ROOT;
-	} 
 	/* Run through list of authentication modules */
 	for( i = 0; i < NUM_MODULES; i++ )
 	{
-		if( AuthModList[i] ) {
+		if( AuthModList[i] )
+		{
 			/* Get auth level */
 			authlvl = AuthModList[i]->userauth( u );
 			/* if authlvl is greater than newauthlvl, use it */
-			if( authlvl > newauthlvl ) {
+			if( authlvl > newauthlvl )
 				newauthlvl = authlvl;
-			}
 		}
 	}
 	/* Return calculated auth level */

Modified: trunk/src/conf.c
==============================================================================
--- trunk/src/conf.c	(original)
+++ trunk/src/conf.c	Wed Jul 20 04:39:47 2005
@@ -91,7 +91,7 @@
 	CFG_END()
 };
 
-cfg_opt_t serviceroots[] = {
+cfg_opt_t serviceroot[] = {
 	CFG_STR ("Mask", 0, CFGF_NONE),
 	CFG_END()
 };
@@ -110,7 +110,7 @@
 #else /* 0 */
 	CFG_SEC ("Servers", servers, CFGF_NONE),
 #endif /* 0 */
-	CFG_SEC ("ServiceRoots", serviceroots, CFGF_NONE),
+	CFG_SEC ("ServiceRoot", serviceroot, CFGF_NONE),
 	CFG_SEC ("Modules", modules, CFGF_NONE),
 	CFG_END()
 };
@@ -138,8 +138,7 @@
  * @returns nothing
  */
 
-int
-ConfLoad (void)
+int ConfLoad( void )
 {
 	cfg_t *cfg;
 	int i, ret;
@@ -227,12 +226,12 @@
 	me.numeric = cfg_getint (cfg, "ServerConfig|ServerNumeric");
 	/* has a default */
 	nsconfig.setservertimes = cfg_getint (cfg, "Options|ServerSettime") * 60 * 60;
-	/* serviceroots has no default */
-	if (cfg_size (cfg, "ServiceRoots|Mask") > 0) {
+	/* serviceroot has no default */
+	if (cfg_size (cfg, "ServiceRoot|Mask") > 0) {
 		char *nick, *user , *host, *arg;
 
 		/* already validate */
-		arg = cfg_getstr (cfg, "ServiceRoots|Mask");
+		arg = cfg_getstr (cfg, "ServiceRoot|Mask");
 		if( arg )
 		{
 			nick = strtok (arg, "!");
@@ -280,21 +279,19 @@
 	if( load_mods[0] == 0 )
 	{
 		nlog( LOG_NORMAL, "No modules configured for loading" );
+		return;
 	}
-	else
+	nlog( LOG_NORMAL, "Loading configured modules" );
+	for( i = 0; ( i < NUM_MODULES ) && ( load_mods[i] != 0 ); i++ )
 	{
-		nlog( LOG_NORMAL, "Loading configured modules" );
-		for( i = 0; ( i < NUM_MODULES ) && ( load_mods[i] != 0 ); i++ )
-		{
-			dlog( DEBUG1, "ConfLoadModules: Loading Module %s", ( char * ) load_mods[i] );
-			if( ns_load_module( load_mods[i], NULL ) )
-				nlog( LOG_NORMAL, "Loaded module %s", ( char * ) load_mods[i] );
-			else
-				nlog( LOG_WARNING, "Failed to load module %s. Please check above error messages", ( char * ) load_mods[i] );
-			ns_free (load_mods[i]);
-		}
-		nlog( LOG_NORMAL, "Completed loading configured modules" );
+		dlog( DEBUG1, "ConfLoadModules: Loading Module %s", ( char * ) load_mods[i] );
+		if( ns_load_module( load_mods[i], NULL ) )
+			nlog( LOG_NORMAL, "Loaded module %s", ( char * ) load_mods[i] );
+		else
+			nlog( LOG_WARNING, "Failed to load module %s. Please check above error messages", ( char * ) load_mods[i] );
+		ns_free (load_mods[i]);
 	}
+	nlog( LOG_NORMAL, "Completed loading configured modules" );
 	return;
 }
 

Modified: trunk/src/sock.c
==============================================================================
--- trunk/src/sock.c	(original)
+++ trunk/src/sock.c	Wed Jul 20 04:39:47 2005
@@ -29,7 +29,7 @@
 #include "main.h"
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h> 
-#endif
+#endif /* HAVE_FCNTL_H */
 #include "timer.h"
 #include "dns.h"
 #include "transfer.h"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.