Bläddra i källkod

HPCC-23868 Fix issues starting Dali without environment

1) Disable white list if no environment
2) Default NamedMutex (only used by Dali) to current directory,
if no 'lock' path setting available from environment.

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 5 år sedan
förälder
incheckning
0682ebd7d5
2 ändrade filer med 3 tillägg och 1 borttagningar
  1. 2 0
      dali/server/daserver.cpp
  2. 1 1
      system/jlib/jmutex.cpp

+ 2 - 0
dali/server/daserver.cpp

@@ -148,6 +148,8 @@ static bool populateWhiteListFromEnvironment(IWhiteListWriter &writer)
         return false;
     Owned<IRemoteConnection> conn = querySDS().connect("/Environment", 0, 0, INFINITE);
     assertex(conn);
+    if (!conn->queryRoot()->hasProp("Software/DaliServerProcess"))
+        return false;
 
     // only ever expecting 1 DaliServerProcess and 1 WhiteList
     const IPropertyTree *whiteListTree = conn->queryRoot()->queryPropTree("Software/DaliServerProcess[1]/WhiteList[1]");

+ 1 - 1
system/jlib/jmutex.cpp

@@ -209,7 +209,7 @@ NamedMutex::NamedMutex(const char *name)
         if (0 == lockPrefix.length())
         {
             if (!getConfigurationDirectory(NULL, "lock", NULL, NULL, lockPrefix))
-                throw MakeStringException(0, "Failed to get lock directory from environment");
+                WARNLOG("Failed to get lock directory from environment");
         }
         addPathSepChar(lockPrefix);
         lockPrefix.append("JLIBMUTEX_");