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);
}
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);
}
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.");
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.");
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) {
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.");
* 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;
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);
"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.");
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:
- */
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);
}
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);
}
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);
}
*/
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);
}
* 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);
{
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.");
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);
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.");
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]);
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;
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.",
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]);
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);
}
/*
* 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);
{
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.");
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);
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.");
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]);
{
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.");
}
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.");
}
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:
- */
-
-
-
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;
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. */
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:
* 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);
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);
/*
* 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);
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);
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);
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:
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);
}
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);
}
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);
}
* 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);
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:
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);
#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:
- */
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. */
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.");
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);
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);
}
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);
}
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.");
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);
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:
- */
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);
}
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;
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:
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.");
"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:
- */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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);
}
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.");
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) {
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);
{
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);
}
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:
- */
-
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.");
"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]);
}
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. */
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);
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]);
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. */
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.");
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);
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);
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);
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);
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);
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.");
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:
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);
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);
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);
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;
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:
- */