osaf/services/saf/amf/amfnd/main.cc |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/main.cc 
b/osaf/services/saf/amf/amfnd/main.cc
--- a/osaf/services/saf/amf/amfnd/main.cc
+++ b/osaf/services/saf/amf/amfnd/main.cc
@@ -177,9 +177,15 @@ int main(int argc, char *argv[])
 
        // Enable long DN
        if (setenv("SA_ENABLE_EXTENDED_NAMES", "1", 1) != 0) {
-               LOG_ER("failed to set SA_ENABLE_EXTENDED_NAMES");
+               syslog(LOG_ERR, "failed to set SA_ENABLE_EXTENDED_NAMES");
                exit(EXIT_FAILURE);
        }
+       osaf_extended_name_init();
+       // Since the long DN flag is enabled, we can unset the environment
+       // variable here to prevent the application to inherit the variable
+       if (unsetenv("SA_ENABLE_EXTENDED_NAMES") != 0) {
+               syslog(LOG_WARNING, "failed to unset SA_ENABLE_EXTENDED_NAMES");
+       }
 
        if (__init_avnd() != NCSCC_RC_SUCCESS) {
                syslog(LOG_ERR, "__init_avd() failed");
@@ -226,8 +232,6 @@ uint32_t avnd_create(void)
        uint32_t rc = NCSCC_RC_SUCCESS;
        TRACE_ENTER();
 
-       osaf_extended_name_init();
-
        /* create & initialize AvND cb */
        cb = avnd_cb_create();
        if (!cb) {

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to