Browse Source

Ticket #48782 - Make sure that when LDAP_OPT_X_TLS_NEWCTX is set, the value is set to zero.

Description: The attached patch is for the optval issue described above.
Optval is explicitly set to zero, rather than using whatever arbitrary
value is present in optval from the earlier ldap_set_option call.

https://fedorahosted.org/389/ticket/48782

Reviewed by [email protected].
Graham Leggett 9 years ago
parent
commit
16445ac913
1 changed files with 2 additions and 1 deletions
  1. 2 1
      ldap/servers/slapd/ldaputil.c

+ 2 - 1
ldap/servers/slapd/ldaputil.c

@@ -605,7 +605,8 @@ setup_ol_tls_conn(LDAP *ld, int clientauth)
 
     /* have to do this last - this creates the new TLS handle and sets/copies
        all of the parameters set above into that TLS handle context - note
-       that optval is ignored - what matters is that it is not NULL */
+       that optval is zero, meaning create a context for a client */
+    optval = 0;
     if ((rc = ldap_set_option(ld, LDAP_OPT_X_TLS_NEWCTX, &optval))) {
 	slapi_log_error(SLAPI_LOG_FATAL, "setup_ol_tls_conn",
 			"failed: unable to create new TLS context - %d\n", rc);