]> andersk Git - moira.git/commitdiff
allow someone to delete a list which is it's own ACL and they're on the
authormar <mar>
Fri, 21 Apr 1989 19:11:46 +0000 (19:11 +0000)
committermar <mar>
Fri, 21 Apr 1989 19:11:46 +0000 (19:11 +0000)
ACL.  The problem is that you have to change the ACL before you delete
the members...

clients/moira/delete.c

index 4122cfc1068f68277a15d03d7c2c7dc13a4fba7b..5c45e6182c9bed781c8cd43e652272d9c693d6ae 100644 (file)
@@ -515,10 +515,29 @@ Bool ask_first;
         * what to do we will query and then do it.
         */
        
-       if ( (CheckIfAce(name, "list", ask_first) == SUB_NORMAL) &&
-           (RemoveMembersOfList(name, ask_first) == SUB_NORMAL) &&
+       if ((CheckIfAce(name, "list", ask_first) != SUB_NORMAL) ||
            (RemoveItemFromLists(name, "list",
-                                &member_of, ask_first) == SUB_NORMAL) &&
+                                &member_of, ask_first) != SUB_NORMAL))
+         break;
+       /*
+        * If the list is it's own ACL, then make the person performing
+        * the delete the owner before removing this person from the list
+        */
+       if (!strcmp(list_info[L_ACE_TYPE], "LIST") &&
+           !strcmp(list_info[L_ACE_NAME], list_info[L_NAME])) {
+             free(list_info[L_ACE_TYPE]);
+             free(list_info[L_ACE_NAME]);
+             list_info[L_ACE_TYPE] = Strsave("USER");
+             list_info[L_ACE_NAME] = Strsave(user);
+             SlipInNewName(list_info, Strsave(list_info[L_NAME]));
+             if ((status = do_sms_query("update_list", CountArgs(list_info)-3,
+                                      list_info, Scream, (char *) NULL))
+                   != SMS_SUCCESS) {
+                 com_err(program_name, status, " while updating list owner");
+                 Put_message("List may be only partly deleted.");
+             }
+       }
+       if ((RemoveMembersOfList(name, ask_first) == SUB_NORMAL) &&
            (RealDeleteList(name) == SUB_NORMAL) ) 
        {               /* if... */
            CheckAce(list_info[L_ACE_TYPE], list_info[L_ACE_NAME], ask_first);
This page took 0.0541 seconds and 5 git commands to generate.