Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99641 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78142 invoked from network); 26 Jun 2017 09:34:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2017 09:34:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=come@opensides.be; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=come@opensides.be; sender-id=pass Received-SPF: pass (pb1.pair.com: domain opensides.be designates 195.154.20.141 as permitted sender) X-PHP-List-Original-Sender: come@opensides.be X-Host-Fingerprint: 195.154.20.141 smtp.opensides.be Received: from [195.154.20.141] ([195.154.20.141:41784] helo=smtp.opensides.be) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/4F-12245-F25D0595 for ; Mon, 26 Jun 2017 05:34:40 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp.opensides.be (Postfix) with ESMTP id B7E9ACD08A; Mon, 26 Jun 2017 11:34:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at opensides.be Received: from smtp.opensides.be ([127.0.0.1]) by localhost (smtp.opensides.be [127.0.0.1]) (amavisd-new, port 10024) with LMTP id zDAgI1bkZG8Y; Mon, 26 Jun 2017 11:34:35 +0200 (CEST) Received: from mcmic-probook.localnet (63.120.199.77.rev.sfr.net [77.199.120.63]) by smtp.opensides.be (Postfix) with ESMTPSA id AC347CCCA1; Mon, 26 Jun 2017 11:34:35 +0200 (CEST) To: php-internals Date: Mon, 26 Jun 2017 11:34:32 +0200 Message-ID: <8613502.pYZHiygsMh@mcmic-probook> Organization: OpenSides User-Agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Subject: PHP-LDAP EXOP support From: come@opensides.be (=?ISO-8859-1?Q?C=F4me?= Chilliet) Hello, Some time ago, someone said on the tracker that there was an up to date= patch for php-ldap exop and controls: https://bugs.php.net/bug.php?id=3D= 69445 It appeared the code was in fact not up to date, at least not for PHP7.= But it was enough to make me try again to work from there to add EXOP s= upport to PHP-LDAP, so I extracted the part about EXOP from the patch a= nd worked from there to have something working with current master. The result is there for now: https://github.com/MCMic/php-src/tree/ldap= _exop At least the methods for passwd and whoami EXOPs are working fine. Which PHP release should a change like that target? Do I need to open an RFC for these methods? For now I just fixed code from the original patch mainly but I would li= ke to rework the API as I=E2=80=99m not convinced by the current state.= ldap_exop and ldap_parse_exop API seems reasonable, but ldap_exop expec= ts ber encoded data as request data and I=E2=80=99m not sure how to cre= ate that. I think we should add a PHP method to ber encode, or change ldap_exop t= o accept an other format and ber encode internally. For the helper methods for whoami and passwd, I=E2=80=99m a bit puzzled= . They can work like this now: ldap_exop_whoami($link, $authzid); // This return TRUE upon success or = FALSE otherwise $r =3D ldap_exop_whoami($link); // This return a result object you need= to parse ldap_parse_exop_whoami($link, $r, $authzid); // This will parse the res= ult object and fill the third param with the result I would go for something a lot simpler like ldap_exop_whoami($link) dir= ectly returning the string result, or FALSE if it fails. For ldap_exop_passwd, I would go for ldap_exop_passwd($link, $user, $ol= dpw, $newpw) which would return FALSE on failure, TRUE on success with = a new password, or the generated password if $newpw is empty. So I would ditch ldap_parse_exop_whoami and ldap_parse_exop_passwd. Peo= ple can use ldap_exop and ldap_parse_exop if they want to work with res= ult objects. I guess we will also need constants for OID of all known EXOP operation= s out there. C=C3=B4me