Bug #11845: ldap_mod_add/ldap_mod_del duplicating LDAP calls sporadically
| From: | michael dot jackson at lightyearcom dot com | Date: | Mon, 02 Jul 2001 19:13:41 +0000 |
| Subject: | Bug #11845: ldap_mod_add/ldap_mod_del duplicating LDAP calls sporadically | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-58735@lists.php.net to get a copy of this message | ||
From: michael.jackson@lightyearcom.com
Operating system: Solaris 2.8
PHP version: 4.0.5
PHP Bug Type: LDAP related
Bug description: ldap_mod_add/ldap_mod_del duplicating LDAP calls sporadically
PHP is linked against the IPlanet LDAP SDK v5.0, using --ldap=/usr/local/ldap
ldap_mod_add and ldap_mod_del seem to sporadically duplicate LDAP calls.... Take the following
function.
function addtogroup($ds, $username, $groupname) {
$addme["memberuid"] = #username;
$dn = "cn=".$groupname.", ou=group, dc=ltyr, dc=net";
$res = ldap_mod_add($ds, $dn, $addme);
echo "Hi - I've run!";
if ($res) {
return TRUE;
}
else {
$errstr = ldap_error($ds);
echo "Ldap error: $errstr<p>";
return FALSE;
}
}
In this function, I added the "echo" statement to make sure that ldap_mod_add is only
being called once. It is. Yet, I sporadically get errors stating "Type or value exists",
along with a PHP warning: "LDAP: modify operation could not be completed" - in addition, I
see the MOD line come through the LDAP logs twice. However, the attribute is always deleted / added
correctly.
There seems to be no consistency to this whatsoever.
--
Edit Bug report at: http://bugs.php.net/?id=11845&edit=1