-#ifndef lint
+#if (!defined(lint) && !defined(SABER))
static char rcsid_module_c[] = "$Header$";
#endif lint
if (status == SMS_NO_MATCH)
return(SUB_NORMAL);
- if (status != 0) {
+ if (status != SMS_SUCCESS) {
com_err(program_name, status, " in DeleteList (get_lists_of_member).");
return(SUB_ERROR);
}
local = *elem;
while (local != NULL) {
char ** info = (char **) local->q_data;
- Print( CountArgs(info), info, NULL);
+ Print( 1, &info[GLOM_NAME], (char *) NULL);
local = local->q_forw;
}
sprintf(temp_buf,"Remove %s %s from these lists? ", type, name);
*/
local = *elem;
- args[1] = name;
- args[2] = type;
+ args[DM_LIST] = name;
+ args[DM_TYPE] = type;
while (local != NULL) {
char ** info = (char **) local->q_data;
- args[0] = info[0];
+ args[DM_MEMBER] = info[GLOM_NAME];
if ( (status = sms_query("delete_member_from_list",
3, args, Scream, NULL)) != 0) {
com_err(program_name, status, " in delete_member\nAborting\n");
com_err(program_name, status, ": list not deleted");
return(SUB_ERROR);
}
- (void) sprintf(buf, "List %s deleted./n", name);
+ (void) sprintf(buf, "List %s deleted.", name);
Put_message(buf);
+ Put_message("");
return(SUB_NORMAL);
}
* 1) try to delet it, if this fails in a known error then
* a) try to clean up each of those known methods, or
* at least explain why we failed.
- * Arguments: list - name of list.
+ * Arguments: list_info - info about this list.
* ask_first - (T/F) query user before preparing for deletion,
* and cleaning up?
* Returns: none - all is taken care of and error messages printed
*/
void
-AttemptToDeleteList(name, ask_first)
-char * name;
+AttemptToDeleteList(list_info, ask_first)
+char ** list_info;
Bool ask_first;
{
int status;
- struct qelem *local, *member_of, *list_info;
- char ** info;
- member_of = list_info = NULL;
+ struct qelem *local, *member_of;
+ char *name = list_info[L_NAME];
+ member_of = NULL;
/*
* Attempt delete. - will only work if:
*/
if ( (CheckIfAcl(name, "list", ask_first) == SUB_NORMAL) &&
+ (RemoveMembersOfList(name, ask_first) == SUB_NORMAL) &&
(RemoveItemFromLists(name, "list",
&member_of, ask_first) == SUB_NORMAL) &&
- (RemoveMembersOfList(name, ask_first) == SUB_NORMAL) &&
(RealDeleteList(name) == SUB_NORMAL) )
{ /* if... */
- info = (char **) list_info->q_data;
- CheckAcl(info[L_ACL_TYPE], info[L_ACL_NAME], ask_first);
+ CheckAcl(list_info[L_ACL_TYPE], list_info[L_ACL_NAME], ask_first);
local = member_of;
while (local != NULL) {
- info = (char **) local->q_data;
+ char ** info = (char **) local->q_data;
CheckListForDeletion(info[LM_LIST], ask_first);
local = local->q_forw;
}
+ FreeQueue(member_of);
}
- FreeQueue(list_info);
- FreeQueue(member_of); /* bug here somwhere... */
break;
default:
com_err(program_name, status, " in DeleteList (delete_list).");
return(DM_NORMAL);
*/ case SMS_NO_MATCH:
case SMS_LIST:
- Put_message("There is not list that matches that name.");
+ Put_message("There is no list that matches that name.");
return(DM_NORMAL);
default:
com_err(program_name, status, " in DeleteList (get_list_info).");
while (list != NULL) {
char ** info = (char**) list->q_data;
if (one_list) {
- if (Confirm("Are you sure that you want to delete this list?"))
- AttemptToDeleteList(info[L_NAME], TRUE);
+ sprintf( buf, "Are you sure that you want to delete the list %s",
+ info[L_NAME]);
+ if ( Confirm(buf) ) AttemptToDeleteList(info, TRUE);
}
else {
sprintf(buf, "Delete the list %s", info[L_NAME]);
switch( YesNoQuestion( buf, FALSE ) ) {
case TRUE:
- AttemptToDeleteList(info[L_NAME], TRUE);
+ AttemptToDeleteList(info, TRUE);
break;
case FALSE:
break;