php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11845 ldap_mod_add/ldap_mod_del duplicating LDAP calls sporadically
Submitted: 2001-07-02 15:13 UTC Modified: 2002-05-25 08:58 UTC
From: michael dot jackson at lightyearcom dot com Assigned:
Status: Not a bug Package: LDAP related
PHP Version: 4.0.5 OS: Solaris 2.8
Private report: No CVE-ID: None
 [2001-07-02 15:13 UTC] michael dot jackson at lightyearcom dot com
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-25 08:58 UTC] derick@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC