[Spread-users] [PATCH] sample.spread.conf lists bogus options for SocketPortReuse
Daniel Rall
dlr at finemaltcoding.com
Tue Oct 1 12:16:21 EDT 2002
Because of the portability changes Jonathan made to config_gram.l and
config_parse.y, uppercase values for the SocketPortReuse configuration
parameter are no longer recogized as valid, and produce the following
error from spread:
-------------------------------------------
Parser error on or before line 72
Error type; syntax error
Offending token: ON
The following patch updates the documented valid options from
sample.spread.conf to reflect the new reality:
Index: sample.spread.conf
===================================================================
RCS file: /storage/cvsroot/spread/daemon/sample.spread.conf,v
retrieving revision 1.5
diff -u -u -r1.5 sample.spread.conf
--- sample.spread.conf 17 Sep 2002 23:45:46 -0000 1.5
+++ sample.spread.conf 1 Oct 2002 16:08:44 -0000
@@ -79,12 +79,12 @@
# often hold onto the interface/port combination for a short period of time
# after daemon shut down).
#
-# AUTO - Active when bound to specific interfaces (default).
-# ON - Always active, regardless of interface.
+# auto - Active when bound to specific interfaces (default).
+# on - Always active, regardless of interface.
# SECURITY RISK FOR ANY OS WHICH ALLOW DOUBLE BINDS BY DIFFERENT USERS
-# OFF - Always off.
+# off - Always off.
-#SocketPortReuse = AUTO
+#SocketPortReuse = auto
#Sets the runtime directory used when the Spread daemon is run as root
# as the directory to chroot to. Defaults to the value of the
It would be a LOT nicer if both uppercase and lowercase values were
still accepted by the config file parser (as I originally coded it).
This change would require (and perhaps be entirely localized to) some
lex grammar-foo in config_gram.l. I lack the lex knowledge to know
for sure, but perhaps something like the following would work?
Index: config_gram.l
===================================================================
RCS file: /storage/cvsroot/spread/daemon/config_gram.l,v
retrieving revision 1.7
diff -u -u -r1.7 config_gram.l
--- config_gram.l 27 Sep 2002 17:10:08 -0000 1.7
+++ config_gram.l 1 Oct 2002 16:15:03 -0000
@@ -96,6 +96,9 @@
on { yylval.number = 1; return SP_TRIVAL; }
off { yylval.number = 0; return SP_TRIVAL; }
auto { yylval.number = 2; return SP_TRIVAL; }
+ON { yylval.number = 1; return SP_TRIVAL; }
+OFF { yylval.number = 0; return SP_TRIVAL; }
+AUTO { yylval.number = 2; return SP_TRIVAL; }
DEBUG { yylval.mask = 0x00000001; return DDEBUG; }
EXIT { yylval.mask = 0x00000002; return DEXIT; }
PRINT { yylval.mask = 0x00000004; return DPRINT; }
--
Daniel Rall <dlr at finemaltcoding.com>
More information about the Spread-users
mailing list