From 40637dba73ebe349ebbf8f6040e9805bdbf92128 Mon Sep 17 00:00:00 2001 From: jweiss Date: Thu, 9 Jun 1994 14:55:46 +0000 Subject: [PATCH] When a user tried to remove themself from a list they weren't on, and didn't maintain, they got a permission error, because the code fell thru to the list case, which the user was not allowed to remove. this was confusing. --- clients/blanche/blanche.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/clients/blanche/blanche.c b/clients/blanche/blanche.c index 18496f72..875691e3 100644 --- a/clients/blanche/blanche.c +++ b/clients/blanche/blanche.c @@ -352,6 +352,20 @@ char **argv; break; else if ((status != MR_LIST && status != MR_NO_MATCH) || memberstruct->type != M_ANY) { + if (status == MR_PERM && memberstruct->type == M_ANY) { + /* M_ANY means we've fallen through from the user case + * The fact that we didn't get MR_PERM there indicates + * that we had permission to remove the specified member + * from the list if it is a user, but not a list. This is + * if we are the member in question. Since we exist as a user + * we must have gotten the MR_NO_MATCH error, so we will + * return that, since it will be less confusing. However, + * This will generate the wrongerror if the user was trying + * to remove the list with his/her username from a list they + * don't administrate, without explicitly specifying "list:". + */ + status = MR_NO_MATCH; + } com_err(whoami, status, "while deleting member %s from %s", memberstruct->name, listname); break; -- 2.45.1