]> granicus.if.org Git - php/commitdiff
Set all parameters to ldap_sasl_bind as NULL by default
authorCôme Chilliet <mcmic@php.net>
Thu, 17 Sep 2020 14:47:12 +0000 (16:47 +0200)
committerCôme Chilliet <mcmic@php.net>
Tue, 29 Sep 2020 14:31:07 +0000 (16:31 +0200)
For mech, realm, authcid, authzid and props NULL means do not change
 current server setting.

ext/ldap/ldap.c
ext/ldap/ldap.stub.php
ext/ldap/ldap_arginfo.h

index a43edd08a745d7b71b5fc1194481f4fce657ee09..6a5f9398786c7131132a748cdcceccc571520c45 100644 (file)
@@ -1337,7 +1337,7 @@ PHP_FUNCTION(ldap_sasl_bind)
        size_t rc, dn_len, passwd_len, mech_len, realm_len, authc_id_len, authz_id_len, props_len;
        php_ldap_bictx *ctx;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|sssssss", &link, &binddn, &dn_len, &passwd, &passwd_len, &sasl_mech, &mech_len, &sasl_realm, &realm_len, &sasl_authc_id, &authc_id_len, &sasl_authz_id, &authz_id_len, &props, &props_len) != SUCCESS) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!s!s!s!s!s!", &link, &binddn, &dn_len, &passwd, &passwd_len, &sasl_mech, &mech_len, &sasl_realm, &realm_len, &sasl_authc_id, &authc_id_len, &sasl_authz_id, &authz_id_len, &props, &props_len) != SUCCESS) {
                RETURN_THROWS();
        }
 
index 243e57b1427d9cc3503e7852501fd5e811dfe590..a9ec590fe1e02b2d16c1e5bb94fd847a7dd96527 100644 (file)
@@ -30,7 +30,7 @@ function ldap_bind_ext($link_identifier, string $bind_rdn = NULL, string $bind_p
 
 #ifdef HAVE_LDAP_SASL
 /** @param resource $link */
-function ldap_sasl_bind($link, string $binddn = UNKNOWN, string $password = UNKNOWN, string $sasl_mech = UNKNOWN, string $sasl_realm = UNKNOWN, string $sasl_authc_id = UNKNOWN, string $sasl_authz_id = UNKNOWN, string $props = UNKNOWN): bool {}
+function ldap_sasl_bind($link, string $binddn = NULL, string $password = NULL, string $sasl_mech = NULL, string $sasl_realm = NULL, string $sasl_authc_id = NULL, string $sasl_authz_id = NULL, string $props = NULL): bool {}
 #endif
 
 /**
index 24cb31304bf822429deddaa96990dbb6c988eaf3..1a19ee0c2abaa2353d516b76e07f18ba5756cdf7 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 4414873610a8b2099ddad28cbadd6b8d75f66431 */
+ * Stub hash: b4dc34ec9daecb904236e487fd4cf736f5f3fc44 */
 
 #if defined(HAVE_ORALDAP)
 ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0)
@@ -40,13 +40,13 @@ ZEND_END_ARG_INFO()
 #if defined(HAVE_LDAP_SASL)
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_sasl_bind, 0, 1, _IS_BOOL, 0)
        ZEND_ARG_INFO(0, link)
-       ZEND_ARG_TYPE_INFO(0, binddn, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, sasl_mech, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, sasl_realm, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, sasl_authc_id, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, sasl_authz_id, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, props, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binddn, IS_STRING, 0, "NULL")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 0, "NULL")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sasl_mech, IS_STRING, 0, "NULL")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sasl_realm, IS_STRING, 0, "NULL")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sasl_authc_id, IS_STRING, 0, "NULL")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sasl_authz_id, IS_STRING, 0, "NULL")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, props, IS_STRING, 0, "NULL")
 ZEND_END_ARG_INFO()
 #endif