#define file_exists(file) (access((file), F_OK) == 0)
-#define PRS "/u1/sms/bin/prs"
-#define FS "/u1/sms/bin/fs"
-
+char prs[64], fs[64];
char *whoami;
initialize_sms_error_table();
initialize_krb_error_table();
+ sprintf(prs, "%s/prs", BIN_DIR);
+ sprintf(fs, "%s/fs", BIN_DIR);
if (!strcmp(table, "users")) {
do_user(before, beforec, after, afterc);
return;
if (astate == 1 && bstate != 1) {
sprintf(cmd, "%s newuser -name %s -id %s",
- PRS, after[U_NAME], after[U_UID]);
+ prs, after[U_NAME], after[U_UID]);
do_cmd(cmd);
return;
} else if (astate != 1 && bstate == 1) {
- sprintf(cmd, "%s delete %s", PRS, before[U_NAME]);
+ sprintf(cmd, "%s delete %s", prs, before[U_NAME]);
do_cmd(cmd);
return;
}
if (beforec > U_NAME && afterc > U_NAME &&
strcmp(before[U_NAME], after[U_NAME])) {
sprintf(cmd, "%s chname -oldname %s -newname %s",
- PRS, before[U_NAME], after[U_NAME]);
+ prs, before[U_NAME], after[U_NAME]);
do_cmd(cmd);
}
}
if (bgid == 0 && agid != 0) {
sprintf(cmd,
"%s create -name system:%s -id %s -owner system:administrators",
- PRS, after[L_NAME], after[L_GID]);
+ prs, after[L_NAME], after[L_GID]);
do_cmd(cmd);
return;
}
if (agid == 0 && bgid != 0) {
- sprintf(cmd, "%s delete -name system:%s", PRS, before[L_NAME]);
+ sprintf(cmd, "%s delete -name system:%s", prs, before[L_NAME]);
do_cmd(cmd);
return;
}
if (strcmp(before[L_NAME], after[L_NAME])) {
sprintf(cmd,
"%s chname -oldname system:%s -newname system:%s",
- PRS, before[L_NAME], after[L_NAME]);
+ prs, before[L_NAME], after[L_NAME]);
do_cmd(cmd);
return;
}
if (beforec == 0 && !strcmp(after[LM_TYPE], "USER")) {
sprintf(cmd, "%s add -user %s -group system:%s",
- PRS, after[LM_MEMBER], after[LM_LIST]);
+ prs, after[LM_MEMBER], after[LM_LIST]);
do_cmd(cmd);
return;
}
if (afterc == 0 && !strcmp(before[LM_TYPE], "USER")) {
sprintf(cmd, "%s remove -user %s -group system:%s",
- PRS, before[LM_MEMBER], before[LM_LIST]);
+ prs, before[LM_MEMBER], before[LM_LIST]);
do_cmd(cmd);
return;
}
return;
if (afterc != 0) {
sprintf(cmd, "%s setquota -dir %s -quota %s",
- FS, after[Q_DIRECTORY], after[Q_QUOTA]);
+ fs, after[Q_DIRECTORY], after[Q_QUOTA]);
do_cmd(cmd);
return;
}
#include <errno.h>
#include <dcm.h>
#include <sms.h>
+#include <sms_app.h>
#include <krb.h>
extern char *malloc();
* sms_update_server(service, machine, target_path)
* DESCRIPTION:
* Attempts to perform an update to the named machine
- * of the named service. The file SMS_DIR/dcm/service.out
+ * of the named service. The file DCM_DIR/service.out
* will be sent, then the file SMS_DIR/bin/service.sh,
* the the shell script will be executed.
* INPUT:
" target pathname");
ASSERT2(target_path[0] == '/', SMS_NOT_UNIQUE,
" non-absolute pathname supplied \"%s\"", target_path);
- sprintf(buf, "%s/dcm/%s.out", SMS_DIR, service);
+ sprintf(buf, "%s/%s.out", DCM_DIR, service);
pathname = strsave(buf);
ASSERT(NONNULL(pathname), SMS_NO_MEM, " for pathname");
ASSERT(NONNULL(instructions), SMS_NO_MEM, " for instructions");