/* database directory */
if (as->parms[0].items != 0) {
- globalConfPtr->databaseDirectory =
- (char *)malloc(strlen(as->parms[0].items->data) + 1);
+ globalConfPtr->databaseDirectory = strdup(as->parms[0].items->data);
if (globalConfPtr->databaseDirectory == 0)
BUDB_EXIT(-1);
- strcpy(globalConfPtr->databaseDirectory, as->parms[0].items->data);
}
/* -cellservdb, cell configuration directory */
if (as->parms[1].items != 0) {
- globalConfPtr->cellConfigdir =
- (char *)malloc(strlen(as->parms[1].items->data) + 1);
+ globalConfPtr->cellConfigdir = strdup(as->parms[1].items->data);
if (globalConfPtr->cellConfigdir == 0)
BUDB_EXIT(-1);
- strcpy(globalConfPtr->cellConfigdir, as->parms[1].items->data);
-
globalConfPtr->debugFlags |= DF_RECHECKNOAUTH;
}
afs_int32 code = 0;
int fd;
- path = malloc(strlen(globalConfPtr->databaseDirectory) +
- strlen(globalConfPtr->databaseName) +
- strlen(globalConfPtr->databaseExtension) + 1);
+ asprintf(&path, "%s%s%s",
+ globalConfPtr->databaseDirectory,
+ globalConfPtr->databaseName,
+ globalConfPtr->databaseExtension);
if (path == NULL)
ERROR(-1);
- /* construct the database name */
- strcpy(path, globalConfPtr->databaseDirectory);
- strcat(path, globalConfPtr->databaseName);
- strcat(path, globalConfPtr->databaseExtension);
-
fd = open(path, O_RDWR, 0755);
if (!fd) {
code = errno;
LogError(0, "Will allocate %d ubik buffers\n", ubik_nBuffers);
- dbNamePtr =
- (char *)malloc(strlen(globalConfPtr->databaseDirectory) +
- strlen(globalConfPtr->databaseName) + 1);
+ asprintf(&dbNamePtr, "%s%s", globalConfPtr->databaseDirectory,
+ globalConfPtr->databaseName);
if (dbNamePtr == 0)
ERROR(-1);
- /* construct the database name */
- strcpy(dbNamePtr, globalConfPtr->databaseDirectory);
- strcat(dbNamePtr, globalConfPtr->databaseName); /* name prefix */
-
rx_SetRxDeadTime(60); /* 60 seconds inactive before timeout */
if (rxBind) {
}
}
+ /* Disable jumbograms */
+ rx_SetNoJumbo();
+
code = ubik_ServerInitByInfo (globalConfPtr->myHost,
htons(AFSCONF_BUDBPORT),
&cellinfo,
afsconf_BuildServerSecurityObjects(BU_conf, &securityClasses, &numClasses);
- /* Disable jumbograms */
- rx_SetNoJumbo();
-
tservice =
rx_NewServiceHost(host, 0, BUDB_SERVICE, "BackupDatabase",
securityClasses, numClasses, BUDB_ExecuteRequest);