]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/options.c
Fix off by one bug
[openldap] / libraries / libldap / options.c
index 879c70f3a897eddc6c0277b7dad37c2c06689db6..041897494dc6c9fa1ae8140e4883b34a69962b0e 100644 (file)
@@ -285,7 +285,7 @@ ldap_get_option(
                        return LDAP_OPT_SUCCESS;
 #endif
 #ifdef HAVE_CYRUS_SASL
-               if ( ldap_pvt_sasl_get_option(ld, option, outvalue ) == 0 )
+               if ( ldap_int_sasl_get_option(ld, option, outvalue ) == 0 )
                        return LDAP_OPT_SUCCESS;
 #endif
                /* bad param */
@@ -465,7 +465,8 @@ ldap_set_option(
                        int rc = LDAP_OPT_SUCCESS;
 
                        if(host != NULL) {
-                               rc = ldap_url_parsehosts(&ludlist, host);
+                               rc = ldap_url_parsehosts( &ludlist, host,
+                                       lo->ldo_defport ? lo->ldo_defport : LDAP_PORT );
 
                        } else if(ld == NULL) {
                                /*
@@ -582,7 +583,7 @@ ldap_set_option(
                return LDAP_OPT_SUCCESS;
 #endif
 #ifdef HAVE_CYRUS_SASL
-               if ( ldap_pvt_sasl_set_option( ld, option, (void *)invalue ) == 0 )
+               if ( ldap_int_sasl_set_option( ld, option, (void *)invalue ) == 0 )
                        return LDAP_OPT_SUCCESS;
 #endif
                /* bad param */
@@ -591,7 +592,7 @@ ldap_set_option(
        return LDAP_OPT_ERROR;
 }
 
-LIBLDAP_F(int)
+int
 ldap_set_rebind_proc( LDAP *ld, LDAP_REBIND_PROC *rebind_proc)
 {
        return( ldap_set_option( ld, LDAP_OPT_REBIND_PROC, (void *)rebind_proc));