mirror of
https://git.openafs.org/openafs.git
synced 2025-01-21 00:10:15 +00:00
afsd: Avoid dir interpolation for memcache
memcache doesn't make use of fullpn_DCacheFile, fullpn_VolInfoFile, etc. Do not even try to generate these strings for memcache, since cacheBaseDir will be NULL, and so this can cause a segfault on some platforms including Solaris. Change-Id: I0decdb9a8866272adf500125af7edb03c98e6bdc Reviewed-on: http://gerrit.openafs.org/7442 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
parent
6f6c799c4b
commit
2e2bc535bd
@ -2090,23 +2090,25 @@ afsd_run(void)
|
||||
cacheFiles, inode_for_V, (cacheFiles * sizeof(AFSD_INO_T)));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set up all the pathnames we'll need for later.
|
||||
*/
|
||||
sprintf(fullpn_DCacheFile, "%s/%s", cacheBaseDir, DCACHEFILE);
|
||||
sprintf(fullpn_VolInfoFile, "%s/%s", cacheBaseDir, VOLINFOFILE);
|
||||
sprintf(fullpn_CellInfoFile, "%s/%s", cacheBaseDir, CELLINFOFILE);
|
||||
sprintf(fullpn_VFile, "%s/", cacheBaseDir);
|
||||
vFilePtr = fullpn_VFile + strlen(fullpn_VFile);
|
||||
if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) {
|
||||
/*
|
||||
* Set up all the pathnames we'll need for later.
|
||||
*/
|
||||
sprintf(fullpn_DCacheFile, "%s/%s", cacheBaseDir, DCACHEFILE);
|
||||
sprintf(fullpn_VolInfoFile, "%s/%s", cacheBaseDir, VOLINFOFILE);
|
||||
sprintf(fullpn_CellInfoFile, "%s/%s", cacheBaseDir, CELLINFOFILE);
|
||||
sprintf(fullpn_VFile, "%s/", cacheBaseDir);
|
||||
vFilePtr = fullpn_VFile + strlen(fullpn_VFile);
|
||||
|
||||
if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)
|
||||
&& (fsTypeMsg = CheckCacheBaseDir(cacheBaseDir))) {
|
||||
fsTypeMsg = CheckCacheBaseDir(cacheBaseDir);
|
||||
if (fsTypeMsg) {
|
||||
#ifdef AFS_SUN5_ENV
|
||||
printf("%s: WARNING: Cache dir check failed (%s)\n", rn, fsTypeMsg);
|
||||
printf("%s: WARNING: Cache dir check failed (%s)\n", rn, fsTypeMsg);
|
||||
#else
|
||||
printf("%s: ERROR: Cache dir check failed (%s)\n", rn, fsTypeMsg);
|
||||
exit(1);
|
||||
printf("%s: ERROR: Cache dir check failed (%s)\n", rn, fsTypeMsg);
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user