[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] Moderated Newsgroups



Jeff Grossman <jeff@xxxxxxxxxxx> writes:

> Okay, well if there is anything I can do to help you find it, please let me
> know.  I am just going to delete the one article from the out.going
> directory that I have now, so it does not continue to post.

How about this patch (against 20020910a)? Does this fix the issue for
you? The important one is the fetchnews.c patch, the others come along
with it and clean up other, minor issues in that snapshot. I'd like to
get some more testing and Joerg's review before I release another
snapshot.

Index: leafnode-2/fetchnews.c
diff -u leafnode-2/fetchnews.c:1.97 leafnode-2/fetchnews.c:1.98
--- leafnode-2/fetchnews.c:1.97	Tue Sep 10 02:29:34 2002
+++ leafnode-2/fetchnews.c	Sat Sep 14 03:24:57 2002
@@ -1505,6 +1505,15 @@
 			    ln_log(LNLOG_SINFO, LNLOG_CARTICLE,
 				   "Posting %s", *y);
 			    if (post_FILE(f, &line)) {
+				char *ngs = fgetheader(f, "Newsgroups:", 1);
+				if (ngs != NULL) {
+				    char *mod = checkstatus(ngs, 'm');
+				    if (mod != NULL) {
+					(void)log_unlink(*y, 1);
+					free(mod);
+				    }
+				    free(ngs);
+				}
 				/* POST was OK */
 				++n;
 			    } else {
Index: leafnode-2/log_unlink.c
diff -u leafnode-2/log_unlink.c:1.4 leafnode-2/log_unlink.c:1.5
--- leafnode-2/log_unlink.c:1.4	Mon Jul 15 04:58:54 2002
+++ leafnode-2/log_unlink.c	Sat Sep 14 03:23:57 2002
@@ -1,4 +1,4 @@
-/* (C) 2001 by Matthias Andree */
+/* (C) 2001 - 2002 by Matthias Andree */
 
 #include <unistd.h>
 #include "leafnode.h"
@@ -13,7 +13,9 @@
 log_unlink(const char *f, int ignore_enoent)
 {
     int r = unlink(f);
-    if (r < 0 && !(errno == ENOENT && ignore_enoent))
+    if (r < 0 && errno == ENOENT && ignore_enoent)
+	r = 0;
+    if (r < 0)
 	ln_log(LNLOG_SERR, LNLOG_CTOP, "cannot unlink %s: %m", f);
     return r;
 }
Index: leafnode-2/nntpd.c
diff -u leafnode-2/nntpd.c:1.106 leafnode-2/nntpd.c:1.107
--- leafnode-2/nntpd.c:1.106	Tue Sep 10 03:22:00 2002
+++ leafnode-2/nntpd.c	Sat Sep 14 03:34:54 2002
@@ -1562,9 +1562,10 @@
 	    approved = getheader(inname, "Approved:");
 	}
 
-	if (!moderator && !is_alllocal(groups)) {
-	    /* also posted to external groups or moderated group with
-	       unknown moderator, store into out.going */
+	if ((!moderator || (moderator && approved)) && !is_alllocal(groups)) {
+	    /* also posted to external groups
+	     * or moderated group with unknown moderator,
+	     * or approved, store into out.going */
 	    mastr *s = mastr_new(LN_PATH_MAX);
 	    outbasename = strrchr(inname, '/');
 	    outbasename++;
Index: leafnode-2/store.c
diff -u leafnode-2/store.c:1.39 leafnode-2/store.c:1.40
--- leafnode-2/store.c:1.39	Tue Sep 10 02:32:18 2002
+++ leafnode-2/store.c	Tue Sep 10 03:41:17 2002
@@ -16,6 +16,7 @@
 #include "attributes.h"
 #include "ln_dir.h"
 #include "msgid.h"
+#include "link_force.h"
 
 #include <ctype.h>
 #include <stdio.h>


-- 
Matthias Andree

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list