Startinnfeed exec'ing imapfeed
Jeffrey M. Vinocur
jeff at litech.org
Tue Jun 12 16:50:17 UTC 2001
As described by INSTALL, startinnfeed can be used to spawn innfeed or
imapfeed.
I haven't a clue how to use imapfeed (and indeed don't have it installed,
since I'm running a mix of 2.3.2 for most things and CURRENT for
nnrpd-related stuff), so I haven't tested this, but I did pull the
interesting bit out into a little program so I could verify I didn't do
anything exceedingly dumb.
Documented in doc/man/startinnfeed.1 (although we don't have a manpage ofr
imapfeed, so I couldn't refer to it).
Oh, and fixed a typo in the imap code comments.
--
Jeffrey M. Vinocur
jeff at litech.org
-- Attached file included as plaintext by Listar --
-- File: startinnfeed-imapfeed
diff -ur inn-CURRENT-20010611/doc/man/startinnfeed.1 inn-CURRENT-20010611-modified/doc/man/startinnfeed.1
--- inn-CURRENT-20010611/doc/man/startinnfeed.1 Thu May 21 06:12:55 1998
+++ inn-CURRENT-20010611-modified/doc/man/startinnfeed.1 Tue Jun 12 12:46:20 2001
@@ -3,11 +3,22 @@
startinnfeed \- setuid root program to start innfeed
.SH SYNOPSIS
.B startinnfeed
-.RB innfeed-options
+.RB [innfeed-options]
+.sp
+.B startinnfeed
+.RB imapfeed
+.RB [imapfeed-options]
.SH DESCRIPTION
.B Startinnfeed
sets all resources (files opened, memory usage) to unlimited. It then executes
innfeed(8) with the options specified.
+
+If the first argument to
+.B startinnfeed
+is ``\fIimapfeed\fP'' then
+.B imapfeed
+will be executed (instead of innfeed(8)) with the remaining argument as
+options.
.SH AUTHOR
James Brister
.SH "SEE ALSO"
diff -ur inn-CURRENT-20010611/innfeed/imap_connection.c inn-CURRENT-20010611-modified/innfeed/imap_connection.c
--- inn-CURRENT-20010611/innfeed/imap_connection.c Mon Jun 11 05:01:03 2001
+++ inn-CURRENT-20010611-modified/innfeed/imap_connection.c Tue Jun 12 11:00:02 2001
@@ -3,7 +3,7 @@
Instead of feeding articles via nntp to another host this feeds the
messages via lmtp to a host and the control messages (cancel's
- etc..) it preforms via IMAP. This means it has 2 active connections
+ etc..) it performs via IMAP. This means it has 2 active connections
at any given time and 2 queues.
When an article comes in it is immediatly placed in the lmtp
diff -ur inn-CURRENT-20010611/innfeed/startinnfeed.c inn-CURRENT-20010611-modified/innfeed/startinnfeed.c
--- inn-CURRENT-20010611/innfeed/startinnfeed.c Mon Jun 11 05:01:08 2001
+++ inn-CURRENT-20010611-modified/innfeed/startinnfeed.c Tue Jun 12 12:35:07 2001
@@ -41,6 +41,7 @@
uid_t news_uid;
gid_t news_gid;
char ** innfeed_argv;
+ char * spawn_path;
int i;
#if HAVE_SETRLIMIT
@@ -95,9 +96,21 @@
if (setuid(news_uid) < 0 || getuid() != news_uid)
sysdie("can't setuid to %d", news_uid);
+ /* Check for imapfeed -- continue to use "innfeed" in variable
+ names for historical reasons regardless */
+ if ((argc > 0) && (strcmp(argv[1],"imapfeed") == 0))
+ {
+ argc--;
+ argv++;
+ spawn_path = concat(innconf->pathbin, "/imapfeed", (char *) 0);
+ }
+ else
+ spawn_path = concat(innconf->pathbin, "/innfeed", (char *) 0);
+
+
/* Build the argument vector for innfeed. */
innfeed_argv = xmalloc((argc + 1) * sizeof(char *));
- innfeed_argv[0] = concat(innconf->pathbin, "/innfeed", (char *) 0);
+ innfeed_argv[0] = spawn_path;
for (i = 1; i <= argc; i++)
innfeed_argv[i] = argv[i];
innfeed_argv[argc] = NULL;
More information about the inn-patches
mailing list