#include <afs/param.h>
#include <roken.h>
+#include <afs/opr.h>
#include <stddef.h>
#include <ctype.h>
#include <limits.h>
-#include "afs_assert.h"
#include "afsutil.h"
#include "fileutil.h"
+#include <afs/opr.h>
+
#ifdef AFS_PTHREAD_ENV
#include <pthread.h>
static pthread_once_t dirInit_once = PTHREAD_ONCE_INIT;
pathp = dirPathArray[AFSDIR_SERVER_BOZINIT_FILEPATH_ID];
AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_BOSCONFIG_DIR, AFSDIR_BOZINIT_FILE);
+ pathp = dirPathArray[AFSDIR_SERVER_BOZRXBIND_FILEPATH_ID];
+ AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_BOSCONFIG_DIR, AFSDIR_BOZRXBIND_FILE);
+
pathp = dirPathArray[AFSDIR_SERVER_BOSVR_FILEPATH_ID];
AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_BOSSERVER_DIR, AFSDIR_BOSVR_FILE);
status = EINVAL;
} else {
/* fully qualified path; just make a copy */
- newPath = (char *)malloc(strlen(cpath) + 1);
- if (!newPath) {
+ newPath = strdup(cpath);
+ if (!newPath)
status = ENOMEM;
- } else {
- (void)strcpy(newPath, cpath);
- }
}
} else {
LocalizePathHead(&cpath, &relativeTo);
if (*cpath == '/') {
- newPath = (char *)malloc(strlen(cpath) + 1);
- if (!newPath) {
- status = ENOMEM;
- } else {
- strcpy(newPath, cpath);
- }
+ newPath = strdup(cpath);
} else {
- newPath = (char *)malloc(strlen(relativeTo) + 1 + strlen(cpath) + 1);
- if (!newPath) {
- status = ENOMEM;
- } else {
- sprintf(newPath, "%s/%s", relativeTo, cpath);
- }
+ asprintf(&newPath, "%s/%s", relativeTo, cpath);
}
+ if (newPath == NULL)
+ status = ENOMEM;
if (status == 0) {
FilepathNormalize(newPath);