INN commit: branches/2.5/nnrpd (list.c)
INN Commit
rra at isc.org
Mon Feb 8 21:05:33 UTC 2010
Date: Monday, February 8, 2010 @ 13:05:33
Author: iulius
Revision: 8965
When a user is allowed to locally post articles, then LIST
ACTIVE and LIST COUNTS will return the right "y" flag
(instead of "n" or "x").
Modified:
branches/2.5/nnrpd/list.c
--------+
list.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
Modified: list.c
===================================================================
--- list.c 2010-02-08 20:55:59 UTC (rev 8964)
+++ list.c 2010-02-08 21:05:33 UTC (rev 8965)
@@ -113,7 +113,7 @@
bool range;
range = (ac > 2 && strcasecmp(av[2], "RANGE") == 0);
-
+
if (ac > 2 && (strcasecmp(av[2], "MSGID") != 0)
&& !range) {
Reply("%d Syntax error in arguments\r\n", NNTP_ERR_SYNTAX);
@@ -150,6 +150,10 @@
return false;
}
if (OVgroupstats(group, &lo, &hi, &count, &flag) && flag != NF_FLAG_ALIAS) {
+ /* When the connected user has the right to locally post, mention it. */
+ if (PERMaccessconf->locpost && (flag == NF_FLAG_NOLOCAL
+ || flag == NF_FLAG_IGNORE))
+ flag = NF_FLAG_OK;
/* When a newsgroup is empty, the high water mark should be one less
* than the low water mark according to RFC 3977. */
if (count == 0)
@@ -325,7 +329,10 @@
lo = hi + 1;
if (flag != NF_FLAG_ALIAS) {
- Printf("%s %u %u %u %c\r\n", p, hi, lo, count, flag);
+ Printf("%s %u %u %u %c\r\n", p, hi, lo, count,
+ PERMaccessconf->locpost
+ && (flag == NF_FLAG_NOLOCAL || flag == NF_FLAG_IGNORE)
+ ? NF_FLAG_OK : flag);
} else if (savec != '\0') {
*save = savec;
@@ -342,6 +349,15 @@
if (savec != '\0')
*save = savec;
+ if (lp == &INFOactive) {
+ /* When the connected user has the right to locally post, mention it. */
+ if (PERMaccessconf->locpost && (q = strrchr(p, ' ')) != NULL) {
+ q++;
+ if (*q == NF_FLAG_NOLOCAL || *q == NF_FLAG_IGNORE)
+ *q = NF_FLAG_OK;
+ }
+ }
+
Printf("%s\r\n", p);
}
QIOclose(qp);
More information about the inn-committers
mailing list