Browse Source

HPCC-25336 Roll back deleted Network Address check

Based on the JIRA comment, I am rolling back the deleted Network
Address check in FileSpray.DropZoneFiles.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx 4 years ago
parent
commit
04634e8913
1 changed files with 8 additions and 0 deletions
  1. 8 0
      esp/services/ws_fs/ws_fsService.cpp

+ 8 - 0
esp/services/ws_fs/ws_fsService.cpp

@@ -3211,6 +3211,14 @@ bool CFileSprayEx::onDropZoneFiles(IEspContext &context, IEspDropZoneFilesReques
         context.ensureFeatureAccess(FILE_SPRAY_URL, SecAccess_Read, ECLWATCH_FILE_SPRAY_ACCESS_DENIED, "Permission denied.");
 
         const char* netAddress = req.getNetAddress();
+        if (!isEmptyString(netAddress))
+        {
+            IpAddress ipToCheck;
+            ipToCheck.ipset(netAddress);
+            if (ipToCheck.isNull())
+                throw makeStringExceptionV(ECLWATCH_INVALID_INPUT, "Invalid server %s specified.", netAddress);
+        }
+
         bool filesFromALinux = false;
         IArrayOf<IEspDropZone> dropZoneList;
         bool ECLWatchVisibleOnly = req.getECLWatchVisibleOnly();