return afsconf_SuperUser(bozo_confdir, call, NULL);
}
+/**
+ * Return true if this name is a member of the local realm.
+ */
+int
+bozo_IsLocalRealmMatch(void *rock, char *name, char *inst, char *cell)
+{
+ struct afsconf_dir *dir = (struct afsconf_dir *)rock;
+ afs_int32 islocal = 0; /* default to no */
+ int code;
+
+ code = afsconf_IsLocalRealmMatch(dir, &islocal, name, inst, cell);
+ if (code) {
+ bozo_Log("Failed local realm check; code=%d, name=%s, inst=%s, cell=%s\n",
+ code, name, inst, cell);
+ }
+ return islocal;
+}
+
/* restart bozo process */
int
bozo_ReBozo(void)
make_pid_filename(char *ainst, char *aname)
{
char *buffer = NULL;
- int length;
- length = strlen(DoPidFiles) + strlen(ainst) + 6;
if (aname && *aname) {
- length += strlen(aname) + 1;
- }
- buffer = malloc(length * sizeof(char));
- if (!buffer) {
- if (aname) {
+ asprintf(&buffer, "%s/%s.%s.pid", DoPidFiles, ainst, aname);
+ if (buffer == NULL)
bozo_Log("Failed to alloc pid filename buffer for %s.%s.\n",
ainst, aname);
- } else {
- bozo_Log("Failed to alloc pid filename buffer for %s.\n", ainst);
- }
} else {
- if (aname && *aname) {
- snprintf(buffer, length, "%s/%s.%s.pid", DoPidFiles, ainst,
- aname);
- } else {
- snprintf(buffer, length, "%s/%s.pid", DoPidFiles, ainst);
- }
+ asprintf(&buffer, "%s/%s.pid", DoPidFiles, ainst);
+ if (buffer == NULL)
+ bozo_Log("Failed to alloc pid filename buffer for %s.\n", ainst);
}
+
return buffer;
}
exit(code);
}
+ /* Disable jumbograms */
+ rx_SetNoJumbo();
+
+ if (rxMaxMTU != -1) {
+ if (rx_SetMaxMTU(rxMaxMTU) != 0) {
+ bozo_Log("bosserver: rxMaxMTU %d is invalid\n", rxMaxMTU);
+ exit(1);
+ }
+ }
+
code = LWP_CreateProcess(BozoDaemon, BOZO_LWP_STACKSIZE, /* priority */ 1,
/* param */ NULL , "bozo-the-clown",
&bozo_pid);
}
}
+ /* initialize audit user check */
+ osi_audit_set_user_check(tdir, bozo_IsLocalRealmMatch);
+
/* read init file, starting up programs */
if ((code = ReadBozoFile(0))) {
bozo_Log
bozo_CreatePidFile("bosserver", NULL, getpid());
}
- /* Disable jumbograms */
- rx_SetNoJumbo();
-
- if (rxMaxMTU != -1) {
- if (rx_SetMaxMTU(rxMaxMTU) != 0) {
- bozo_Log("bosserver: rxMaxMTU %d is invalid\n", rxMaxMTU);
- exit(1);
- }
- }
-
tservice = rx_NewServiceHost(host, 0, /* service id */ 1,
"bozo", securityClasses, numClasses,
BOZO_ExecuteRequest);