|
@@ -2218,32 +2218,39 @@ void CFileSprayEx::getDropZoneInfoByIP(const char* ip, const char* destFileIn, S
|
|
|
if (!env)
|
|
|
return;
|
|
|
|
|
|
- Owned<IConstMachineInfo> machine = env->getMachineByAddress(ip);
|
|
|
- if (!machine)
|
|
|
- {
|
|
|
- IpAddress ipAddr;
|
|
|
- ipAddr.ipset(ip);
|
|
|
- if (!ipAddr.isLocal())
|
|
|
- return;
|
|
|
- machine.setown(env->getMachineForLocalHost());
|
|
|
- if (!machine)
|
|
|
- return;
|
|
|
- }
|
|
|
- SCMStringBuffer computer, directory, maskBuf;
|
|
|
- machine->getName(computer);
|
|
|
- if (!computer.length())
|
|
|
- return;
|
|
|
-
|
|
|
- Owned<IConstDropZoneInfo> dropZone = env->getDropZoneByComputer(computer.str());
|
|
|
- if (!dropZone)
|
|
|
- return;
|
|
|
- dropZone->getDirectory(directory);
|
|
|
+ SCMStringBuffer directory;
|
|
|
+ Owned<IConstDropZoneInfo> dropZone;
|
|
|
|
|
|
StringBuffer destFile;
|
|
|
if (isAbsolutePath(destFileIn))
|
|
|
+ {
|
|
|
destFile.set(destFileIn);
|
|
|
+ dropZone.setown(env->getDropZoneByAddressPath(ip, destFile.str()));
|
|
|
+ if (!dropZone)
|
|
|
+ return;
|
|
|
+ dropZone->getDirectory(directory);
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
+ SCMStringBuffer computer;
|
|
|
+ Owned<IConstMachineInfo> machine = env->getMachineByAddress(ip);
|
|
|
+ if (!machine)
|
|
|
+ {
|
|
|
+ IpAddress ipAddr;
|
|
|
+ ipAddr.ipset(ip);
|
|
|
+ if (!ipAddr.isLocal())
|
|
|
+ return;
|
|
|
+ machine.setown(env->getMachineForLocalHost());
|
|
|
+ if (!machine)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ machine->getName(computer);
|
|
|
+ if (!computer.length())
|
|
|
+ return;
|
|
|
+ dropZone.setown(env->getDropZoneByComputer(computer.str()));
|
|
|
+ if (!dropZone)
|
|
|
+ return;
|
|
|
+ dropZone->getDirectory(directory);
|
|
|
destFile.set(directory.str());
|
|
|
if (destFile.length())
|
|
|
addPathSepChar(destFile);
|
|
@@ -2252,6 +2259,7 @@ void CFileSprayEx::getDropZoneInfoByIP(const char* ip, const char* destFileIn, S
|
|
|
destFileOut.set(destFile.str());
|
|
|
if ((destFile.length() >= directory.length()) && !strnicmp(destFile.str(), directory.str(), directory.length()))
|
|
|
{
|
|
|
+ SCMStringBuffer maskBuf;
|
|
|
dropZone->getUMask(maskBuf);
|
|
|
if (maskBuf.length())
|
|
|
mask.set(maskBuf.str());
|