case MACHINE:
newname = Strsave(info[M_NAME]);
GetValueFromUser("The new name for this machine? ", &newname);
- strcpy(temp_buf, CanonicalizeHostname(newname));
- free(newname);
- newname = Strsave(temp_buf);
+ newname = canonicalize_hostname(newname);
break;
case CLUSTER:
newname = Strsave(info[C_NAME]);
char **argv;
{
struct qelem *top;
+ char *tmpname;
- top = GetMCInfo(MACHINE, CanonicalizeHostname(argv[1]), (char *) NULL);
+ tmpname = canonicalize_hostname(strsave(argv[1]));
+ top = GetMCInfo(MACHINE, tmpname, (char *) NULL);
Loop(top, ( (void *) PrintMachInfo) );
FreeQueue(top);
return(DM_NORMAL);
/*
* Check to see if this machine already exists.
*/
- name = CanonicalizeHostname(argv[1]);
+ name = canonicalize_hostname(strsave(argv[1]));
if ( (stat = do_sms_query("get_machine", 1, &name, NullFunc, NULL)) == 0) {
Put_message("This machine already exists.");
+ free(name);
return(DM_NORMAL);
}
else if (stat != SMS_NO_MATCH) {
com_err(program_name, stat, " in AddMachine.");
+ free(name);
return(DM_NORMAL);
}
com_err(program_name, stat, " in AddMachine.");
FreeInfo(info);
+ free(name);
return(DM_NORMAL);
}
int argc;
char **argv;
{
- struct qelem *top = GetMCInfo( MACHINE, CanonicalizeHostname(argv[1]),
- (char *) NULL);
+ struct qelem *top;
+ char *tmpname;
+
+ tmpname = canonicalize_hostname(strsave(argv[1]));
+ top = GetMCInfo( MACHINE, tmpname, (char *) NULL);
QueryLoop(top, NullPrint, RealUpdateMachine, "Update the machine");
FreeQueue(top);
+ free(tmpname);
return(DM_NORMAL);
}
char **argv;
{
struct qelem *top;
+ char *tmpname;
- top = GetMCInfo(MACHINE, CanonicalizeHostname(argv[1]), (char *) NULL);
+ tmpname = canonicalize_hostname(strsave(argv[1]));
+ top = GetMCInfo(MACHINE, tmpname, (char *) NULL);
QueryLoop(top, PrintMachInfo, RealDeleteMachine, "Delete the machine");
FreeQueue(top);
+ free(tmpname);
return(DM_NORMAL);
}
Bool add_it, one_machine, one_cluster;
struct qelem * melem, *mtop, *celem, *ctop;
- machine = CanonicalizeHostname(argv[1]);
+ machine = canonicalize_hostname(strsave(argv[1]));
cluster = argv[2];
celem = ctop = GetMCInfo(CLUSTER, cluster, (char *) NULL);
melem = mtop = GetMCInfo(MACHINE, machine, (char *) NULL);
+ free(machine);
one_machine = (QueueCount(mtop) == 1);
one_cluster = (QueueCount(ctop) == 1);
char buf[BUFSIZ], * args[10];
register int stat;
- args[MAP_MACHINE] = CanonicalizeHostname(argv[1]);
+ args[MAP_MACHINE] = canonicalize_hostname(strsave(argv[1]));
args[MAP_CLUSTER] = argv[2];
args[MAP_END] = NULL;
sprintf(buf, "The machine %s is not is the cluster %s.",
args[MAP_MACHINE], args[MAP_CLUSTER]);
Put_message(buf);
+ free(args[MAP_MACHINE]);
return(DM_NORMAL);
}
if (stat != SMS_SUCCESS)
"Remove this machine from this cluster");
FreeQueue(elem);
+ free(args[MAP_MACHINE]);
return(DM_NORMAL);
}
char ** argv;
{
struct qelem *top;
+ char *tmpname;
- top = GetMCInfo(CLUSTER, CanonicalizeHostname(argv[1]), (char *) NULL);
+ tmpname = canonicalize_hostname(strsave(argv[1]));
+ top = GetMCInfo(CLUSTER, tmpname, (char *) NULL);
Loop(top, (void *) PrintClusterInfo);
FreeQueue(top);
+ free(tmpname);
return(DM_NORMAL);
}
char **argv;
{
struct qelem *elem, *top;
+ char *tmpname;
- top = elem = GetMCInfo(MAP, CanonicalizeHostname(argv[1]), argv[2]);
+ tmpname = canonicalize_hostname(strsave(argv[1]));
+ top = elem = GetMCInfo(MAP, tmpname, argv[2]);
Put_message(""); /* blank line on screen */
while (elem != NULL) {
}
FreeQueue(top);
+ free(tmpname);
return(DM_NORMAL);
}