X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/f071d8a7c63596dd6e69db0336d76ec3a317a966..049703d6dda7beebfed582fbb8ee877e32b31985:/clients/blanche/blanche.c diff --git a/clients/blanche/blanche.c b/clients/blanche/blanche.c index 2358cc9e..b311941f 100644 --- a/clients/blanche/blanche.c +++ b/clients/blanche/blanche.c @@ -15,6 +15,7 @@ Do we need to improve the support for queue operations? */ #include +#include #include #include #include @@ -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;