Index: xvfs-core.c ================================================================== --- xvfs-core.c +++ xvfs-core.c @@ -29,11 +29,13 @@ int (*registerProc)(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo); }; #endif /* XVFS_MODE_FLEXIBLE || XVFS_MODE_SERVER */ #if defined(XVFS_MODE_SERVER) || defined(XVFS_MODE_STANDALONE) || defined(XVFS_MODE_FLEXIBLE) -#define XVFS_ROOT_MOUNTPOINT "//xvfs:/" +#ifndef XVFS_ROOT_MOUNTPOINT +# define XVFS_ROOT_MOUNTPOINT "//xvfs:/" +#endif struct xvfs_tclfs_instance_info { struct Xvfs_FSInfo *fsInfo; Tcl_Obj *mountpoint; }; @@ -986,27 +988,35 @@ int pathLen, rootLen; XVFS_DEBUG_ENTER; XVFS_DEBUG_PRINTF("Verifying that \"%s\" belongs in XVFS ...", Tcl_GetString(path)); - + + path = xvfs_absolutePath(path); + rootStr = XVFS_ROOT_MOUNTPOINT; rootLen = strlen(XVFS_ROOT_MOUNTPOINT); pathStr = Tcl_GetStringFromObj(path, &pathLen); if (pathLen < rootLen) { + Tcl_DecrRefCount(path); + XVFS_DEBUG_PUTS("... failed (length too short)"); XVFS_DEBUG_LEAVE; return(-1); } if (memcmp(pathStr, rootStr, rootLen) != 0) { + Tcl_DecrRefCount(path); + XVFS_DEBUG_PUTS("... failed (incorrect prefix)"); XVFS_DEBUG_LEAVE; return(-1); } + + Tcl_DecrRefCount(path); XVFS_DEBUG_PUTS("... yes"); XVFS_DEBUG_LEAVE; @@ -1018,12 +1028,16 @@ struct xvfs_tclfs_instance_info *retval; int rootLen; char *pathStr, *fsName, *fsNameEnds, origSep; XVFS_DEBUG_ENTER; + + path = xvfs_absolutePath(path); if (xvfs_tclfs_dispatch_pathInFS(path, NULL) != TCL_OK) { + Tcl_DecrRefCount(path); + XVFS_DEBUG_LEAVE; return(NULL); } @@ -1051,10 +1065,12 @@ XVFS_DEBUG_PRINTF("... found a registered filesystem: %p", retval); } else { retval = NULL; XVFS_DEBUG_PUTS("... found no registered filesystem."); } + + Tcl_DecrRefCount(path); XVFS_DEBUG_LEAVE; return(retval); /*