*pos = '_';
strcat(logFile, deviceName);
/* now put back deviceName to the way it was */
- if (mvFlag) {
- mvFlag = 0;
+ if (mvFlag)
deviceName -= devPrefLen;
- }
+
strcpy(deviceName, storeDevice);
return (0);
return (code);
}
+#ifdef xbsa
+static void
+xbsa_shutdown(int x)
+{
+ xbsa_Finalize(&butxInfo);
+ exit(0);
+}
+#endif
+
static int
WorkerBee(struct cmd_syndesc *as, void *arock)
{
afs_int32 code;
- struct rx_securityClass *(securityObjects[3]);
+ struct rx_securityClass *(securityObjects[1]);
struct rx_service *service;
time_t tokenExpires;
char cellName[64];
struct stat sbuf;
afs_int32 statcode;
#ifndef AFS_NT40_ENV
- char path[AFSDIR_PATH_MAX];
+ char *path;
#endif
statcode = stat(centralLogFile, &sbuf);
}
#ifndef AFS_NT40_ENV
/* Make sure it is not in AFS, has to have been created first */
- if (!realpath(centralLogFile, path)) {
+ path = malloc(AFSDIR_PATH_MAX);
+ if (path == NULL || !realpath(centralLogFile, path)) {
fprintf(stderr,
"Warning: can't determine real path of '%s' (%d)\n",
centralLogFile, errno);
exit(1);
}
}
+ free(path);
#endif
/* Write header if created it */
rc = InitToServer(0 /*taskid */ , &butxInfo, adsmServerName);
if (rc != XBSA_SUCCESS)
return (1);
+ (void)signal(SIGINT, xbsa_shutdown);
+ (void)signal(SIGHUP, xbsa_shutdown);
}
#endif /*xbsa */
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
- ccode = parseNetFiles(SHostAddrs, NULL, NULL,
- ADDRSPERSITE, reason,
- AFSDIR_SERVER_NETINFO_FILEPATH,
- AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+ ccode = afsconf_ParseNetFiles(SHostAddrs, NULL, NULL,
+ ADDRSPERSITE, reason,
+ AFSDIR_SERVER_NETINFO_FILEPATH,
+ AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
* security on connections made to this server
*/
- securityObjects[0] = rxnull_NewServerSecurityObject();
- securityObjects[1] = (struct rx_securityClass *)0; /* don't bother with rxvab */
- if (!securityObjects[0]) {
+ securityObjects[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
+ if (!securityObjects[RX_SECIDX_NULL]) {
TLog(0, "rxnull_NewServerSecurityObject");
exit(1);
}
service =
- rx_NewServiceHost(host, 0, 1, "BUTC", securityObjects, 3, TC_ExecuteRequest);
+ rx_NewServiceHost(host, 0, 1, "BUTC", securityObjects, 1, TC_ExecuteRequest);
if (!service) {
TLog(0, "rx_NewService");
exit(1);
setlinebuf(stdout);
- ts = cmd_CreateSyntax(NULL, WorkerBee, NULL, "tape coordinator");
+ ts = cmd_CreateSyntax(NULL, WorkerBee, NULL, 0, "tape coordinator");
cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "port offset");
cmd_AddParm(ts, "-debuglevel", CMD_SINGLE, CMD_OPTIONAL, "0 | 1 | 2");
cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
ti->next = 0;
ti->data = "0";
ts->parms[1].items = ti;
- ts->parms[2].items = (struct cmd_item *)NULL;
- ts->parms[3].items = (struct cmd_item *)NULL;
- ts->parms[4].items = (struct cmd_item *)NULL;
- ts->parms[5].items = (struct cmd_item *)NULL;
+ ts->parms[2].items = NULL;
+ ts->parms[3].items = NULL;
+ ts->parms[4].items = NULL;
+ ts->parms[5].items = NULL;
return WorkerBee(ts, NULL);
} else
return cmd_Dispatch(argc, argv);