Kaynağa Gözat

HPCC-17080 System built with USE_OPENLDAP=0 doesn't start

ESP Service ws_access gets loaded and initialized even it HPCC was
built without LDAP support. This causes it to throw an exception
when binding, causing ESP to not load.  This PR modifies ESP to only
load ws_access if LDAP has been built in

Signed-off-by: Russ Whitehead <william.whitehead@lexisnexis.com>
Russ Whitehead 8 yıl önce
ebeveyn
işleme
24e73b4cf0
1 değiştirilmiş dosya ile 18 ekleme ve 2 silme
  1. 18 2
      esp/platform/espcfg.cpp

+ 18 - 2
esp/platform/espcfg.cpp

@@ -467,7 +467,15 @@ void CEspConfig::loadServices()
     map<string, srv_cfg*>::iterator iter = m_services.begin();
     while (iter!=m_services.end())
     {
-        loadService(*(iter->second));
+#ifndef _USE_OPENLDAP
+        const string svcName = iter->first;
+        if (!strstr(svcName.data(), "ws_access"))
+#endif
+            loadService(*(iter->second));
+#ifndef _USE_OPENLDAP
+        else
+            DBGLOG("Not loading service %s, platform built without LDAP", svcName.data());
+#endif
         iter++;
     }
 }
@@ -488,7 +496,15 @@ void CEspConfig::loadBindings()
     
     while (iter!=m_bindings.end())
     {
-        loadBinding(**iter);
+#ifndef _USE_OPENLDAP
+        const char * bindingName = (**iter).name.str();
+        if (!strstr(bindingName, "ws_access"))
+#endif
+            loadBinding(**iter);
+#ifndef _USE_OPENLDAP
+        else
+            DBGLOG("Not binding %s, platform built without LDAP", bindingName);
+#endif
         iter++;
     }
 }