Skip to content

Commit

Permalink
HPCC-30455 Fix a bug when trying to validate empty host
Browse files Browse the repository at this point in the history
When File Upload dialog box is displayed in a containerized
environment, it sends a FileList request with an empty Netaddr
to ESP FileSpray service. The service should not validate the
Netaddr.

Signed-off-by: wangkx <[email protected]>
  • Loading branch information
wangkx committed Oct 17, 2023
1 parent 71a73b6 commit 9605b7f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions esp/smc/SMCLib/TpCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,10 @@ extern TPWRAPPER_API IPropertyTree* getDropZoneAndValidateHostAndPath(const char
dropZone.setown(getDropZonePlane(dropZoneName));
if (!dropZone)
throw makeStringExceptionV(ECLWATCH_INVALID_INPUT, "DropZone '%s' not found.", dropZoneName);
if (!validateDropZone(dropZone, pathToCheck, hostToCheck, isIPAddress(hostToCheck)))
throw makeStringExceptionV(ECLWATCH_INVALID_INPUT, "The host '%s' or path '%s' is not valid for dropzone %s.",
isEmptyString(host) ? "unspecified" : host, isEmptyString(path) ? "unspecified" : path, dropZoneName);
if (!isEmptyString(hostToCheck) && !isHostInPlane(dropZone, hostToCheck, isIPAddress(hostToCheck)))
throw makeStringExceptionV(ECLWATCH_INVALID_INPUT, "The host '%s' is not valid for dropzone %s.", host, dropZoneName);
if (!isEmptyString(pathToCheck) && !isPathInPlane(dropZone, pathToCheck))
throw makeStringExceptionV(ECLWATCH_INVALID_INPUT, "The path '%s' is not valid for dropzone %s.", path, dropZoneName);
}
return dropZone.getClear();
}
Expand Down

0 comments on commit 9605b7f

Please sign in to comment.