Преглед изворни кода

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
Ludwig Krispenz пре 11 година
родитељ
комит
3dcf4a9146
1 измењених фајлова са 8 додато и 4 уклоњено
  1. 8 4
      ldap/servers/plugins/dna/dna.c

+ 8 - 4
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;
                 }
             }