]> git.sur5r.net Git - openldap/commitdiff
fixed LDAP_OPT_X_TLS case of ldap_pvt_tls_config().
authorMark Valence <mrv@openldap.org>
Sat, 25 Sep 1999 03:53:17 +0000 (03:53 +0000)
committerMark Valence <mrv@openldap.org>
Sat, 25 Sep 1999 03:53:17 +0000 (03:53 +0000)
ldap_pvt_tls_set_option() expects int* as third param.

libraries/libldap/tls.c

index 0a6f47fe2281e5624f7f0d15f7d3678e34caf7e5..53c4e3b0804090d6387be7feaa05873f3a9bc527 100644 (file)
@@ -379,21 +379,19 @@ ldap_pvt_tls_config( struct ldapoptions *lo, int option, const char *arg )
                      ( strcasecmp( arg, "true" ) == 0 ) );
                return ldap_pvt_tls_set_option( NULL, option, (void *) &i );
        case LDAP_OPT_X_TLS:
+               i = -1;
                if ( strcasecmp( arg, "never" ) == 0 )
-                       return ldap_pvt_tls_set_option( lo, option,
-                               LDAP_OPT_X_TLS_NEVER );
+                       i = LDAP_OPT_X_TLS_NEVER ;
                if ( strcasecmp( arg, "demand" ) == 0 )
-                       return ldap_pvt_tls_set_option( lo, option,
-                               LDAP_OPT_X_TLS_DEMAND );
+                       i = LDAP_OPT_X_TLS_DEMAND ;
                if ( strcasecmp( arg, "allow" ) == 0 )
-                       return ldap_pvt_tls_set_option( lo, option,
-                               LDAP_OPT_X_TLS_ALLOW );
+                       i = LDAP_OPT_X_TLS_ALLOW ;
                if ( strcasecmp( arg, "try" ) == 0 )
-                       return ldap_pvt_tls_set_option( lo, option,
-                               LDAP_OPT_X_TLS_TRY );
+                       i = LDAP_OPT_X_TLS_TRY ;
                if ( strcasecmp( arg, "hard" ) == 0 )
-                       return ldap_pvt_tls_set_option( lo, option,
-                               LDAP_OPT_X_TLS_HARD );
+                       i = LDAP_OPT_X_TLS_HARD ;
+               if (i >= 0)
+                       return ldap_pvt_tls_set_option( lo, option, &i );
                return -1;
        default:
                return -1;