]> andersk Git - moira.git/commitdiff
use do_sms_query to do query with retry
authormar <mar>
Mon, 3 Oct 1988 13:03:17 +0000 (13:03 +0000)
committermar <mar>
Mon, 3 Oct 1988 13:03:17 +0000 (13:03 +0000)
clients/moira/attach.c
clients/moira/cluster.c
clients/moira/delete.c
clients/moira/nfs.c
clients/moira/pobox.c
clients/moira/printer.c
clients/moira/quota.c
clients/moira/user.c

index c8e8088e6cdc9f3de03bab0a91c322608c3caf0b..d1ffc3f02fcc8aaf6926d82f46a1ac8f247b5fda 100644 (file)
@@ -94,22 +94,22 @@ char *name;
 
     switch (type) {
     case LABEL:
-       if ( (stat = sms_query("get_filesys_by_label", 1, &name,
-                              StoreInfo, (char *)&elem)) != 0) {
+       if ( (stat = do_sms_query("get_filesys_by_label", 1, &name,
+                                 StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, NULL);
            return(NULL);
        }
        break;
     case MACHINE:
-       if ( (stat = sms_query("get_filesys_by_machine", 1, &name,
-                              StoreInfo, (char *)&elem)) != 0) {
+       if ( (stat = do_sms_query("get_filesys_by_machine", 1, &name,
+                                 StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, NULL);
            return(NULL);
        }
        break;
     case GROUP:
-       if ( (stat = sms_query("get_filesys_by_group", 1, &name,
-                              StoreInfo, (char *)&elem)) != 0) {
+       if ( (stat = do_sms_query("get_filesys_by_group", 1, &name,
+                                 StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, NULL);
            return(NULL);
        }
@@ -118,8 +118,8 @@ char *name;
        args[ALIAS_NAME] = name;
        args[ALIAS_TYPE] = FS_ALIAS_TYPE;
        args[ALIAS_TRANS] = "*";
-       if ( (stat = sms_query("get_alias", 3, args, StoreInfo, 
-                              (char *) &elem)) != 0) {
+       if ( (stat = do_sms_query("get_alias", 3, args, StoreInfo, 
+                                 (char *) &elem)) != 0) {
            com_err(program_name, stat, " in get_alias.");
            return(NULL);
        }
@@ -280,8 +280,8 @@ Bool one_item;
     sprintf(temp_buf, "Are you sure that you want to delete filesystem %s",
            info[FS_NAME]);
     if(!one_item || Confirm(temp_buf)) {
-       if ( (stat = sms_query("delete_filesys", 1,
-                              &info[FS_NAME], Scream, NULL)) != 0)
+       if ( (stat = do_sms_query("delete_filesys", 1,
+                                 &info[FS_NAME], Scream, NULL)) != 0)
            com_err(program_name, stat, " filesystem not deleted.");
        else
            Put_message("Filesystem deleted.");
@@ -327,15 +327,16 @@ Bool junk;
     char ** args = AskFSInfo(info, TRUE);
     extern Menu nfsphys_menu;
 
-    stat = sms_query("update_filesys", CountArgs(args), args, NullFunc, NULL);
+    stat = do_sms_query("update_filesys", CountArgs(args), args,
+                       NullFunc, NULL);
     switch (stat) {
     case SMS_NFS:
        Put_message("That NFS filesystem is not exported.");
        if (YesNoQuestion("Fix this now (Y/N)")) {
            Do_menu(&nfsphys_menu, 0, NULL);
            if (YesNoQuestion("Retry filesystem update now (Y/N)")) {
-               if (stat = sms_query("update_filesys", CountArgs(args), args,
-                                    NullFunc, NULL))
+               if (stat = do_sms_query("update_filesys", CountArgs(args), args,
+                                       NullFunc, NULL))
                    com_err(program_name, stat, " filesystem not updated");
                else
                    Put_message("filesystem sucessfully updated.");
@@ -387,8 +388,8 @@ int argc;
     if ( !ValidName(argv[1]) )
        return(DM_NORMAL);
 
-    if ( (stat = sms_query("get_filesys_by_label", 1, argv + 1,
-                          NullFunc, NULL)) == 0) {
+    if ( (stat = do_sms_query("get_filesys_by_label", 1, argv + 1,
+                             NullFunc, NULL)) == 0) {
        Put_message ("A Filesystem by that name already exists.");
        return(DM_NORMAL);
     } else if (stat != SMS_NO_MATCH) {
@@ -398,15 +399,15 @@ int argc;
 
     args = AskFSInfo(SetDefaults(info, argv[1]), FALSE );
 
-    stat = sms_query("add_filesys", CountArgs(args), args, NullFunc, NULL);
+    stat = do_sms_query("add_filesys", CountArgs(args), args, NullFunc, NULL);
     switch (stat) {
     case SMS_NFS:
        Put_message("That NFS filesystem is not exported.");
        if (YesNoQuestion("Fix this now (Y/N)")) {
            Do_menu(&nfsphys_menu, 0, NULL);
            if (YesNoQuestion("Retry filesystem creation now (Y/N)")) {
-               if (stat = sms_query("add_filesys", CountArgs(args), args,
-                                    NullFunc, NULL))
+               if (stat = do_sms_query("add_filesys", CountArgs(args), args,
+                                       NullFunc, NULL))
                    com_err(program_name, stat, " in AddFS");
                else
                    Put_message("Created.");
@@ -480,8 +481,8 @@ char **argv;
  * print out values, free memory used and then exit.
  */
 
-    if ( (stat = sms_query("get_alias", 3, args, StoreInfo, 
-                          (char *)&elem)) == 0) {
+    if ( (stat = do_sms_query("get_alias", 3, args, StoreInfo, 
+                             (char *)&elem)) == 0) {
        top = elem = QueueTop(elem);
        while (elem != NULL) {
            info = (char **) elem->q_data;          
@@ -502,7 +503,7 @@ char **argv;
     GetValueFromUser("Which filesystem will this alias point to?",
                     &args[ALIAS_TRANS]);
 
-    if ( (stat = sms_query("add_alias", 3, args, NullFunc, NULL)) != 0)
+    if ( (stat = do_sms_query("add_alias", 3, args, NullFunc, NULL)) != 0)
        com_err(program_name, stat, " in CreateFSAlias.");
 
     FreeInfo(args);
@@ -533,8 +534,8 @@ Bool one_item;
            "Are you sure that you want to delete the filesystem alias %s",
            info[ALIAS_NAME]);
     if(!one_item || Confirm(temp_buf)) {
-       if ( (stat = sms_query("delete_alias", CountArgs(info),
-                              info, Scream, NULL)) != 0 )
+       if ( (stat = do_sms_query("delete_alias", CountArgs(info),
+                                 info, Scream, NULL)) != 0 )
            com_err(program_name, stat, " filesystem alias not deleted.");
        else
            Put_message("Filesystem alias deleted.");
@@ -588,14 +589,3 @@ AttachHelp()
 
     return(PrintHelp(message));
 }
-
-/* 
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
index 7087f5434877dd3db406e53eb0f65bd608c2daae..d88332d016a485e73be857640410aa2a418ae6ab 100644 (file)
@@ -186,15 +186,15 @@ char * name1, *name2;
 
     switch (type) {
     case MACHINE:
-       if ( (stat = sms_query("get_machine", 1, &name1,
-                              StoreInfo, (char *)&elem)) != 0) {
+       if ( (stat = do_sms_query("get_machine", 1, &name1,
+                                 StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, " in get_machine.");
            return(NULL);
        }
        break;
     case CLUSTER:
-       if ( (stat = sms_query("get_cluster",  1, &name1,
-                              StoreInfo, (char *)&elem)) != 0) {
+       if ( (stat = do_sms_query("get_cluster",  1, &name1,
+                                 StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, " in get_cluster.");
            return(NULL);
        }
@@ -202,8 +202,8 @@ char * name1, *name2;
     case MAP:
        args[MAP_MACHINE] = name1;
        args[MAP_CLUSTER] = name2;
-       if ( (stat = sms_query("get_machine_to_cluster_map", 2, args,
-                              StoreInfo, (char *)&elem)) != 0) {
+       if ( (stat = do_sms_query("get_machine_to_cluster_map", 2, args,
+                                 StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, " in get_machine_to_cluster_map.");
            return(NULL);
        }
@@ -211,8 +211,8 @@ char * name1, *name2;
     case DATA:
        args[CD_NAME] = name1;
        args[CD_LABEL] = name2;
-       if ( (stat = sms_query("get_cluster_data", 2, args,
-                              StoreInfo, (char *)&elem)) != 0) {
+       if ( (stat = do_sms_query("get_cluster_data", 2, args,
+                                 StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, " in get_cluster_data.");
            return(NULL);
        }
@@ -349,7 +349,7 @@ char **argv;
  */
     name =  CanonicalizeHostname(argv[1]);
 
-    if ( (stat = sms_query("get_machine", 1, &name, NullFunc, NULL)) == 0) {
+    if ( (stat = do_sms_query("get_machine", 1, &name, NullFunc, NULL)) == 0) {
        Put_message("This machine already exists.");
        return(DM_NORMAL);
     }
@@ -364,8 +364,8 @@ char **argv;
  * Actually create the new Machine.
  */
     
-    if ( (stat = sms_query("add_machine", CountArgs(args), 
-                          args, Scream, NULL)) != 0)
+    if ( (stat = do_sms_query("add_machine", CountArgs(args), 
+                             args, Scream, NULL)) != 0)
        com_err(program_name, stat, " in AddMachine.");
 
     FreeInfo(info);
@@ -387,8 +387,8 @@ Bool junk;
 {
     register int stat;
     char ** args = AskMCDInfo(info, MACHINE, TRUE);
-    if ( (stat = sms_query("update_machine", CountArgs(args), 
-                          args, Scream, NULL)) != 0)
+    if ( (stat = do_sms_query("update_machine", CountArgs(args), 
+                             args, Scream, NULL)) != 0)
        com_err(program_name, stat, " in UpdateMachine.");
     else
        Put_message("Machine sucessfully updated.");
@@ -435,8 +435,8 @@ Bool ask_user;
     ret_value = SUB_NORMAL;    /* initialize ret_value. */
     args[0] = name;
     args[1] = "*";
-    stat = sms_query("get_machine_to_cluster_map", 2, args, 
-                        StoreInfo, (char *)&elem);
+    stat = do_sms_query("get_machine_to_cluster_map", 2, args, 
+                       StoreInfo, (char *)&elem);
     if (stat && stat != SMS_NO_MATCH) {
        com_err(program_name, stat, " in get_machine_to_cluster_map.");
        return(DM_NORMAL);
@@ -463,8 +463,8 @@ Bool ask_user;
        if (delete_it) {
            while (elem != NULL) {
                char **info = (char **) elem->q_data;
-               if ( (stat = sms_query( "delete_machine_from_cluster",
-                                      2, info, Scream, NULL)) != 0) {
+               if ( (stat = do_sms_query( "delete_machine_from_cluster",
+                                         2, info, Scream, NULL)) != 0) {
                    ret_value = SUB_ERROR;
                    com_err(program_name, stat, 
                            " in delete_machine_from_cluster.");
@@ -500,8 +500,8 @@ Bool one_machine;
            info[M_NAME]);
     if(!one_machine || Confirm(temp_buf)) {
        if (CheckAndRemoveFromCluster(info[M_NAME], TRUE) != SUB_ERROR) {
-           if ( (stat = sms_query("delete_machine", 1,
-                                  &info[M_NAME], Scream, NULL)) != 0) {
+           if ( (stat = do_sms_query("delete_machine", 1,
+                                     &info[M_NAME], Scream, NULL)) != 0) {
                com_err(program_name, stat, " in DeleteMachine.");
                sprintf(temp_buf, "%s ** NOT ** deleted.", 
                        info[M_NAME]);
@@ -592,8 +592,8 @@ char ** argv;
            if (add_it) {
                args[0] = minfo[M_NAME];
                args[1] = cinfo[C_NAME];
-               stat = sms_query("add_machine_to_cluster", 2, args,
-                                Scream, NULL);
+               stat = do_sms_query("add_machine_to_cluster", 2, args,
+                                   Scream, NULL);
                switch (stat) {
                case SMS_SUCCESS:
                    break;
@@ -637,8 +637,8 @@ Bool one_map;
     sprintf(temp_buf, "Remove %s from the cluster %s", 
            info[MAP_MACHINE], info[MAP_MACHINE]);
     if (!one_map || Confirm(temp_buf)) {
-       if ( (stat = sms_query("delete_machine_from_cluster", 2, 
-                              info, Scream, NULL)) != 0 )
+       if ( (stat = do_sms_query("delete_machine_from_cluster", 2, 
+                                 info, Scream, NULL)) != 0 )
            com_err(program_name, stat, " in delete_machine_from_cluster");
        else {
            sprintf(temp_buf, "%s has been removed from the cluster %s.",
@@ -671,8 +671,8 @@ char ** argv;
     args[MAP_CLUSTER] = argv[2];
     args[MAP_END] = NULL;
 
-    stat = sms_query("get_machine_to_cluster_map", CountArgs(args), args,
-                    StoreInfo, (char *)&elem);
+    stat = do_sms_query("get_machine_to_cluster_map", CountArgs(args), args,
+                       StoreInfo, (char *)&elem);
     if (stat == SMS_NO_MATCH) {
        sprintf(buf, "The machine %s is not is the cluster %s.",
                args[MAP_MACHINE], args[MAP_CLUSTER]);
@@ -732,8 +732,8 @@ char ** argv;
     if (!ValidName(name))
        return(DM_NORMAL);
 
-    if ( (stat = sms_query("get_cluster", 1, &name, 
-                          NullFunc, NULL)) == SMS_SUCCESS) {
+    if ( (stat = do_sms_query("get_cluster", 1, &name, 
+                             NullFunc, NULL)) == SMS_SUCCESS) {
        Put_message("This cluster already exists.");
        return(DM_NORMAL);
     }
@@ -745,8 +745,8 @@ char ** argv;
 /*
  * Actually create the new Cluster.
  */
-    if ( (stat = sms_query("add_cluster", CountArgs(args), 
-                          args, Scream, NULL)) != 0)
+    if ( (stat = do_sms_query("add_cluster", CountArgs(args), 
+                             args, Scream, NULL)) != 0)
        com_err(program_name, stat, " in AddCluster.");
 
     FreeInfo(info);
@@ -768,8 +768,8 @@ Bool junk;
 {
     register int stat;
     char ** args = AskMCDInfo(info, CLUSTER, TRUE);
-    if ( (stat = sms_query("update_cluster", CountArgs(args), 
-                          args, Scream, NULL)) != 0)
+    if ( (stat = do_sms_query("update_cluster", CountArgs(args), 
+                             args, Scream, NULL)) != 0)
        com_err(program_name, stat, " in UpdateCluster.");
     else
        Put_message("Cluster successfully updated.");
@@ -817,8 +817,8 @@ Bool ask_first;
     ret_value = SUB_NORMAL;
     args[MAP_MACHINE] = "*";
     args[MAP_CLUSTER] = name;
-    stat = sms_query("get_machine_to_cluster_map", 2, args, 
-                        StoreInfo, (char *)&elem);
+    stat = do_sms_query("get_machine_to_cluster_map", 2, args, 
+                       StoreInfo, (char *)&elem);
     if (stat && stat != SMS_NO_MATCH) {
        com_err(program_name, stat, " in get_machine_to_cluster_map.");
        return(DM_NORMAL);
@@ -852,8 +852,8 @@ Bool ask_first;
            elem = top;
            while (elem != 0) {
                char **info = (char **) elem->q_data;
-               if ( (stat = sms_query( "delete_machine_from_cluster",
-                                      2, info, Scream, NULL)) != 0) {
+               if ( (stat = do_sms_query("delete_machine_from_cluster",
+                                         2, info, Scream, NULL)) != 0) {
                    ret_value = SUB_ERROR;
                    com_err(program_name, stat, 
                            " in delete_machine_from_cluster.");
@@ -890,8 +890,8 @@ Bool one_cluster;
            info[C_NAME]);
     if (!one_cluster || Confirm(temp_buf)) {
        if (CheckAndRemoveMachines(info[C_NAME], TRUE) != SUB_ERROR) {
-           if ( (stat = sms_query("delete_cluster", 1,
-                                  &info[C_NAME], Scream, NULL)) != 0) {
+           if ( (stat = do_sms_query("delete_cluster", 1,
+                                     &info[C_NAME], Scream, NULL)) != 0) {
                com_err(program_name, stat, " in delete_cluster.");
                sprintf(temp_buf, "Cluster %s ** NOT ** deleted.", 
                        info[C_NAME]);
@@ -971,8 +971,8 @@ char ** argv;
 { 
     int stat;
 
-    if( (stat = sms_query("add_cluster_data", 3, argv + 1,
-                         Scream, (char *) NULL)) != 0)
+    if( (stat = do_sms_query("add_cluster_data", 3, argv + 1,
+                            Scream, (char *) NULL)) != 0)
        com_err(program_name, stat, " in AddClusterData.");
 
 }
@@ -998,8 +998,8 @@ Bool one_item;
     temp_ptr = "Are you sure that you want to remove this cluster (y/n) ?";
     if (!one_item) PrintClusterData(info);
     if (!one_item || Confirm(temp_ptr)) {
-       if( (stat = sms_query("delete_cluster_data", 3, info,
-                             Scream, (char *) NULL)) != 0) {
+       if( (stat = do_sms_query("delete_cluster_data", 3, info,
+                                Scream, (char *) NULL)) != 0) {
            com_err(program_name, stat, " in DeleteClusterData.");
            Put_message("Data not removed.");
        }
@@ -1059,17 +1059,3 @@ char **argv;
     FreeQueue(top);
     return(DM_NORMAL);
 }
-
-/* 
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
-
-
-
index 3173d193c51c8f0d60895d9b0ea72262bdb60ed9..2adc476fd1124800bec946ae5e68a8386e537d3d 100644 (file)
@@ -47,8 +47,8 @@ Bool verbose;
     int status;
     char *args[2], buf[BUFSIZ], **info;
 
-    if ( (status = sms_query("count_members_of_list", 1, &name, StoreInfo,
-                            (char *) &elem)) != 0) {
+    if ( (status = do_sms_query("count_members_of_list", 1, &name, StoreInfo,
+                               (char *) &elem)) != 0) {
        com_err(program_name, status, 
                " in DeleteList (count_members_of_list).");
        return;
@@ -91,7 +91,7 @@ Bool verbose;
  
     args[0] = type;
     args[1] = name;
-    status = sms_query("get_ace_use", 2, args, NullFunc,  (char *) NULL);
+    status = do_sms_query("get_ace_use", 2, args, NullFunc, (char *) NULL);
     if (status != SMS_NO_MATCH)
        return;                 /* If this query fails the ace will
                                   not be deleted even if it is empty. */
@@ -133,8 +133,8 @@ Bool verbose;
 
     args[0] = type;
     args[1] = name;
-    switch (status = sms_query("get_ace_use", 2, args,
-                              StoreInfo, (char *) &elem)) {
+    switch (status = do_sms_query("get_ace_use", 2, args,
+                                 StoreInfo, (char *) &elem)) {
     case SMS_NO_MATCH:
        return(DM_NORMAL);
     case SMS_SUCCESS:
@@ -202,8 +202,8 @@ int verbose;
  * Get all list of which this item is a member, and store them in a queue.
  */
 
-    status = sms_query("get_lists_of_member", 2, args, StoreInfo,
-                      (char *) elem);
+    status = do_sms_query("get_lists_of_member", 2, args, StoreInfo,
+                         (char *) elem);
 
     if (status == SMS_NO_MATCH)
        return(SUB_NORMAL);
@@ -251,8 +251,8 @@ int verbose;
     while (local != NULL) {
        char ** info = (char **) local->q_data;
        args[DM_LIST] = info[GLOM_NAME];
-       if ( (status = sms_query("delete_member_from_list",
-                                3, args, Scream, NULL)) != 0) {
+       if ( (status = do_sms_query("delete_member_from_list",
+                                   3, args, Scream, NULL)) != 0) {
            com_err(program_name, status, " in delete_member\nAborting\n");
            FreeQueue(*elem);
            return(SUB_ERROR);
@@ -280,8 +280,8 @@ Bool verbose;
 /* 
  * Get the members of this list.
  */
-    status = sms_query("get_members_of_list", 1, &name, StoreInfo,
-                      (char *) &elem);
+    status = do_sms_query("get_members_of_list", 1, &name, StoreInfo,
+                         (char *) &elem);
     if (status == SMS_NO_MATCH) 
        return(SUB_NORMAL);
 
@@ -324,8 +324,8 @@ Bool verbose;
        char ** info = (char **) local->q_data;
        args[1] = info[0];
        args[2] = info[1];
-       if ( (status = sms_query("delete_member_from_list",
-                                3, args, Scream, NULL)) != 0) {
+       if ( (status = do_sms_query("delete_member_from_list",
+                                   3, args, Scream, NULL)) != 0) {
            com_err(program_name, status, " in delete_member\nAborting\n");
            FreeQueue(elem);
            return(SUB_ERROR);
@@ -352,7 +352,7 @@ Bool verbose;
     int status, ans;
     char buf[BUFSIZ], *args[10];
 
-    status = sms_query("get_list_info", 1, &name, NullFunc, (char *) NULL);
+    status = do_sms_query("get_list_info", 1, &name, NullFunc, (char *) NULL);
     if (status == 0) {
        if (verbose) {
            sprintf(buf, "There is also a list named %s, delete it?", name);
@@ -393,8 +393,8 @@ Bool verbose;
     int status;
     char buf[BUFSIZ];
     
-    switch (status = sms_query("get_filesys_by_label", 1, &name, NullFunc, 
-                      (char *) NULL)) {
+    switch (status = do_sms_query("get_filesys_by_label", 1, &name, NullFunc, 
+                                 (char *) NULL)) {
     case SMS_NO_MATCH:
        break;
     case SMS_SUCCESS:
@@ -411,8 +411,8 @@ Bool verbose;
                return(SUB_ERROR);
            }
        }
-       if ( (status = sms_query("delete_filesys", 1, &name, Scream,
-                                (char *) NULL) ) != SMS_SUCCESS) {
+       if ( (status = do_sms_query("delete_filesys", 1, &name, Scream,
+                                   (char *) NULL) ) != SMS_SUCCESS) {
            com_err(program_name, status, " in delete_filesys.");
            return(SUB_ERROR);
        }
@@ -439,8 +439,8 @@ char * name;
     char buf[BUFSIZ];
     int status;
 
-    if ( (status = sms_query("delete_user", 1, &name, Scream, 
-                            (char *) NULL)) != SMS_SUCCESS) {
+    if ( (status = do_sms_query("delete_user", 1, &name, Scream, 
+                               (char *) NULL)) != SMS_SUCCESS) {
        com_err(program_name, status, ": user not deleted");
        return(SUB_ERROR);
     }
@@ -462,8 +462,8 @@ char * name;
     char buf[BUFSIZ];
     int status;
 
-    if ( (status = sms_query("delete_list", 1, &name, Scream, 
-                            (char *) NULL)) != SMS_SUCCESS) {
+    if ( (status = do_sms_query("delete_list", 1, &name, Scream, 
+                               (char *) NULL)) != SMS_SUCCESS) {
        com_err(program_name, status, ": list not deleted");
        return(SUB_ERROR);
     }
@@ -502,8 +502,8 @@ Bool ask_first;
      * 3) This list is not an ace of another object.
      */
     
-    switch (status = sms_query("delete_list", 1, &name,
-                              Scream, (char *) NULL)) {
+    switch (status = do_sms_query("delete_list", 1, &name,
+                                 Scream, (char *) NULL)) {
     case SMS_SUCCESS:
        Put_message("List Sucessfully Deleted.");
        CheckAce(list_info[L_ACE_TYPE], list_info[L_ACE_NAME], ask_first);
@@ -557,8 +557,8 @@ char *argv[];
 
     list = NULL;
     
-    switch(status = sms_query("get_list_info", 1, argv + 1,
-                             StoreInfo, (char *) &list)){
+    switch(status = do_sms_query("get_list_info", 1, argv + 1,
+                                StoreInfo, (char *) &list)){
     case SMS_SUCCESS:
        break;
 /*    case SMS_NO_WILDCARD:
@@ -625,7 +625,7 @@ char ** argv;
     if (!Confirm("Are you sure that you want to delete this user?"))
        return(DM_NORMAL);
 
-    status = sms_query("delete_user", 1, &name, Scream, (char *) NULL);
+    status = do_sms_query("delete_user", 1, &name, Scream, (char *) NULL);
     if (status != SMS_IN_USE && status != 0) {
        com_err(program_name, status, ": user not deleted");    
        return(DM_NORMAL);
@@ -674,14 +674,3 @@ char ** argv;
 #endif
     return(DM_NORMAL);
 }
-    
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
index 8e8284bb0789faa299474b2bc49f071557c5c43f..51eef8aeb152016f2b75da96c0b6d650de7a7a47 100644 (file)
@@ -178,8 +178,8 @@ char **argv;
     if ( (args[1] = GetDirName()) == NULL)
        return(DM_NORMAL);
     
-    if ( (stat = sms_query("get_nfsphys", 2, args,
-                          StoreInfo, (char *)  &elem)) != SMS_SUCCESS)
+    if ( (stat = do_sms_query("get_nfsphys", 2, args,
+                             StoreInfo, (char *)  &elem)) != SMS_SUCCESS)
        com_err(program_name, stat, " in ShowNFSServices.");
     free(args[1]);             /* prevents memory leaks. */
 
@@ -213,8 +213,8 @@ int argc;
     if (!ValidName(args[0]) || !ValidName(args[1]))
        return(DM_NORMAL);
     
-    if ( (stat = sms_query("get_nfsphys", 2, args,
-                          NullFunc, (char *) NULL)) == SMS_SUCCESS)
+    if ( (stat = do_sms_query("get_nfsphys", 2, args,
+                             NullFunc, (char *) NULL)) == SMS_SUCCESS)
        Put_message("This service already exists.");
     if (stat != SMS_NO_MATCH) 
        com_err(program_name, stat, " in get_nfsphys.");
@@ -230,8 +230,8 @@ int argc;
 
     add_args = AskNFSInfo(info);
     
-    if ((stat = sms_query("add_nfsphys", CountArgs(add_args), add_args,
-                          Scream, (char *) NULL)) != 0) 
+    if ((stat = do_sms_query("add_nfsphys", CountArgs(add_args), add_args,
+                            Scream, (char *) NULL)) != 0) 
        com_err(program_name, stat, " in AdsNFSService");
     
     FreeInfo(info);
@@ -255,8 +255,8 @@ Bool junk;
     register int stat;
     
     args = AskNFSInfo(info);
-    if ((stat = sms_query("update_nfsphys", CountArgs(args), args,
-                         Scream, (char *)NULL)) != SMS_SUCCESS) 
+    if ((stat = do_sms_query("update_nfsphys", CountArgs(args), args,
+                            Scream, (char *)NULL)) != SMS_SUCCESS) 
        com_err(program_name, stat, (char *) NULL);
 }
 
@@ -283,8 +283,8 @@ int argc;
     if ( (args[1] = GetDirName()) == NULL)
        return(DM_NORMAL);
 
-    if ( (stat = sms_query("get_nfsphys", 2, args,
-                          StoreInfo, (char *) &elem)) != SMS_SUCCESS) {
+    if ( (stat = do_sms_query("get_nfsphys", 2, args,
+                             StoreInfo, (char *) &elem)) != SMS_SUCCESS) {
        com_err(program_name, stat, " in UpdateNFSService.");
        return (DM_NORMAL);
     }
@@ -342,11 +342,11 @@ Bool one_item;
        args[0] = info[NFS_NAME];
        args[1] = info[NFS_DIR];
        args[2] = NULL;
-       switch(stat = sms_query("get_filesys_by_nfsphys", CountArgs(args), 
-                        args, StoreInfo, (char *)&elem)) {
+       switch(stat = do_sms_query("get_filesys_by_nfsphys", CountArgs(args), 
+                                  args, StoreInfo, (char *)&elem)) {
        case SMS_NO_MATCH:      /* it is unused, delete it. */
-           if ( (stat = sms_query("delete_nfsphys", 2, info, Scream, 
-                                  (char *) NULL )) != SMS_SUCCESS)
+           if ( (stat = do_sms_query("delete_nfsphys", 2, info, Scream, 
+                                     (char *) NULL )) != SMS_SUCCESS)
                com_err(program_name, stat, " in DeleteNFSService");
            else
                Put_message("Physical Filesystem Deleted.");
@@ -392,8 +392,8 @@ char **argv;
     if ( (args[1] = GetDirName()) == NULL)
        return(DM_NORMAL);
 
-    switch(stat = sms_query("get_nfsphys", 2, args, 
-                           StoreInfo, (char *) &elem)) {
+    switch(stat = do_sms_query("get_nfsphys", 2, args, 
+                              StoreInfo, (char *) &elem)) {
     case SMS_NO_MATCH:
        Put_message("This filsystem does not exist!");
        return(DM_NORMAL);
@@ -411,14 +411,3 @@ char **argv;
     FreeQueue(elem);
     return(DM_NORMAL);
 }    
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
index 3134dd4c0a29c655e82e16cc3484450de7f38c19..20281cd23273fb6df544a6cb33b70891fafa2180 100644 (file)
@@ -77,8 +77,8 @@ PrintPOMachines()
     static char * args[] = {"pop", NULL};
     struct qelem * top = NULL;
     
-    if ( (status = sms_query("get_server_locations", CountArgs(args), args,
-                            StoreInfo, (char *)&top)) != SMS_SUCCESS) {
+    if ( (status = do_sms_query("get_server_locations", CountArgs(args), args,
+                               StoreInfo, (char *)&top)) != SMS_SUCCESS) {
        com_err(program_name, status, " in get_server_locations.");
        return(SUB_ERROR);
     }
@@ -108,8 +108,8 @@ char ** argv;
     if (!ValidName(argv[1]))
        return(DM_NORMAL);
     
-    switch (status = sms_query("get_pobox", 1, argv + 1, StoreInfo, 
-                              (char *)&top)) {
+    switch (status = do_sms_query("get_pobox", 1, argv + 1, StoreInfo, 
+                                 (char *)&top)) {
     case SMS_NO_MATCH:
        Put_message("This user has no P.O. Box.");
        break;
@@ -180,8 +180,8 @@ char **argv;
        type = LOCAL_BOX;
        switch (YesNoQuestion("Use Previous Local Box (y/n)", TRUE)) {
        case TRUE:
-           switch (status = sms_query("set_pobox_pop", 1, 
-                                      &local_user, Scream, NULL)) {
+           switch (status = do_sms_query("set_pobox_pop", 1, 
+                                         &local_user, Scream, NULL)) {
            case SMS_SUCCESS:
                return(DM_NORMAL);
            case SMS_MACHINE:
@@ -232,8 +232,8 @@ char **argv;
     args[PO_TYPE] = type;
     args[PO_BOX] = box;
     args[PO_END] = NULL;
-    if ( (status = sms_query("set_pobox", CountArgs(args), args, 
-                            Scream, NULL)) != SMS_SUCCESS )
+    if ( (status = do_sms_query("set_pobox", CountArgs(args), args, 
+                               Scream, NULL)) != SMS_SUCCESS )
        com_err(program_name, status, " in ChangeUserPOBox");
     else
        Put_message("PO Box assigned.");
@@ -263,38 +263,11 @@ char ** argv;
            "Are you sure that you want to remove %s's PO Box (y/n)", argv[1]);
     
     if (Confirm(temp_buf)) {
-       if ( (status = sms_query("delete_pobox", 1, argv + 1, Scream, NULL)) !=
-           SMS_SUCCESS)
+       if ( (status = do_sms_query("delete_pobox", 1, argv + 1,
+                                   Scream, NULL)) != SMS_SUCCESS)
            com_err(program_name, status, "in delete_pobox.");
        else
            Put_message("PO Box removed.");
     }
     return(DM_NORMAL);
 }
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
-
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
index c9e0da13f680a9e42f8c0641aa9b67214bfd6ece..1b59d0720528761286cd5cd49dc18c243c423afd 100644 (file)
@@ -85,8 +85,8 @@ char *name;
     int stat;
     struct qelem *elem = NULL;
 
-    if ( (stat = sms_query("get_printcap", 1, &name,
-                          StoreInfo, (char *)&elem)) != 0) {
+    if ( (stat = do_sms_query("get_printcap", 1, &name,
+                             StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, NULL);
            return(NULL);
     }
@@ -195,8 +195,8 @@ Bool one_item;
     int stat;
     char temp_buf[BUFSIZ];
 
-    if ( (stat = sms_query("delete_printcap", 1,
-                          &info[FS_NAME], Scream, NULL)) != 0)
+    if ( (stat = do_sms_query("delete_printcap", 1,
+                             &info[FS_NAME], Scream, NULL)) != 0)
            com_err(program_name, stat, " printcap entry not deleted.");
     else
            Put_message("Printcap entry deleted.");
@@ -240,8 +240,8 @@ int argc;
     if ( !ValidName(argv[1]) )
        return(DM_NORMAL);
 
-    if ( (stat = sms_query("get_printcap", 1, argv + 1,
-                          NullFunc, NULL)) == 0) {
+    if ( (stat = do_sms_query("get_printcap", 1, argv + 1,
+                             NullFunc, NULL)) == 0) {
        Put_message ("A Printer by that name already exists.");
        return(DM_NORMAL);
     } else if (stat != SMS_NO_MATCH) {
@@ -251,8 +251,8 @@ int argc;
 
     args = AskPcapInfo(SetDefaults(info, argv[1]));
 
-    if ( (stat = sms_query("add_printcap", CountArgs(args), args, 
-                        NullFunc, NULL)) != 0)
+    if ( (stat = do_sms_query("add_printcap", CountArgs(args), args, 
+                             NullFunc, NULL)) != 0)
        com_err(program_name, stat, " in AddPcap");
 
     FreeInfo(info);
@@ -273,14 +273,14 @@ Bool one_item;
 {
     int stat;
 
-    if ((stat = sms_query("delete_printcap", 1, &info[FS_NAME],
-                         Scream, NULL)) != 0) {
+    if ((stat = do_sms_query("delete_printcap", 1, &info[FS_NAME],
+                            Scream, NULL)) != 0) {
        com_err(program_name, stat, " printcap entry not deleted.");
        return(DM_NORMAL);
     }
     AskPcapInfo(info);
-    if ((stat = sms_query("add_printcap", CountArgs(info), info,
-                         NullFunc, NULL)) != 0)
+    if ((stat = do_sms_query("add_printcap", CountArgs(info), info,
+                            NullFunc, NULL)) != 0)
        com_err(program_name, stat, " in ChngPcap");
     return(DM_NORMAL);
 }
@@ -302,16 +302,3 @@ ChngPcap(argc, argv)
     FreeQueue(elem);
     return(DM_NORMAL);
 }
-
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
-
index 450105bd79e2db5ca40dd0425bc9f817118754ea..c006b4b9da16d6b042a173fe35b42d0e6a395076 100644 (file)
@@ -53,8 +53,8 @@ Bool override;
   static char *val[] = {"def_quota", NULL};
 
   if (override || (def_quota == NULL)) {
-    if ( (status = sms_query("get_value", CountArgs(val), 
-                          val, StoreInfo, (char *) &top)) != SMS_SUCCESS) {
+    if ( (status = do_sms_query("get_value", CountArgs(val), val,
+                               StoreInfo, (char *) &top)) != SMS_SUCCESS) {
        com_err(program_name, status, " in ShowDefaultQuota");
        if (def_quota == NULL) {
          Put_message("No default Quota Found, setting default to 0.");
@@ -195,8 +195,8 @@ char *argv[];
            "change the default quota for all new users");
     if(Confirm(temp_buf)) {
        newval[1] = argv[1];
-       if ( (status = sms_query("update_value", CountArgs(newval), 
-                              newval, Scream, NULL)) == SMS_SUCCESS ) {
+       if ( (status = do_sms_query("update_value", CountArgs(newval), 
+                                   newval, Scream, NULL)) == SMS_SUCCESS ) {
          FreeAndClear(&def_quota, TRUE);
          def_quota = Strsave(argv[1]);
        }
@@ -227,8 +227,8 @@ ShowUserQuota()
   if ( (args = GetQuotaArgs(FALSE) ) == NULL)
     return(DM_NORMAL);
 
-  if ( (status = sms_query("get_nfs_quota", CountArgs(args), args,
-                          StoreInfo, (char *) &top)) != SMS_SUCCESS)
+  if ( (status = do_sms_query("get_nfs_quota", CountArgs(args), args,
+                             StoreInfo, (char *) &top)) != SMS_SUCCESS)
     com_err(program_name, status, " in get_nfs_quota");
   
   FreeInfo(args);              /* done with args free them. */
@@ -256,8 +256,8 @@ AddUserQuota()
   if ( (args = GetQuotaArgs(TRUE) ) == NULL)
     return(DM_NORMAL);
 
-  if ( (status = sms_query("add_nfs_quota", CountArgs(args), args,
-                          Scream, (char *) NULL)) != SMS_SUCCESS)
+  if ( (status = do_sms_query("add_nfs_quota", CountArgs(args), args,
+                             Scream, (char *) NULL)) != SMS_SUCCESS)
     com_err(program_name, status, " in get_nfs_quota");
   
   FreeInfo(args);
@@ -281,8 +281,8 @@ char ** info;
   sprintf(temp_buf, "New quota for filesystem %s (in KB)", info[Q_FILESYS]);
   GetValueFromUser(temp_buf, &info[Q_QUOTA]);
   
-  if (status = sms_query("update_nfs_quota", 3, info,
-                        Scream, (char *) NULL) != SMS_SUCCESS) {
+  if (status = do_sms_query("update_nfs_quota", 3, info,
+                           Scream, (char *) NULL) != SMS_SUCCESS) {
     com_err(program_name, status, " in update_nfs_quota");
     sprintf(temp_buf,"Could not perform quota change on %s",
            info[Q_FILESYS]); 
@@ -306,8 +306,8 @@ ChangeUserQuota()
   if ( (args = GetQuotaArgs(FALSE) ) == NULL)
     return(DM_NORMAL);
 
-  if ( (status = sms_query("get_nfs_quota", 2, args,
-                          StoreInfo, (char *) &top)) != SMS_SUCCESS)
+  if ( (status = do_sms_query("get_nfs_quota", 2, args,
+                             StoreInfo, (char *) &top)) != SMS_SUCCESS)
     com_err(program_name, status, " in get_nfs_quota");
   
   FreeInfo(args);              /* done with args, free them. */
@@ -340,8 +340,8 @@ Bool one_item;
          info[Q_LOGIN], info[Q_FILESYS]);
 
   if (!one_item || Confirm(temp_buf)) {
-    if ( (status = sms_query("delete_nfs_quota", 2, info,
-                            Scream, (char *) NULL)) != SMS_SUCCESS)
+    if ( (status = do_sms_query("delete_nfs_quota", 2, info,
+                               Scream, (char *) NULL)) != SMS_SUCCESS)
       com_err(program_name, status, " in delete_nfs_quota");
     else
       Put_message("Quota sucessfully removed.");
@@ -366,8 +366,8 @@ RemoveUserQuota()
   if ( (args = GetQuotaArgs(FALSE) ) == NULL)
     return(DM_NORMAL);
 
-  if ( (status = sms_query("get_nfs_quota", 2, args,
-                          StoreInfo, (char *) &top)) != SMS_SUCCESS)
+  if ( (status = do_sms_query("get_nfs_quota", 2, args,
+                             StoreInfo, (char *) &top)) != SMS_SUCCESS)
     com_err(program_name, status, " in get_nfs_quota");
 
   FreeInfo(args);
index 6f04d590abef476cff4a8998e5f470a748541918..38907fb196dfbeef302d8f0f8ee975c490a854f4 100644 (file)
@@ -207,8 +207,8 @@ char *name1, *name2;
     switch(type) {
     case LOGIN:
        args[0] = name1;
-       if ( (status = sms_query("get_user_by_login", 1, args,
-                              StoreInfo, (char *) &elem)) != 0) {
+       if ( (status = do_sms_query("get_user_by_login", 1, args,
+                                   StoreInfo, (char *) &elem)) != 0) {
            com_err(program_name, status, 
                    " when attempting to get_user_by_login.");
            return (NULL);               
@@ -216,8 +216,8 @@ char *name1, *name2;
        break;
     case UID:
        args[0] = name1;
-       if ( (status = sms_query("get_user_by_uid", 1, args,
-                              StoreInfo, (char *) &elem)) != 0) {
+       if ( (status = do_sms_query("get_user_by_uid", 1, args,
+                                   StoreInfo, (char *) &elem)) != 0) {
            com_err(program_name, status, 
                    " when attempting to get_user_by_uid.");
            return (NULL);      
@@ -226,8 +226,8 @@ char *name1, *name2;
     case BY_NAME:
        args[0] = name1;
        args[1] = name2;    
-       if ( (status = sms_query("get_user_by_name", 2, args,
-                              StoreInfo, (char *) &elem)) != 0) {
+       if ( (status = do_sms_query("get_user_by_name", 2, args,
+                                   StoreInfo, (char *) &elem)) != 0) {
            com_err(program_name, status, 
                    " when attempting to get_user_by_name.");
            return (NULL);      
@@ -235,8 +235,8 @@ char *name1, *name2;
        break;
     case CLASS:
        args[0] = name1;
-       if ( (status = sms_query("get_user_by_class", 1, args,
-                              StoreInfo, (char *) &elem)) != 0) {
+       if ( (status = do_sms_query("get_user_by_class", 1, args,
+                                   StoreInfo, (char *) &elem)) != 0) {
            com_err(program_name, status, 
                    " when attempting to get_user_by_class.");
            return (NULL);      
@@ -260,8 +260,8 @@ AddNewUser()
     char ** args, *info[MAX_ARGS_SIZE];
 
     args = AskUserInfo(SetUserDefaults(info), FALSE);
-    if ( (status = sms_query("add_user", CountArgs(args), 
-                            args, Scream, (char *) NULL)) != SMS_SUCCESS)
+    if ( (status = do_sms_query("add_user", CountArgs(args), 
+                               args, Scream, (char *) NULL)) != SMS_SUCCESS)
        com_err(program_name, status, " in add_user");
     else
        Put_message("New user added to database.");
@@ -336,8 +336,8 @@ GetUidNumberFromName()
     args[0] = first;
     args[1] = last;
     
-    switch (status = sms_query("get_user_by_name", 2, args,
-                              StoreInfo, (char *) &top)) {
+    switch (status = do_sms_query("get_user_by_name", 2, args,
+                                 StoreInfo, (char *) &top)) {
     case SMS_SUCCESS:
        break;
     case SMS_NO_MATCH:
@@ -433,8 +433,8 @@ RegisterUser()
     args[2] = fstype;
     args[3] = NULL;
     
-    switch (status = sms_query("register_user", CountArgs(args),
-                              args, Scream, (char *) NULL)) {
+    switch (status = do_sms_query("register_user", CountArgs(args),
+                                 args, Scream, (char *) NULL)) {
     case SMS_SUCCESS:
        sprintf(temp_buf, "User %s successfully registered.", login);
        Put_message(temp_buf);
@@ -470,8 +470,8 @@ Bool junk;
     char error_buf[BUFSIZ];
     char ** args = AskUserInfo(info, TRUE);
     
-    if ( (status = sms_query("update_user", CountArgs(args), 
-                            args, Scream, (char *) NULL)) != SMS_SUCCESS) {
+    if ( (status = do_sms_query("update_user", CountArgs(args), 
+                               args, Scream, (char *) NULL)) != SMS_SUCCESS) {
        com_err(program_name, status, " in ModifyFields");
        sprintf(error_buf, "User %s not updated due to errors.", info[NAME]);
        Put_message(error_buf);
@@ -523,8 +523,8 @@ Bool one_item;
 
     qargs[0] = info[NAME];
     qargs[1] = "3";
-    if ((status = sms_query("update_user_status", 2, qargs, Scream,
-                           (char *) NULL)) != SMS_SUCCESS) {
+    if ((status = do_sms_query("update_user_status", 2, qargs, Scream,
+                              (char *) NULL)) != SMS_SUCCESS) {
        com_err(program_name, status, " in update_user_status");
        sprintf(txt_buf, "User %s not deactivated due to errors.", info[NAME]);
        Put_message(txt_buf);
@@ -578,8 +578,8 @@ char **argv;
     if(!ValidName(argv[1]))
        return(DM_NORMAL);
     
-    if ( (status = sms_query("get_user_by_uid", 1, argv+1, StoreInfo,
-                            (char * ) &elem)) != SMS_SUCCESS)
+    if ( (status = do_sms_query("get_user_by_uid", 1, argv+1, StoreInfo,
+                               (char * ) &elem)) != SMS_SUCCESS)
        com_err(program_name, status, " in get_user_by_uid");
     
     info = (char **) elem->q_data;
@@ -672,14 +672,3 @@ char **argv;
     FreeQueue(top);
     return (DM_NORMAL);
 }
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
This page took 0.118577 seconds and 5 git commands to generate.