INN commit: branches/2.5 (3 files)

INN Commit rra at isc.org
Fri Jan 22 23:29:28 UTC 2010


    Date: Friday, January 22, 2010 @ 15:29:28
  Author: iulius
Revision: 8919

innconfval no longer maps NULL string or list values to an empty string
or list.  These values should really be undefined.  In particular, it
fixes an issue reported by Kamil Jonca about nnrpd inserting an empty
Organization: header when the organization: parameter in inn.conf
was unset.

Modified:
  branches/2.5/doc/pod/innconfval.pod
  branches/2.5/doc/pod/news.pod
  branches/2.5/lib/innconf.c

------------------------+
 doc/pod/innconfval.pod |   28 ++++++++++------------------
 doc/pod/news.pod       |   10 +++++++++-
 lib/innconf.c          |    8 ++++++++
 3 files changed, 27 insertions(+), 19 deletions(-)

Modified: doc/pod/innconfval.pod
===================================================================
--- doc/pod/innconfval.pod	2010-01-22 23:28:28 UTC (rev 8918)
+++ doc/pod/innconfval.pod	2010-01-22 23:29:28 UTC (rev 8919)
@@ -44,16 +44,14 @@
 Print out parameters as Perl assignment statements.  The variable name
 will be the same as the F<inn.conf> parameter, and string values will be
 enclosed in single quotes with appropriate escaping.  Boolean values will
-be mapped to the strings C<true> or C<false>, and string parameters that
-are set to NULL will be mapped to empty strings.  List values will be
-mapped to an array of strings.
+be mapped to the strings C<true> or C<false>.  List values will be mapped
+to an array of strings.  NULL values are not printed out and will therefore
+be C<undef> in Perl.
 
 Here is an example:
 
-    $domain = '';
     $enableoverview = 'true';
     @extraoverviewadvertised = ( 'Newsgroups', 'Injection-Info' );
-    @extraoverviewhidden = ( );
     $organization = 'Let\'s try nasty "quotes"';
     $maxforks = 10;
 
@@ -64,20 +62,17 @@
 
 Print out parameters as Bourne shell assignment statements.  The variable
 name will be the F<inn.conf> parameter name in all capitals, and all
-variables will be exported.  String values will be enclosed in single
-quotes with appropriate escaping, and boolean values will be mapped to
-C<true> or C<false>.  String parameters that are set to NULL will be
-mapped to empty strings.  List values will be mapped to a space-separated
+variables will be exported, if not NULL.  String values will be enclosed in
+single quotes with appropriate escaping, and boolean values will be mapped
+to C<true> or C<false>.  List values will be mapped to a space-separated
 string representing an array of strings (as Bourne shell does not recognize
-arrays, contrary to several other shells, an array cannot be returned
-for interoperability reasons).
+arrays, contrary to several other shells, an array cannot be returned for
+interoperability reasons).
 
 Here is an example:
 
-    DOMAIN=''; export DOMAIN;
     ENABLEOVERVIEW=true; export ENABLEOVERVIEW;
     EXTRAOVERVIEWADVERTISED='"Newsgroups" "Injection-Info"'; export EXTRAOVERVIEWADVERTISED;
-    EXTRAOVERVIEWHIDDEN='( )'; export EXTRAOVERVIEWHIDDEN;
     ORGANIZATION='Let'\''s try nasty "quotes"'; export ORGANIZATION;
     MAXFORKS=10; export MAXFORKS;
 
@@ -86,16 +81,13 @@
 Print out parameters as Tcl assignment statements.  The variable name will
 be the same as the F<inn.conf> parameter name but with C<inn_> prepended,
 and string variables will be escaped appropriately.  Boolean values will
-be mapped to the strings C<true> or C<false>, and string parameters that
-are set to NULL will be mapped to empty strings.  List values will be
-mapped to an array of strings.
+be mapped to the strings C<true> or C<false>.  List values will be mapped
+to an array of strings.  NULL values are not printed out.
 
 Here is an example:
 
-    set inn_domain ""
     set inn_enableoverview "true"
     set inn_extraoverviewadvertised { "Newsgroups" "Injection-Info" }
-    set inn_extraoverviewhidden { }
     set inn_organization "Let's try nasty \"quotes\""
     set inn_maxforks 10
 

Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod	2010-01-22 23:28:28 UTC (rev 8918)
+++ doc/pod/news.pod	2010-01-22 23:29:28 UTC (rev 8919)
@@ -237,6 +237,14 @@
 
 =item *
 
+B<innconfval> no longer maps NULL string or list values to an empty string
+or list.  These values should really be undefined.  In particular, it
+fixes an issue reported by Kamil Jonca about B<nnrpd> inserting an empty
+Organization: header when the I<organization> parameter in F<inn.conf>
+was unset.
+
+=item *
+
 Other minor bug fixes and documentation improvements.
 
 =back
@@ -1569,7 +1577,7 @@
 
 =item *
 
-Fixed bugs in B<inncheck> with setuid rnews or setgid inews, in I<innconfval>
+Fixed bugs in B<inncheck> with setuid B<rnews> or setgid B<inews>, in B<innconfval>
 with F<inn.conf> parameters containing shell metacharacters but no spaces,
 and in F<parsedate.y> with some versions of B<yacc>.  Fixed a variety of
 size-related printf format warnings (e.g., C<%d> vs. C<%ld>) thanks to the work

Modified: lib/innconf.c
===================================================================
--- lib/innconf.c	2010-01-22 23:28:28 UTC (rev 8918)
+++ lib/innconf.c	2010-01-22 23:29:28 UTC (rev 8919)
@@ -750,6 +750,10 @@
     const char *letter;
     static const char tcl_unsafe[] = "$[]{}\"\\";
 
+    /* Do not output NULL values.  They are not empty strings. */
+    if (value == NULL)
+        return;
+
     switch (quoting) {
     case INNCONF_QUOTE_NONE:
         fprintf(file, "%s\n", value != NULL ? value : "");
@@ -804,6 +808,10 @@
     unsigned int i;
     static const char tcl_unsafe[] = "$[]{}\"\\";
 
+    /* Do not output NULL values.  They are not empty lists. */
+    if (value == NULL || value->strings == NULL)
+        return;
+
     switch (quoting) {
     case INNCONF_QUOTE_NONE:
         fprintf(file, "[ ");




More information about the inn-committers mailing list