/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
+#include <roken.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "budb_errs.h"
#include "database.h"
#include "error_macros.h"
-#include "budb_prototypes.h"
+#include "budb_internal.h"
#include "globals.h"
#include "afs/audit.h"
int parseServerList(struct cmd_item *);
char lcell[MAXKTCREALMLEN];
-afs_int32 myHost = 0;
+afs_uint32 myHost = 0;
int helpOption;
/* server's global configuration information. This is exported to other
afs_uint32 SHostAddrs[ADDRSPERSITE];
#if defined(AFS_PTHREAD_ENV)
-char *
+static int
threadNum(void)
{
- return pthread_getspecific(rx_thread_id_key);
+ return (intptr_t)pthread_getspecific(rx_thread_id_key);
}
#endif
}
int
-convert_cell_to_ubik(struct afsconf_cell *cellinfo, afs_int32 *myHost,
- afs_int32 *serverList)
+convert_cell_to_ubik(struct afsconf_cell *cellinfo, afs_uint32 *myHost,
+ afs_uint32 *serverList)
{
int i;
char hostname[64];
printf("prserver: couldn't get address of this host.\n");
BUDB_EXIT(1);
}
- memcpy(myHost, th->h_addr, sizeof(afs_int32));
+ memcpy(myHost, th->h_addr, sizeof(afs_uint32));
for (i = 0; i < cellinfo->numServers; i++)
/* omit my host from serverList */
* If it were, this routine would never have been called.
*/
static int
-MyBeforeProc(register struct cmd_syndesc *as, void *arock)
+MyBeforeProc(struct cmd_syndesc *as, void *arock)
{
helpOption = 0;
return 0;
cmd_AddParm(cptr, "-rxbind", CMD_FLAG, CMD_OPTIONAL,
"bind the Rx socket (primary interface only)");
+ cmd_AddParm(cptr, "-audit-interface", CMD_SINGLE, CMD_OPTIONAL,
+ "audit interface (file or sysvmq)");
}
int
else
ubik_nBuffers = 0;
- if (as->parms[7].items != 0) {
- char *fileName = as->parms[7].items->data;
-
- osi_audit_file(fileName);
- }
+ /* param 7 (-auditlog) handled below */
/* user provided the number of threads */
if (as->parms[8].items != 0) {
rxBind = 1;
}
+ /* -audit-interface */
+ if (as->parms[10].items != 0) {
+ char *interface = as->parms[10].items->data;
+
+ if (osi_audit_interface(interface)) {
+ printf("Invalid audit interface '%s'\n", interface);
+ BUDB_EXIT(-1);
+ }
+ }
+
+ /* -auditlog */
+ /* needs to be after -audit-interface, so we osi_audit_interface
+ * before we osi_audit_file */
+ if (as->parms[7].items != 0) {
+ char *fileName = as->parms[7].items->data;
+
+ osi_audit_file(fileName);
+ }
+
return 0;
}
char clones[MAXHOSTSPERCELL];
struct rx_service *tservice;
- struct rx_securityClass *sca[3];
+ struct rx_securityClass **securityClasses;
+ afs_int32 numClasses;
extern int rx_stackSize;
#ifdef AFS_AIX32_ENV
/*
- * The following signal action for AIX is necessary so that in case of a
- * crash (i.e. core is generated) we can include the user's data section
+ * The following signal action for AIX is necessary so that in case of a
+ * crash (i.e. core is generated) we can include the user's data section
* in the core dump. Unfortunately, by default, only a partial core is
* generated which, in many cases, isn't too useful.
*/
/*
globalConfPtr->log = fopen(DEFAULT_LOGNAME,"a");
if ( globalConfPtr->log == NULL )
- {
+ {
printf("Can't open log file %s - aborting\n", DEFAULT_LOGNAME);
BUDB_EXIT(-1);
}
LogDebug(1, "Using server list from %s cell database.\n", lcell);
- code = afsconf_GetExtendedCellInfo (BU_conf, lcell, 0, &cellinfo,
- &clones);
+ code = afsconf_GetExtendedCellInfo (BU_conf, lcell, 0, &cellinfo,
+ clones);
code =
convert_cell_to_ubik(&cellinfo, &globalConfPtr->myHost,
globalConfPtr->serverList);
}
/* initialize ubik */
- ubik_CRXSecurityProc = afsconf_ClientAuth;
- ubik_CRXSecurityRock = BU_conf;
-
- ubik_SRXSecurityProc = afsconf_ServerAuth;
- ubik_SRXSecurityRock = BU_conf;
-
- ubik_CheckRXSecurityProc = afsconf_CheckAuth;
- ubik_CheckRXSecurityRock = BU_conf;
+ ubik_SetClientSecurityProcs(afsconf_ClientAuth, afsconf_UpToDate, BU_conf);
+ ubik_SetServerSecurityProcs(afsconf_BuildServerSecurityObjects,
+ afsconf_CheckAuth, BU_conf);
if (ubik_nBuffers == 0)
ubik_nBuffers = 400;
if (rxBind) {
afs_int32 ccode;
- if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
+ 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);
- } else
+ } else
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}
}
code = ubik_ServerInitByInfo (globalConfPtr->myHost,
- htons(AFSCONF_BUDBPORT),
+ htons(AFSCONF_BUDBPORT),
&cellinfo,
- clones,
+ clones,
dbNamePtr, /* name prefix */
&BU_dbase);
ERROR(code);
}
- sca[RX_SCINDEX_NULL] = rxnull_NewServerSecurityObject();
- sca[RX_SCINDEX_VAB] = 0;
- sca[RX_SCINDEX_KAD] =
- rxkad_NewServerSecurityObject(rxkad_clear, BU_conf, afsconf_GetKey,
- NULL);
+ afsconf_BuildServerSecurityObjects(BU_conf, &securityClasses, &numClasses);
/* Disable jumbograms */
rx_SetNoJumbo();
tservice =
- rx_NewServiceHost(host, 0, BUDB_SERVICE, "BackupDatabase", sca, 3,
- BUDB_ExecuteRequest);
+ rx_NewServiceHost(host, 0, BUDB_SERVICE, "BackupDatabase",
+ securityClasses, numClasses, BUDB_ExecuteRequest);
+
if (tservice == (struct rx_service *)0) {
LogError(0, "Could not create backup database rx service\n");
printf("Could not create backup database rx service\n");
va_list ap;
va_start(ap, fmt);
-
+
if (debugging >= level) {
/* log normally closed so can remove it */
globalConfPtr->log = fopen(AFSDIR_SERVER_BUDBLOG_FILEPATH, "a");