]> andersk Git - moira.git/commitdiff
Don't assume an account has an associated list when deactivating it
authordanw <danw>
Tue, 7 Oct 1997 03:29:25 +0000 (03:29 +0000)
committerdanw <danw>
Tue, 7 Oct 1997 03:29:25 +0000 (03:29 +0000)
clients/moira/user.c

index d72a04c6bc8059e9e58804caaa99dec0444103c5..6349a77eb41069b20bcab4875c2c172601ab354f 100644 (file)
@@ -737,28 +737,31 @@ Bool one_item;
        Put_message(txt_buf);
     } else if (YesNoQuestion("Also deactivate matching list and filesystem (y/n)",
                             FALSE) == TRUE) {
-       if (status = do_mr_query("get_list_info", 1, &(info[NAME]),
-                                StoreInfo, (char *) &elem)) {
-           com_err(program_name, status, " getting list info, not deactivating list or filesystem");
-           return;
-       }
-       args =(char **) (QueueTop(elem)->q_data);
-       free(args[L_ACTIVE]);
-       args[L_ACTIVE] = strsave("0");
-       FreeAndClear(&args[L_MODTIME], TRUE);
-       FreeAndClear(&args[L_MODBY], TRUE);
-       FreeAndClear(&args[L_MODWITH], TRUE);
-       SlipInNewName(args, args[L_NAME]);
-       if (status = do_mr_query("update_list", CountArgs(args), args,
-                                Scream, (char *) NULL)) {
-           com_err(program_name, status, " updating list, not deactivating list or filesystem");
+       status = do_mr_query("get_list_info", 1, &(info[NAME]),
+                            StoreInfo, (char *) &elem);
+       if (status == MR_SUCCESS) {
+           args =(char **) (QueueTop(elem)->q_data);
+           free(args[L_ACTIVE]);
+           args[L_ACTIVE] = strsave("0");
+           FreeAndClear(&args[L_MODTIME], TRUE);
+           FreeAndClear(&args[L_MODBY], TRUE);
+           FreeAndClear(&args[L_MODWITH], TRUE);
+           SlipInNewName(args, args[L_NAME]);
+           if (status = do_mr_query("update_list", CountArgs(args), args,
+                                    Scream, (char *) NULL)) {
+               com_err(program_name, status, " updating list, not deactivating list or filesystem");
+               FreeInfo(args);
+               FreeQueue(elem);
+               return;
+           }
            FreeInfo(args);
            FreeQueue(elem);
+           elem = (struct qelem *) NULL;
+       } else if (status != MR_NO_MATCH) {
+           com_err(program_name, status, " getting list info, not deactivating list or filesystem");
            return;
        }
-       FreeInfo(args);
-       FreeQueue(elem);
-       elem = (struct qelem *) NULL;
+
        if (status = do_mr_query("get_filesys_by_label", 1, &(info[NAME]),
                                 StoreInfo, (char *) &elem)) {
            com_err(program_name, status, " getting filsys info, not deactivating filesystem");
This page took 0.038181 seconds and 5 git commands to generate.