INN commit: trunk (4 files)
INN Commit
rra at isc.org
Tue Dec 29 22:21:20 UTC 2009
Date: Tuesday, December 29, 2009 @ 14:21:20
Author: iulius
Revision: 8873
Do not differentiate IHAVE from POST in nnrpd. Articles
injected with IHAVE should be treated the same way as if
they were injected with POST.
Modified:
trunk/doc/pod/readers.conf.pod
trunk/nnrpd/commands.c
trunk/nnrpd/nnrpd.h
trunk/nnrpd/post.c
--------------------------+
doc/pod/readers.conf.pod | 4 ++--
nnrpd/commands.c | 2 +-
nnrpd/nnrpd.h | 3 +--
nnrpd/post.c | 22 ++++++++--------------
4 files changed, 12 insertions(+), 19 deletions(-)
Modified: doc/pod/readers.conf.pod
===================================================================
--- doc/pod/readers.conf.pod 2009-12-29 22:10:20 UTC (rev 8872)
+++ doc/pod/readers.conf.pod 2009-12-29 22:21:20 UTC (rev 8873)
@@ -406,8 +406,8 @@
=item I
-The client may inject articles with IHAVE. Note that in order to
-inject articles with the IHAVE the user must also have POST permission
+The client may inject articles with IHAVE. Note that in order to inject
+articles with the IHAVE command, the user must also have POST permission
(the C<P> option).
=item A
Modified: nnrpd/commands.c
===================================================================
--- nnrpd/commands.c 2009-12-29 22:10:20 UTC (rev 8872)
+++ nnrpd/commands.c 2009-12-29 22:21:20 UTC (rev 8873)
@@ -780,7 +780,7 @@
}
/* Send the article to the server. */
- response = ARTpost(article, idbuff, ihave, &permanent);
+ response = ARTpost(article, idbuff, &permanent);
if (response == NULL) {
notice("%s %s ok %s", Client.host, ihave ? "ihave" : "post", idbuff);
Reply("%d Article received %s\r\n", ihave ? NNTP_OK_IHAVE : NNTP_OK_POST, idbuff);
Modified: nnrpd/nnrpd.h
===================================================================
--- nnrpd/nnrpd.h 2009-12-29 22:10:20 UTC (rev 8872)
+++ nnrpd/nnrpd.h 2009-12-29 22:21:20 UTC (rev 8873)
@@ -208,8 +208,7 @@
EXTERN int overhdr_xref;
EXTERN bool LLOGenable;
-extern const char *ARTpost(char *article, char *idbuff, bool ihave,
- bool *permanent);
+extern const char *ARTpost(char *article, char *idbuff, bool *permanent);
extern void ARTclose(void);
extern int TrimSpaces(char *line);
extern void InitBackoffConstants(void);
Modified: nnrpd/post.c
===================================================================
--- nnrpd/post.c 2009-12-29 22:10:20 UTC (rev 8872)
+++ nnrpd/post.c 2009-12-29 22:21:20 UTC (rev 8873)
@@ -315,7 +315,7 @@
** Return NULL if okay, or an error message.
*/
static const char *
-ProcessHeaders(char *idbuff, bool ihave)
+ProcessHeaders(char *idbuff)
{
static char datebuff[40];
static char localdatebuff[40];
@@ -338,7 +338,7 @@
/* Do some preliminary fix-ups. */
for (hp = Table; hp < ARRAY_END(Table); hp++) {
- if (!ihave && !hp->CanSet && hp->Value) {
+ if (hp->CanSet && hp->Value) {
snprintf(Error, sizeof(Error),
"Can't set system %s: header", hp->Name);
return Error;
@@ -372,8 +372,6 @@
if (!makedate(-1, false, datebuff, sizeof(datebuff)))
return "Can't generate Date: header";
if (HDR(HDR__DATE) == NULL) {
- if (ihave)
- return "Missing Date: header";
if (PERMaccessconf->localtime) {
if (!makedate(-1, true, localdatebuff, sizeof(localdatebuff)))
return "Can't generate local date header";
@@ -398,8 +396,6 @@
/* Set the Message-ID: header. */
if (HDR(HDR__MESSAGEID) == NULL) {
- if (ihave)
- return "Missing Message-ID: header";
HDR_SET(HDR__MESSAGEID, idbuff);
}
if (!IsValidMessageID(HDR(HDR__MESSAGEID), true)) {
@@ -407,8 +403,6 @@
}
/* Set the Path: header. */
- if (HDR(HDR__PATH) == NULL && ihave)
- return "Missing Path: header";
if (HDR(HDR__PATH) == NULL || PERMaccessconf->strippath) {
/* Note that innd will put host name here for us. */
HDR_SET(HDR__PATH, (char *) PATHMASTER);
@@ -471,9 +465,9 @@
return error;
}
- /* Set the Organizaion: header. */
- if (!ihave && HDR(HDR__ORGANIZATION) == NULL
- && (p = PERMaccessconf->organization) != NULL) {
+ /* Set the Organization: header. */
+ if (HDR(HDR__ORGANIZATION) == NULL
+ && (p = PERMaccessconf->organization) != NULL) {
strlcpy(orgbuff, p, sizeof(orgbuff));
HDR_SET(HDR__ORGANIZATION, orgbuff);
}
@@ -546,7 +540,7 @@
HDR_SET(HDR__INJECTION_INFO, injectioninfobuff);
/* Clear out some headers that should not be here. */
- if (!ihave && PERMaccessconf->strippostcc) {
+ if (PERMaccessconf->strippostcc) {
HDR_CLEAR(HDR__CC);
HDR_CLEAR(HDR__BCC);
HDR_CLEAR(HDR__TO);
@@ -988,7 +982,7 @@
** The main function which handles POST and IHAVE.
*/
const char *
-ARTpost(char *article, char *idbuff, bool ihave, bool *permanent)
+ARTpost(char *article, char *idbuff, bool *permanent)
{
static char CANTSEND[] = "Can't send %s to server, %s";
int i;
@@ -1028,7 +1022,7 @@
if ((error = CheckIncludedText(article, i)) != NULL)
return error;
}
- if ((error = ProcessHeaders(idbuff, ihave)) != NULL)
+ if ((error = ProcessHeaders(idbuff)) != NULL)
return error;
if (i == 0 && HDR(HDR__CONTROL) == NULL)
return "Article is empty";
More information about the inn-committers
mailing list