From 3dcf4a91464b47b9bc06476c0db0ce27d7dd11c8 Mon Sep 17 00:00:00 2001 From: Ludwig Krispenz Date: Aug 27 2014 15:21:31 +0000 Subject: Ticket 47866 - Errors after upgrading related to attribute "dnaremotebindmethod" Bug Description: the dnaSharedConfig entries can contain "(null)" values Fix Description: check if remoteBindDn and remoteConnProtocol are set, before creating a vaue for teh entries. NOTE: if these values aready have been created they have to be deleted and the server restarted https://fedorahosted.org/389/ticket/47866 Reviewed by: mark, thanks --- diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c index 6162137..b42150a 100644 --- a/ldap/servers/plugins/dna/dna.c +++ b/ldap/servers/plugins/dna/dna.c @@ -2474,12 +2474,16 @@ dna_get_shared_config_attr_val(struct configEntry *config_entry, char *attr, cha while (server) { if(slapi_sdn_compare(server->sdn, server_sdn) == 0){ if(strcmp(attr, DNA_REMOTE_BIND_METHOD) == 0){ - PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_bind_method); - found = 1; + if (server->remote_bind_method) { + PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_bind_method); + found = 1; + } break; } else if(strcmp(attr, DNA_REMOTE_CONN_PROT) == 0){ - PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_conn_prot); - found = 1; + if (server->remote_conn_prot) { + PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_conn_prot); + found = 1; + } break; } }