RCSID
("$Header$");
+#include <fcntl.h>
+#include <sys/stat.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
-#include <fcntl.h>
#include <WINNT/afsevent.h>
#else
#include <netinet/in.h>
/* debugging control */
int debugging = 0;
+#if defined(AFS_PTHREAD_ENV)
+char *
+threadNum(void)
+{
+ return pthread_getspecific(rx_thread_id_key);
+}
+#endif
+
/* check whether caller is authorized to manage RX statistics */
int
BU_rxstat_userok(call)
cmd_AddParm(cptr, "-ubikbuffers", CMD_SINGLE, CMD_OPTIONAL,
"the number of ubik buffers");
+ cmd_AddParm(cptr, "-auditlog", CMD_SINGLE, CMD_OPTIONAL,
+ "audit log path");
+
}
int
else
ubik_nBuffers = 0;
+ if (as->parms[7].items != 0) {
+ int tempfd, flags;
+ FILE *auditout;
+ char oldName[MAXPATHLEN];
+ char *fileName = as->parms[7].items->data;
+#ifndef AFS_NT40_ENV
+ struct stat statbuf;
+
+ if ((lstat(fileName, &statbuf) == 0)
+ && (S_ISFIFO(statbuf.st_mode))) {
+ flags = O_WRONLY | O_NONBLOCK;
+ } else
+#endif
+ {
+ strcpy(oldName, fileName);
+ strcat(oldName, ".old");
+ renamefile(fileName, oldName);
+ flags = O_WRONLY | O_TRUNC | O_CREAT;
+ }
+ tempfd = open(fileName, flags, 0666);
+ if (tempfd > -1) {
+ auditout = fdopen(tempfd, "a");
+ if (auditout) {
+ osi_audit_file(auditout);
+ } else
+ printf("Warning: auditlog %s not writable, ignored.\n", fileName);
+ } else
+ printf("Warning: auditlog %s not writable, ignored.\n", fileName);
+ }
+
return 0;
}
time_t currentTime;
afs_int32 code = 0;
+ char clones[MAXHOSTSPERCELL];
+
+
+
struct rx_service *tservice;
struct rx_securityClass *sca[3];
sigaction(SIGSEGV, &nsa, NULL);
sigaction(SIGABRT, &nsa, NULL);
#endif
+ osi_audit_init();
osi_audit(BUDB_StartEvent, 0, AUD_END);
initialize_BUDB_error_table();
srandom(1);
+#ifdef AFS_PTHREAD_ENV
+ SetLogThreadNumProgram( threadNum );
+#endif
+
/* process the user supplied args */
helpOption = 1;
code = cmd_Dispatch(argc, argv);
LogDebug(1, "Using server list from %s cell database.\n", lcell);
- code = afsconf_GetCellInfo(BU_conf, lcell, 0, &cellinfo);
+ code = afsconf_GetExtendedCellInfo (BU_conf, lcell, 0, &cellinfo,
+ &clones);
code =
convert_cell_to_ubik(&cellinfo, &globalConfPtr->myHost,
globalConfPtr->serverList);
rx_SetRxDeadTime(60); /* 60 seconds inactive before timeout */
- code = ubik_ServerInit(globalConfPtr->myHost, htons(AFSCONF_BUDBPORT), globalConfPtr->serverList, dbNamePtr, /* name prefix */
- &BU_dbase);
+ code = ubik_ServerInitByInfo (globalConfPtr->myHost,
+ htons(AFSCONF_BUDBPORT),
+ &cellinfo,
+ &clones,
+ dbNamePtr, /* name prefix */
+ &BU_dbase);
+
if (code) {
LogError(code, "Ubik init failed\n");
com_err(whoami, code, "Ubik init failed");
fclose(globalConfPtr->log);
}
}
+ return 0;
}
static char *
fflush(globalConfPtr->log);
fclose(globalConfPtr->log);
}
+ return 0;
}
/*VARARGS*/
fflush(globalConfPtr->log);
fclose(globalConfPtr->log);
}
+ return 0;
}
printDump(globalConfPtr->log, &hostDump);
fclose(globalConfPtr->log);
}
+ return 0;
}