All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Schmidt <mail_ben_schmidt@yahoo.com.au>
To: mlmmj@mlmmj.org
Subject: PATCH: Access priority
Date: Mon, 25 Jan 2010 11:02:45 +0000	[thread overview]
Message-ID: <4B5D7A55.4090302@yahoo.com.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]

This patch fixes something that I got bitten by last week, and since I spotted the 
place in the code while I was working on the other stuff, I did this too! It 
applies over 1.2.17.

The problem is that if you have a list that is 'moderated' or 'modnonsubposts', 
the 'allow' access keyword is ineffective, but behaves like 'moderate'. This patch 
fixes that so that access rules have priority, and do what they say.

I think this is more intuitive.

Do others agree? Or could this change cause problems? If not, or the perceived 
problems are minor enough, could this be included in mlmmj?

I have tested it, and it works for me.

Ben.


[-- Attachment #2: mlmmj-access.patch --]
[-- Type: text/x-patch, Size: 781 bytes --]

diff -ru mlmmj-1.2.17/src/mlmmj-process.c mlmmj-1.2.17-mod/src/mlmmj-process.c
--- mlmmj-1.2.17/src/mlmmj-process.c	2010-01-11 00:40:57.000000000 +1100
+++ mlmmj-1.2.17-mod/src/mlmmj-process.c	2010-01-25 02:23:23.000000000 +1100
@@ -851,6 +852,9 @@
 	}
 
 startaccess:
+	if(!moderated)
+		moderated = statctrl(listdir, "moderated");
+
 	noaccessdenymails = statctrl(listdir, "noaccessdenymails");
 
 	access_rules = ctrlvalues(listdir, "access");
@@ -917,11 +921,11 @@
 			myfree(donemailname);
 			myfree(discardname);
                 	exit(EXIT_SUCCESS);
+		} else if (accret == ALLOW) {
+			moderated = 0;
 		}
 	}
 
-	if(!moderated)
-		moderated = statctrl(listdir, "moderated");
 	if(moderated) {
 		mqueuename = concatstr(3, listdir, "/moderation/",
 				       randomstr);

             reply	other threads:[~2010-01-25 11:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25 11:02 Ben Schmidt [this message]
2010-01-25 13:41 ` PATCH: Access priority Ben Schmidt
2010-02-16 16:52 ` Morten Shearman Kirkegaard
2010-02-16 21:40 ` Ben Schmidt
2010-02-16 22:03 ` Franky Van Liedekerke
2010-02-17  8:21 ` Mads Martin Jørgensen
2010-02-17 21:40 ` Morten Shearman Kirkegaard
2010-02-17 22:56 ` Franky Van Liedekerke
2010-02-18 10:39 ` Morten Shearman Kirkegaard
2010-02-18 14:27 ` Ben Schmidt
2010-02-18 15:15 ` Morten Shearman Kirkegaard
2010-03-09 22:32 ` [mlmmj] " Ben Schmidt
2010-04-10 19:52 ` Morten Shearman Kirkegaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B5D7A55.4090302@yahoo.com.au \
    --to=mail_ben_schmidt@yahoo.com.au \
    --cc=mlmmj@mlmmj.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.