INND~stopped a brief time
Jeffrey M. Vinocur
jeff at litech.org
Wed Feb 7 04:56:10 UTC 2001
On 6 Feb 2001, Russ Allbery wrote:
> Could you resend it to inn-patches?
[And to you; not sure what you wanted]
Context diff for thing to use alternate config file attached (the first
one).
Also two other things (I did recursive diff and then split it up into the
three modifications I made, can't hurt to send 'em) --
an itsy-bitsy patch to make nnrpdauthenticatedsender behave usefully (that
is, not allow even authenticated users to set Sender:),
and a patch for auth/resolv/ident adding a flag (-t) to truncate a
response at an @ if any is present (here we had inetd returing
username at host.internal, which we didn't want to propogate; now
default-domain gets added to those Sender:s and username@<default-domain>
_is_ a valid address.
--
Jeffrey M. Vinocur
jeff at litech.org
-- Attached file included as plaintext by Listar --
-- File: nnrpd-readers
diff -c -r inn-2.3.1/doc/man/nnrpd.8 inn-2.3.1-modified/doc/man/nnrpd.8
*** inn-2.3.1/doc/man/nnrpd.8 Thu Jan 11 10:39:28 2001
--- inn-2.3.1-modified/doc/man/nnrpd.8 Wed Jan 31 20:43:35 2001
***************
*** 8,13 ****
--- 8,16 ----
.BI \-b " address"
]
[
+ .BI \-c " configfile"
+ ]
+ [
.B \-D
]
[
***************
*** 83,88 ****
--- 86,102 ----
This has to be a valid Internet
address in dotted-quad format belonging to an interface of the local
host.
+ .TP
+ .B \-c
+ By default,
+ .I nnrpd
+ reads the
+ .I <pathetc in inn.conf>/readers.conf
+ to determine how to authenticate connections. The ``\-c'' flag
+ specifies an alternate file for this purpose in the same directory.
+ (This is useful to have several instances of
+ .I nnrpd
+ running on different ports or IP addresses with different settings.)
.TP
.B \-D
If specified, this parameter causes
diff -c -r inn-2.3.1/nnrpd/nnrpd.c inn-2.3.1-modified/nnrpd/nnrpd.c
*** inn-2.3.1/nnrpd/nnrpd.c Thu Jan 11 10:39:38 2001
--- inn-2.3.1-modified/nnrpd/nnrpd.c Wed Jan 31 20:13:10 2001
***************
*** 758,763 ****
--- 758,764 ----
UID_T NewsUID;
int one = 1;
FILE *pidfile;
+ char *AltConfigFile = NULL;
struct passwd *pwd;
int clienttimeout;
#if HAVE_GETSPNAM
***************
*** 788,796 ****
if (ReadInnConf() < 0) exit(1);
#ifdef HAVE_SSL
! while ((i = getopt(argc, argv, "b:Di:g:op:Rr:s:tS")) != EOF)
#else
! while ((i = getopt(argc, argv, "b:Di:g:op:Rr:s:t")) != EOF)
#endif /* HAVE_SSL */
switch (i) {
default:
--- 789,797 ----
if (ReadInnConf() < 0) exit(1);
#ifdef HAVE_SSL
! while ((i = getopt(argc, argv, "b:c:Di:g:op:Rr:s:tS")) != EOF)
#else
! while ((i = getopt(argc, argv, "b:c:Di:g:op:Rr:s:t")) != EOF)
#endif /* HAVE_SSL */
switch (i) {
default:
***************
*** 802,807 ****
--- 803,811 ----
if (ListenAddr == -1)
ListenAddr = htonl(INADDR_ANY);
break;
+ case 'c': /* alternate readers.conf */
+ AltConfigFile = COPY(optarg);
+ break;
case 'D': /* standalone daemon mode */
DaemonMode = TRUE;
break;
***************
*** 853,859 ****
ACTIVE = COPY(cpcatpath(innconf->pathdb, _PATH_ACTIVE));
ACTIVETIMES = COPY(cpcatpath(innconf->pathdb, _PATH_ACTIVETIMES));
NEWSGROUPS = COPY(cpcatpath(innconf->pathdb, _PATH_NEWSGROUPS));
! NNRPACCESS = COPY(cpcatpath(innconf->pathetc, _PATH_NNRPACCESS));
SPOOLlen = strlen(innconf->patharticles);
if (DaemonMode) {
--- 857,865 ----
ACTIVE = COPY(cpcatpath(innconf->pathdb, _PATH_ACTIVE));
ACTIVETIMES = COPY(cpcatpath(innconf->pathdb, _PATH_ACTIVETIMES));
NEWSGROUPS = COPY(cpcatpath(innconf->pathdb, _PATH_NEWSGROUPS));
! NNRPACCESS = COPY(cpcatpath(innconf->pathetc, (NULL == AltConfigFile
! ? _PATH_NNRPACCESS
! : AltConfigFile)));
SPOOLlen = strlen(innconf->patharticles);
if (DaemonMode) {
diff -c -r inn-2.3.1/nnrpd/perm.c inn-2.3.1-modified/nnrpd/perm.c
*** inn-2.3.1/nnrpd/perm.c Thu Jan 11 10:39:38 2001
--- inn-2.3.1-modified/nnrpd/perm.c Wed Jan 31 20:18:59 2001
***************
*** 1205,1211 ****
ConfigBit = NEW(char, ConfigBitsize);
memset(ConfigBit, '\0', ConfigBitsize);
}
! PERMreadfile(cpcatpath(innconf->pathetc, _PATH_NNRPACCESS));
strip_accessgroups();
--- 1205,1211 ----
ConfigBit = NEW(char, ConfigBitsize);
memset(ConfigBit, '\0', ConfigBitsize);
}
! PERMreadfile(NNRPACCESS);
strip_accessgroups();
-- Attached file included as plaintext by Listar --
-- File: nnrpd-sender
diff -c -r inn-2.3.1/nnrpd/post.c inn-2.3.1-modified/nnrpd/post.c
*** inn-2.3.1/nnrpd/post.c Mon Aug 21 02:14:43 2000
--- inn-2.3.1-modified/nnrpd/post.c Fri Jan 19 16:44:13 2001
***************
*** 360,380 ****
/* If authorized and we didn't get a sender, add the header based on
* our info. If not authorized, zap the Sender so we don't put out
* unauthenticated data. */
! if (PERMauthorized && HDR(_sender) == NULL) {
if (PERMuser[0] == '\0') {
(void)sprintf(sendbuff, "%s@%s", "UNKNOWN", ClientHost);
} else {
if ((p = strchr(PERMuser, '@')) == NULL) {
(void)sprintf(sendbuff, "%s@%s", PERMuser, ClientHost);
} else {
! *p = '\0';
! (void)sprintf(sendbuff, "%s@%s", PERMuser, ClientHost);
! *p = '@';
}
}
HDR(_sender) = sendbuff;
}
! else if (!PERMauthorized)
HDR(_sender) = NULL;
}
--- 360,378 ----
/* If authorized and we didn't get a sender, add the header based on
* our info. If not authorized, zap the Sender so we don't put out
* unauthenticated data. */
! if (PERMauthorized) {
if (PERMuser[0] == '\0') {
(void)sprintf(sendbuff, "%s@%s", "UNKNOWN", ClientHost);
} else {
if ((p = strchr(PERMuser, '@')) == NULL) {
(void)sprintf(sendbuff, "%s@%s", PERMuser, ClientHost);
} else {
! (void)sprintf(sendbuff, "%s", PERMuser);
}
}
HDR(_sender) = sendbuff;
}
! else /* if (!PERMauthorized) */
HDR(_sender) = NULL;
}
-- Attached file included as plaintext by Listar --
-- File: ident
diff -c -r inn-2.3.1/authprogs/ident.c inn-2.3.1-modified/authprogs/ident.c
*** inn-2.3.1/authprogs/ident.c Thu Jan 11 10:39:28 2001
--- inn-2.3.1-modified/authprogs/ident.c Sat Jan 20 13:26:02 2001
***************
*** 21,28 ****
--- 21,30 ----
struct sockaddr_in sin, loc, cli;
int sock;
int opt;
+ int truncate = 0;
extern char *optarg;
char *iter;
+ char *p;
int got;
char *endstr;
int gotcliaddr, gotcliport, gotlocaddr, gotlocport;
***************
*** 38,44 ****
else
sin.sin_port = s->s_port;
! while ((opt = getopt(argc, argv, "p:")) != -1) {
switch (opt) {
case 'p':
for (iter = optarg; *iter; iter++)
--- 40,46 ----
else
sin.sin_port = s->s_port;
! while ((opt = getopt(argc, argv, "p:t")) != -1) {
switch (opt) {
case 'p':
for (iter = optarg; *iter; iter++)
***************
*** 55,60 ****
--- 57,65 ----
sin.sin_port = atoi(optarg);
sin.sin_port = htons(sin.sin_port);
break;
+ case 't':
+ truncate = 1;
+ break;
}
}
***************
*** 180,185 ****
--- 185,192 ----
if (!*iter || *iter == '[')
/* null, or encrypted response */
exit(1);
+ if ((truncate == 1) && ((p = strchr(iter, '@')) != NULL))
+ *p = '\0';
printf("User:%s\n", iter);
exit(0);
More information about the inn-patches
mailing list