]> andersk Git - moira.git/blobdiff - clients/blanche/blanche.c
Remove useless delcaration of index().
[moira.git] / clients / blanche / blanche.c
index 2358cc9ee3e648dd9fd72272111a245105499c2d..b311941fbabc51a63ca9d142c90585c5d3e443e6 100644 (file)
@@ -15,6 +15,7 @@
    Do we need to improve the support for queue operations? */
 
 #include <mit-copyright.h>
+#include <errno.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
@@ -51,7 +52,6 @@ struct save_queue *addlist, *dellist, *memberlist, *synclist;
 char *listname, *whoami;
 
 #ifndef POSIX
-extern char *index();
 extern int errno;
 #endif
 
@@ -351,6 +351,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.03197 seconds and 4 git commands to generate.