X-Git-Url: http://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Futil%2Fdirpath.c;h=188042dbdd9b77cb5ac2ab9e96133ef51bb2c89d;hp=0b7acc1f4a3a65f80f9c312891103c6085ff2bec;hb=8e3383a9eacb39a0e90eaabf5c78679c720f8e39;hpb=f2235b4832f9745608cde593daa22fcf79070220 diff --git a/src/util/dirpath.c b/src/util/dirpath.c index 0b7acc1..188042d 100644 --- a/src/util/dirpath.c +++ b/src/util/dirpath.c @@ -135,12 +135,19 @@ initDirPathArray(void) FilepathNormalize(ntServerInstallDirShort); /* get the afs client configuration directory (/usr/vice/etc equivalent) */ - status = GetWindowsDirectory(ntClientConfigDirLong, AFSDIR_PATH_MAX); - if (status == 0 || status > AFSDIR_PATH_MAX) { - /* failed to get canonical Windows directory; use temp directory */ - strcpy(ntClientConfigDirLong, gettmpdir()); + if (afssw_GetClientInstallDir(&buf)) { + /* failed */ + status = GetWindowsDirectory(ntClientConfigDirLong, AFSDIR_PATH_MAX); + if (status == 0 || status > AFSDIR_PATH_MAX) { + /* failed to get canonical Windows directory; use temp directory */ + strcpy(ntClientConfigDirLong, gettmpdir()); + } else { + initStatus |= AFSDIR_CLIENT_PATHS_OK; + } } else { - initStatus |= AFSDIR_CLIENT_PATHS_OK; + strcpy(ntClientConfigDirLong, buf); + free(buf); + initStatus |= AFSDIR_CLIENT_PATHS_OK; } FilepathNormalize(ntClientConfigDirLong); @@ -187,7 +194,6 @@ initDirPathArray(void) /* now initialize various dir and file paths exported by dirpath module */ /* server dir paths */ - strcpy(dirPathArray[AFSDIR_SERVER_AFS_DIRPATH_ID], afsSrvDirPath); pathp = dirPathArray[AFSDIR_SERVER_ETC_DIRPATH_ID]; @@ -218,7 +224,6 @@ initDirPathArray(void) AFSDIR_SERVER_DIRPATH(pathp, AFSDIR_BIN_FILE_DIR); /* client dir path */ - #ifdef AFS_NT40_ENV strcpy(dirPathArray[AFSDIR_CLIENT_VICE_DIRPATH_ID], "/NoUsrViceDirectoryOnWindows"); @@ -237,7 +242,6 @@ initDirPathArray(void) #endif /* AFS_NT40_ENV */ /* server file paths */ - pathp = dirPathArray[AFSDIR_SERVER_THISCELL_FILEPATH_ID]; AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_SERVER_ETC_DIR, AFSDIR_THISCELL_FILE); @@ -363,7 +367,6 @@ initDirPathArray(void) /* client file paths */ - #ifdef AFS_NT40_ENV strcpy(dirPathArray[AFSDIR_CLIENT_THISCELL_FILEPATH_ID], "/NoUsrViceEtcThisCellFileOnWindows");