INN commit: branches/2.4 (9 files)
INN Commit
Russ_Allbery at isc.org
Sun Apr 6 14:35:40 UTC 2008
Date: Sunday, April 6, 2008 @ 07:35:40
Author: iulius
Revision: 7751
Add a "nnrpdflags" parameter to inn.conf (modeled on the concept of
"innflags") to permit passing of commandline arguments to instances of
nnrpd spawned from innd.
Modified:
branches/2.4/doc/man/inn.conf.5
branches/2.4/doc/man/innd.8
branches/2.4/doc/man/nnrpd.8
branches/2.4/doc/pod/inn.conf.pod
branches/2.4/doc/pod/nnrpd.pod
branches/2.4/include/inn/innconf.h
branches/2.4/innd/rc.c
branches/2.4/lib/innconf.c
branches/2.4/samples/inn.conf.in
-----------------------+
doc/man/inn.conf.5 | 17 +++++++++++++++++
doc/man/innd.8 | 5 +++--
doc/man/nnrpd.8 | 6 ++++++
doc/pod/inn.conf.pod | 9 +++++++++
doc/pod/nnrpd.pod | 6 ++++++
include/inn/innconf.h | 1 +
innd/rc.c | 14 +++++++++++++-
lib/innconf.c | 1 +
samples/inn.conf.in | 1 +
9 files changed, 57 insertions(+), 3 deletions(-)
Modified: doc/man/inn.conf.5
===================================================================
--- doc/man/inn.conf.5 2008-04-06 14:34:47 UTC (rev 7750)
+++ doc/man/inn.conf.5 2008-04-06 14:35:40 UTC (rev 7751)
@@ -322,6 +322,15 @@
The main purpose of this parameter is to configure all news servers within
a particular organization to add a common identity string to the
Path: header. The default value is unset.
+.IP "\fIpathcluster\fR" 4
+.IX Item "pathcluster"
+If set, this value is appended to the Path: header of accepted posts
+(after \fIpathhost\fR) if it isn't already present as the last element
+of the Path: header. The main purpose of this parameter is to make
+several news servers appear as one server. The default value is unset.
+.Sp
+Note that the Path: header reads right to left, so appended means inserted
+at the leftmost side of the Path: header.
.IP "\fIpgpverify\fR" 4
.IX Item "pgpverify"
Whether to enable \s-1PGP\s0 verification of control messages other than cancel.
@@ -662,6 +671,14 @@
recorded includes initial connection and posting; only information about
clients listed in \fInnrpd.track\fR is recorded. This is a boolean value and
the default is false.
+.IP "\fInnrpdflags\fR" 4
+.IX Item "nnrpdflags"
+When \fInnrpd\fR\|(8) is spawned from \fIinnd\fR\|(8), these flags are passed as
+arguments to the nnrpd process. This setting does not affect instances
+of nnrpd that are started in daemon mode, or instances that are started
+via another listener process such as \fIinetd\fR\|(8) or \fIxinetd\fR\|(8). Shell
+quoting and metacharacters are not supported. This is a string value
+and the default is unset.
.IP "\fInnrpdloadlimit\fR" 4
.IX Item "nnrpdloadlimit"
If set to a value other than \f(CW0\fR, connections to nnrpd will be refused
Modified: doc/man/innd.8
===================================================================
--- doc/man/innd.8 2008-04-06 14:34:47 UTC (rev 7750)
+++ doc/man/innd.8 2008-04-06 14:35:40 UTC (rev 7751)
@@ -455,8 +455,9 @@
The local site's name (as set with the \fIpathhost\fR parameter in
\&\fIinn.conf\fR) and an exclamation point are prepended to the Path: header,
provided the first site name in the Path: header is different from the
-local one. In addition, \fIpathalias\fR may be similarly prepended to the
-Path: header; see \fIinn.conf\fR\|(5) for the details.
+local one. In addition, \fIpathalias\fR and \fIpathcluster\fR may be similarly
+respectively prepended and appended to the Path: header; see \fIinn.conf\fR\|(5)
+for the details.
.PP
The Xref: header is removed and a new one created.
.PP
Modified: doc/man/nnrpd.8
===================================================================
--- doc/man/nnrpd.8 2008-04-06 14:34:47 UTC (rev 7750)
+++ doc/man/nnrpd.8 2008-04-06 14:35:40 UTC (rev 7751)
@@ -159,6 +159,12 @@
connections. If you are instead running \fBnnrpd\fR with the \fB\-D\fR option,
any configuration changes won't take effect until \fBnnrpd\fR is restarted.
.PP
+The \fIinn.conf\fR setting \fInnrpdflags\fR can be used to pass any of the
+options below to instances of \fBnnrpd\fR that are spawned directly from
+\&\fBinnd\fR. Many options only make sense when \fB\-D\fR is used, so these
+options should not be used with \fInnrpdflags\fR. See also the discussion
+of \fInnrpdflags\fR in \fIinn.conf\fR\|(5).
+.PP
When \fInnrpdloadlimit\fR in \fIinn.conf\fR is not 0, it will also reject
connections if the load average is greater than that value (typically 16).
\&\fBnnrpd\fR can also prevent high-volume posters from abusing your
Modified: doc/pod/inn.conf.pod
===================================================================
--- doc/pod/inn.conf.pod 2008-04-06 14:34:47 UTC (rev 7750)
+++ doc/pod/inn.conf.pod 2008-04-06 14:35:40 UTC (rev 7751)
@@ -613,6 +613,15 @@
clients listed in F<nnrpd.track> is recorded. This is a boolean value and
the default is false.
+=item I<nnrpdflags>
+
+When nnrpd(8) is spawned from innd(8), these flags are passed as
+arguments to the nnrpd process. This setting does not affect instances
+of nnrpd that are started in daemon mode, or instances that are started
+via another listener process such as inetd(8) or xinetd(8). Shell
+quoting and metacharacters are not supported. This is a string value
+and the default is unset.
+
=item I<nnrpdloadlimit>
If set to a value other than C<0>, connections to nnrpd will be refused
Modified: doc/pod/nnrpd.pod
===================================================================
--- doc/pod/nnrpd.pod 2008-04-06 14:34:47 UTC (rev 7750)
+++ doc/pod/nnrpd.pod 2008-04-06 14:35:40 UTC (rev 7751)
@@ -30,6 +30,12 @@
connections. If you are instead running B<nnrpd> with the B<-D> option,
any configuration changes won't take effect until B<nnrpd> is restarted.
+The F<inn.conf> setting I<nnrpdflags> can be used to pass any of the
+options below to instances of B<nnrpd> that are spawned directly from
+B<innd>. Many options only make sense when B<-D> is used, so these
+options should not be used with I<nnrpdflags>. See also the discussion
+of I<nnrpdflags> in inn.conf(5).
+
When I<nnrpdloadlimit> in F<inn.conf> is not 0, it will also reject
connections if the load average is greater than that value (typically 16).
B<nnrpd> can also prevent high-volume posters from abusing your
Modified: include/inn/innconf.h
===================================================================
--- include/inn/innconf.h 2008-04-06 14:34:47 UTC (rev 7750)
+++ include/inn/innconf.h 2008-04-06 14:35:40 UTC (rev 7751)
@@ -77,6 +77,7 @@
bool nfsreader; /* Use NFS reader functionality */
long nfsreaderdelay; /* Delay applied to article arrival */
bool nnrpdcheckart; /* Check article existence before returning? */
+ char *nnrpdflags; /* Arguments to pass when spawning nnrpd */
long nnrpdloadlimit; /* Maximum getloadvg() we allow */
bool noreader; /* Refuse to fork nnrpd for readers? */
bool readerswhenstopped; /* Allow nnrpd when server is paused */
Modified: innd/rc.c
===================================================================
--- innd/rc.c 2008-04-06 14:34:47 UTC (rev 7750)
+++ innd/rc.c 2008-04-06 14:35:40 UTC (rev 7751)
@@ -12,6 +12,7 @@
#include <netdb.h>
#include "inn/innconf.h"
+#include "inn/vector.h"
#include "innd.h"
#define TEST_CONFIG(a, b) \
@@ -450,9 +451,14 @@
void
RChandoff(int fd, HANDOFF h)
{
- const char *argv[6];
+ const char **argv;
char buff[SMBUF];
int i;
+ unsigned int j;
+ struct vector *flags;
+
+ flags = vector_split_space(innconf->nnrpdflags, NULL);
+ argv = xmalloc( (flags->count + 6) * sizeof(char*) );
if (RCnnrpd == NULL)
RCnnrpd = concatpath(innconf->pathbin, "nnrpd");
@@ -484,11 +490,17 @@
argv[i++] = "-t";
if (RCslaveflag)
argv[i++] = RCslaveflag;
+
+ for(j = 0; j < flags->count; j++) {
+ argv[i++] = flags->strings[j];
+ }
argv[i] = NULL;
/* Call NNRP; don't send back a QUIT message if Spawn fails since
* that's a major error we want to find out about quickly. */
(void)Spawn(innconf->nicekids, fd, fd, fd, (char * const *)argv);
+ vector_free(flags);
+ free(argv);
}
Modified: lib/innconf.c
===================================================================
--- lib/innconf.c 2008-04-06 14:34:47 UTC (rev 7750)
+++ lib/innconf.c 2008-04-06 14:35:40 UTC (rev 7751)
@@ -204,6 +204,7 @@
{ K(nfsreaderdelay), NUMBER (60) },
{ K(nicenewnews), NUMBER (0) },
{ K(nicennrpd), NUMBER (0) },
+ { K(nnrpdflags), STRING ("") },
{ K(nnrpdauthsender), BOOL (false) },
{ K(nnrpdloadlimit), NUMBER (16) },
{ K(nnrpdoverstats), BOOL (false) },
Modified: samples/inn.conf.in
===================================================================
--- samples/inn.conf.in 2008-04-06 14:34:47 UTC (rev 7750)
+++ samples/inn.conf.in 2008-04-06 14:35:40 UTC (rev 7751)
@@ -78,6 +78,7 @@
initialtimeout: 10
msgidcachesize: 10000
nnrpdcheckart: true
+nnrpdflags: ""
noreader: false
readerswhenstopped: false
readertrack: false
More information about the inn-committers
mailing list