a0f392a96b7df8ca3ba963dbcd94b7948fd7f6f4 chmalee Wed Aug 20 14:18:40 2025 -0700 Oops, was not using return value from swapping strings from old data dir to mount point, refs #31058 diff --git src/hg/lib/userdata.c src/hg/lib/userdata.c index ca1ed6f3725..08f07d9771c 100644 --- src/hg/lib/userdata.c +++ src/hg/lib/userdata.c @@ -100,36 +100,36 @@ { if (!dataDir) setDataDir(userName); return dataDir; } char *swapDataDir(char *userName, char *in) /* Try replacing the current dataDir with what is defined in hg.conf:tusdMountPoint as * the data server may be somewhere else and mounted over NFS. In this case, when * tusd saves files, it is writing it's local tusdDataDir value into the hgcentral * file location. When the CGI running somewhere else needs to verify file existence, * the tusdDataDir won't exist on the CGI filesystem, but will instead be mounted as some * different path. In this case, replace tusdDataDir with tusdMountPoint */ { -char *ret = cloneString(in); +char *ret = NULL; char *tusdDataDir = cfgOption("tusdDataDir"); char *tusdMountPoint = cfgOption("tusdMountPoint"); if (tusdMountPoint && !isEmpty(tusdMountPoint)) { - replaceChars(ret, tusdDataDir, tusdMountPoint); + ret = replaceChars(in, tusdDataDir, tusdMountPoint); } return ret; } char *stripDataDir(char *fname, char *userName) /* Strips the getDataDir(userName) off of fname. The dataDir may be a symbolic * link, or on a different filesystem. */ { getDataDir(userName); if (!dataDir) { // catch a realpath error return NULL; } int prefixSize = strlen(dataDir);