diff --git a/dali/base/dautils.cpp b/dali/base/dautils.cpp index fe3eb7fcb0a..38dad59731d 100644 --- a/dali/base/dautils.cpp +++ b/dali/base/dautils.cpp @@ -1489,7 +1489,16 @@ bool CDfsLogicalFileName::getExternalPath(StringBuffer &dir, StringBuffer &tail, *e = makeStringExceptionV(-1, "plane:: does not support planes with more than one device '%s'", planeName.str()); return false; } - dir.append(plane->queryPrefix()); + const char * prefix = plane->queryPrefix(); + //If the prefix is a PathSepChar, it should not be appended to the dir here because + //a PathSepChar will be appended to the dir inside the expandExternalPath() if the s + //is started with the "::". + //Also a trailing pathsepchar in the prefix should be removed. + if (!isRootDirectory(prefix)) + { + dir.append(prefix); + removeTrailingPathSepChar(dir); + } } } } diff --git a/dockerfiles/platform-build/Dockerfile b/dockerfiles/platform-build/Dockerfile index 826d9e80488..d5072178dfc 100644 --- a/dockerfiles/platform-build/Dockerfile +++ b/dockerfiles/platform-build/Dockerfile @@ -44,7 +44,7 @@ RUN groupadd -g 10001 hpcc RUN useradd -s /bin/bash -r -m -N -c "hpcc runtime User" -u 10000 -g hpcc hpcc RUN passwd -l hpcc -RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.18/bin/linux/amd64/kubectl && chmod +x ./kubectl && mv ./kubectl /usr/local/bin +RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.27.6/bin/linux/amd64/kubectl && chmod +x ./kubectl && mv ./kubectl /usr/local/bin WORKDIR /hpcc-dev RUN mkdir build diff --git a/dockerfiles/vcpkg/platform-core-ubuntu-22.04.dockerfile b/dockerfiles/vcpkg/platform-core-ubuntu-22.04.dockerfile index 74eea1a1bdf..ff20fac4848 100644 --- a/dockerfiles/vcpkg/platform-core-ubuntu-22.04.dockerfile +++ b/dockerfiles/vcpkg/platform-core-ubuntu-22.04.dockerfile @@ -59,7 +59,7 @@ RUN apt-get install -y \ gdb \ nano -RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.18/bin/linux/amd64/kubectl && \ +RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.27.6/bin/linux/amd64/kubectl && \ chmod +x ./kubectl && \ mv ./kubectl /usr/local/bin diff --git a/esp/services/ws_fileio/ws_fileioservice.cpp b/esp/services/ws_fileio/ws_fileioservice.cpp index f99b4df3f67..304adaa908d 100644 --- a/esp/services/ws_fileio/ws_fileioservice.cpp +++ b/esp/services/ws_fileio/ws_fileioservice.cpp @@ -97,6 +97,7 @@ bool CWsFileIOEx::onReadFileData(IEspContext &context, IEspReadFileDataRequest & return true; } + //Despite the "DestRelativePath" saying it's relative for legacy reason, it also supports absolute paths. const char* destRelativePath = req.getDestRelativePath(); if (!destRelativePath || (destRelativePath[0] == 0)) { diff --git a/esp/smc/SMCLib/TpCommon.cpp b/esp/smc/SMCLib/TpCommon.cpp index dfe5abad996..1d1fc12ba09 100644 --- a/esp/smc/SMCLib/TpCommon.cpp +++ b/esp/smc/SMCLib/TpCommon.cpp @@ -184,9 +184,6 @@ extern TPWRAPPER_API IPropertyTree* getDropZoneAndValidateHostAndPath(const char static SecAccessFlags getDropZoneScopePermissions(IEspContext& context, const IPropertyTree* dropZone, const char* dropZonePath) { - if (isEmptyString(dropZonePath)) - throw makeStringException(ECLWATCH_INVALID_CLUSTER_NAME, "getDropZoneScopePermissions(): DropZone path must be specified."); - //If the dropZonePath is an absolute path, change it to a relative path. if (isAbsolutePath(dropZonePath)) { @@ -203,9 +200,6 @@ static SecAccessFlags getDropZoneScopePermissions(IEspContext& context, const IP static SecAccessFlags getDZPathScopePermissions(IEspContext& context, const char* dropZoneName, const char* dropZonePath, const char* dropZoneHost) { - if (isEmptyString(dropZonePath)) - throw makeStringException(ECLWATCH_INVALID_CLUSTER_NAME, "getDZPathScopePermissions(): DropZone path must be specified."); - Owned dropZone; if (isEmptyString(dropZoneName)) { @@ -348,6 +342,16 @@ extern TPWRAPPER_API void validateDropZoneAccess(IEspContext& context, const cha if (!isHostInPlane(dropZone, hostReq, true)) throw makeStringExceptionV(ECLWATCH_INVALID_INPUT, "Host %s is not valid DropZone plane %s", hostReq, targetDZNameOrHost); } + + //If the dropZonePath is an absolute path, change it to a relative path. + if (isAbsolutePath(fileNameWithRelPath)) + { + const char* relativePath = getRelativePath(fileNameWithRelPath, dropZone->queryProp("@prefix")); + if (nullptr == relativePath) + throw makeStringExceptionV(ECLWATCH_INVALID_INPUT, "Invalid DropZone path %s.", fileNameWithRelPath); + fileNameWithRelPath = relativePath; + } + const char *dropZoneName = dropZone->queryProp("@name"); SecAccessFlags permission = getDZFileScopePermissions(context, dropZoneName, fileNameWithRelPath, hostReq); if ((permission < permissionReq) && getGlobalConfigSP()->getPropBool("expert/@failOverToLegacyPhysicalPerms", !isContainerized())) diff --git a/roxie/ccd/ccdfile.cpp b/roxie/ccd/ccdfile.cpp index d7762aafc86..63222365a95 100644 --- a/roxie/ccd/ccdfile.cpp +++ b/roxie/ccd/ccdfile.cpp @@ -1185,7 +1185,7 @@ class CRoxieFileCache : implements IRoxieFileCache, implements ICopyFileProgress throw MakeStringException(ROXIE_FILE_ERROR, "Local file %s does not match DFS information", localLocation); else { - if (doTrace(TraceFlags::Always, TraceFlags::Detailed)) + if (doTrace(TraceFlags::Always, TraceFlags::Standard)) { #ifndef _CONTAINERIZED DBGLOG("Failed to open file at any of the following %d local locations:", localLocations.length());