com php-src: Added support for assert control value encoding: ext/ldap/ldap.c
| From: | Côme Bernigaud | Date: | Thu, 21 Sep 2017 08:05:40 +0000 |
| Subject: | com php-src: Added support for assert control value encoding: ext/ldap/ldap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99502@lists.php.net to get a copy of this message | ||
Commit: 02bd89a5520ca58c24a774a1768199cc43280171
Author: Côme Chilliet <mcmic@php.net> Wed, 26 Jul 2017 11:51:29 +0200
Parents: 5691d8bf49e8e6609c4b8187dce419dd7bc92e16
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=02bd89a5520ca58c24a774a1768199cc43280171
Log:
Added support for assert control value encoding
Changed paths:
M ext/ldap/ldap.c
Diff:
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index ba125f0..6423018 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -245,6 +245,21 @@ static int _php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, zval*
arra
control_value = NULL;
}
}
+ } else if (strcmp(control_oid, LDAP_CONTROL_ASSERT) == 0) {
+ zval* tmp;
+ char* assert;
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "filter", sizeof("filter") -
1)) != NULL) {
+ convert_to_string_ex(tmp);
+ assert = Z_STRVAL_P(tmp);
+ control_value = ber_memalloc(sizeof * control_value);
+ if (control_value != NULL) {
+ rc = ldap_create_assertion_control_value(ld, assert, control_value);
+ if (rc != LDAP_SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Failed to create assert control value: %s (%d)",
ldap_err2string(rc), rc);
+ control_value = NULL;
+ }
+ }
+ }
} else {
php_error_docref(NULL, E_WARNING, "Control OID %s does not expect an array as value",
control_oid);
}