osaf/tools/safimm/immcfg/imm_cfg.c | 36 +++++++++++++++++++----------------- 1 files changed, 19 insertions(+), 17 deletions(-)
Fix RDN value with a DN of an associated object when a new object is created by immcfg. diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c b/osaf/tools/safimm/immcfg/imm_cfg.c --- a/osaf/tools/safimm/immcfg/imm_cfg.c +++ b/osaf/tools/safimm/immcfg/imm_cfg.c @@ -427,30 +427,32 @@ int object_create(const SaNameT **object str = strdup((char*)objectNames[i]->value); if ((delim = strchr(str, ',')) != NULL) { /* a parent exist */ - while (*(delim - 1) == 0x5c) { + while (delim && *(delim - 1) == 0x5c) { /* comma delimiter is escaped, search again */ delim += 2; delim = strchr(delim, ','); } - *delim = '\0'; - parent = delim + 1; - if (!parent) { - fprintf(stderr, "error - malformed object DN\n"); - goto done; - } + if(delim) { + *delim = '\0'; + parent = delim + 1; + if (!parent) { + fprintf(stderr, "error - malformed object DN\n"); + goto done; + } - dn.length = sprintf((char*)dn.value, "%s", parent); - parentName = &dn; - parentNames[0] = parentName; + dn.length = sprintf((char*)dn.value, "%s", parent); + parentName = &dn; + parentNames[0] = parentName; - VERBOSE_INFO("call saImmOmAdminOwnerSet for parent: %s\n", parent); - if ((error = immutil_saImmOmAdminOwnerSet(ownerHandle, parentNames, SA_IMM_SUBTREE)) != SA_AIS_OK) { - if (error == SA_AIS_ERR_NOT_EXIST) - fprintf(stderr, "error - parent '%s' does not exist\n", dn.value); - else { - fprintf(stderr, "error - saImmOmAdminOwnerSet FAILED: %s\n", saf_error(error)); - goto done; + VERBOSE_INFO("call saImmOmAdminOwnerSet for parent: %s\n", parent); + if ((error = immutil_saImmOmAdminOwnerSet(ownerHandle, parentNames, SA_IMM_SUBTREE)) != SA_AIS_OK) { + if (error == SA_AIS_ERR_NOT_EXIST) + fprintf(stderr, "error - parent '%s' does not exist\n", dn.value); + else { + fprintf(stderr, "error - saImmOmAdminOwnerSet FAILED: %s\n", saf_error(error)); + goto done; + } } } } ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel