[Spread-cvs] cvs commit: spread/daemon Readme.txt config_parse.y
jonathan at spread.org
jonathan at spread.org
Mon Jan 26 16:05:18 EST 2004
jonathan 04/01/26 16:05:18
Modified: daemon Readme.txt config_parse.y
Log:
Add verification that all daemon names specified in the spread.conf are
unique. If non-unique name is found, reject the configuration. This should
not break any working setups as non-unique daemon names should never have
worked correctly. It is just checked for at start now. Suggested by Tim Peters.
Revision Changes Path
1.42 +3 -0 spread/daemon/Readme.txt
Index: Readme.txt
===================================================================
RCS file: /storage/cvsroot/spread/daemon/Readme.txt,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- Readme.txt 25 Jan 2004 23:03:17 -0000 1.41
+++ Readme.txt 26 Jan 2004 21:05:18 -0000 1.42
@@ -64,6 +64,9 @@
singleton daemon sends a large broadcast. Reported by David Shaw.
*) Fix bus errors on Sparc & Alpha for message buffer integer assignment.
Reported by Greg Shebert and Mikhail Terekhov.
+*) Verify daemon names in spread.conf are unique. If non-unique names are
+ provided in spread.conf, configuration will be rejected and daemon will
+ not start. Suggested by Tim Peters.
June 20, 2003 Ver 3.17.1
----------------------------
1.11 +23 -0 spread/daemon/config_parse.y
Index: config_parse.y
===================================================================
RCS file: /storage/cvsroot/spread/daemon/config_parse.y,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- config_parse.y 12 Nov 2003 22:11:03 -0000 1.10
+++ config_parse.y 26 Jan 2004 21:05:18 -0000 1.11
@@ -148,10 +148,33 @@
out_string[str_size-1] = '\0';
}
+static int get_parsed_proc_info( char *name, proc *p )
+{
+ int i;
+
+ for ( i=0; i < num_procs; i++ )
+ {
+ if ( strcmp( Config_procs[i].name, name ) == 0 )
+ {
+ *p = Config_procs[i];
+ return( i );
+ }
+ }
+ return( -1 );
+}
+
+
#define PROC_NAME_CHECK( stoken ) { \
char strbuf[80]; \
+ int ret; \
+ proc p; \
if ( strlen((stoken)) >= MAX_PROC_NAME ) { \
snprintf(strbuf, 80, "Too long name(%d max): %s)\n", MAX_PROC_NAME, (stoken)); \
+ return (yyerror(strbuf)); \
+ } \
+ ret = get_parsed_proc_info( stoken, &p ); \
+ if (ret >= 0) { \
+ snprintf(strbuf, 80, "Name not unique. name: %s equals (%s, %d.%d.%d.%d)\n", (stoken), p.name, IP1(p.id), IP2(p.id), IP3(p.id), IP4(p.id) ); \
return (yyerror(strbuf)); \
} \
}
More information about the Spread-cvs
mailing list