Hello,
I’m currently working on a PHP RFC to add EXOP handling to php-ldap. The draft is here: https://wiki.php.net/rfc/ldap_exop
You are welcome to comment on any aspect of the RFC, but I would especially want to know:
- Which are the EXOPs actually used by people out there?
- Is there any EXOP using the responseName field? In the RFCs I read there is always something like «an ExtendedResponse where the responseName field is absent» or «The responseName field contains the same string as that present in the request.»
Côme
Côme Chilliet come@opensides.be wrote:
I'm currently working on a PHP RFC to add EXOP handling to php-ldap. The draft is here: https://wiki.php.net/rfc/ldap_exop
FWIW I have been maintaining Pierangelo Masarati's exop patch for a while (for PHP 4, then PHP 5.4, 5.5, and 5.6). The patch have been available in NetBSD's pkgsrc: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/databases/php-ldap/files/
I might need to do the 7.1 port soon.
Le jeudi 29 juin 2017, 05:23:58 Emmanuel Dreyfus a écrit :
Côme Chilliet come@opensides.be wrote:
I'm currently working on a PHP RFC to add EXOP handling to php-ldap. The draft is here: https://wiki.php.net/rfc/ldap_exop
FWIW I have been maintaining Pierangelo Masarati's exop patch for a while (for PHP 4, then PHP 5.4, 5.5, and 5.6). The patch have been available in NetBSD's pkgsrc: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/databases/php-ldap/files/
I might need to do the 7.1 port soon.
Yeah I know that, this updated patch was signaled on PHP bug tracker a few weeks ago: https://bugs.php.net/bug.php?id=69445 I already extracted the EXOP part and ported it to PHP master, you can find the result here: https://github.com/MCMic/php-src/tree/ldap_exop
But the API will most likely change to match what is described in the RFC.
Côme
Côme Chilliet come@opensides.be wrote:
I already extracted the EXOP part and ported it to PHP master
I see the thing has been committed, which is nice. It seems ldap_refresh is missing, though. Was it omitted on purpose?
Le samedi 15 juillet 2017, 05:02:14 CEST Emmanuel Dreyfus a écrit :
I see the thing has been committed, which is nice. It seems ldap_refresh is missing, though. Was it omitted on purpose?
Well I had to adapt/rewrite the code for PHP7 so I started small with the two most used EXOP I’ve heard of.
I don’t know what ldap_refresh is for and never used it. If you think it needs a helper please open a bug on PHP bug tracker or send a patch to add it.
In the mean time you should be able to use the generic ldap_exop with the constant LDAP_EXOP_REFRESH.
Côme Chilliet come@opensides.be wrote:
I don't know what ldap_refresh is for and never used it.
it lets you change the expiry date of dynamic objects, cf slapo-dds man page.
Here is the previous implementation, I am not sure of what has to be changed. I understood TSRMLS_CC had to go for instance, but is thezre anything esle?
/* {{{ proto ? ldap_refresh(resource link , string dn , int ttl, [int *newttl]) DDS refresh extended operation */ PHP_FUNCTION(ldap_refresh) { zval **link, **dn, **ttl, **newttl; struct berval ldn; ber_int_t lttl; ber_int_t lnewttl; ldap_linkdata *ld; LDAP *ldap; LDAPMessage *ldap_res; int rc, msgid, myargcount = ZEND_NUM_ARGS();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ|Z", &link, &dn, &ttl, &newttl) != SUCCESS) { WRONG_PARAM_COUNT; }
if (Z_TYPE_PP(link) == IS_NULL) { ldap = NULL; } else { ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); ldap = ld->link; }
ldn.bv_len = 0; convert_to_string_ex(dn); ldn.bv_val = Z_STRVAL_PP(dn); ldn.bv_len = Z_STRLEN_PP(dn);
convert_to_long_ex(ttl); lttl = (ber_int_t)Z_LVAL_PP(ttl);
/* asynchronous call */ rc = ldap_refresh_s(ld->link, &ldn, lttl, &lnewttl, NULL, NULL); if (rc != LDAP_SUCCESS ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Refresh extended operation failed: %s (%d)", ldap_err2string(rc), rc); RETURN_FALSE; }
if (myargcount == 4) { zval_dtor(*newttl); ZVAL_LONG(*newttl, (long)lnewttl); } RETURN_TRUE; }
Le lundi 17 juillet 2017, 18:18:47 CEST Emmanuel Dreyfus a écrit :
Côme Chilliet come@opensides.be wrote:
I don't know what ldap_refresh is for and never used it.
it lets you change the expiry date of dynamic objects, cf slapo-dds man page.
Here is the previous implementation, I am not sure of what has to be changed. I understood TSRMLS_CC had to go for instance, but is thezre anything esle?
https://wiki.php.net/phpng-upgradinghttps://wiki.php.net/phpng-upgrading
zval** should be changed for zval* (and zval* for zval).
For consistency I would call the method ldap_exop_refresh and return newttl instead of using an out parameter.
Côme
Emmanuel Dreyfus manu@netbsd.org wrote:
Here is the previous implementation,
For whoever followed the thread: ldap_exop_refresh() implementation has been merged and will be available in PHP 7.3. The prototype changes from ldap_refresh() in the previous patch against PHP 5.6.
openldap-technical@openldap.org