]> andersk Git - moira.git/blobdiff - clients/blanche/blanche.c
When a user tried to remove themself from a list they weren't on, and
[moira.git] / clients / blanche / blanche.c
index 18496f72d334bc42c6ac814b041d0aceb7ba47b7..875691e31764fc3b7e55ebdf1161232714ea4481 100644 (file)
@@ -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;
This page took 0.057831 seconds and 4 git commands to generate.