php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7168 Unable to delete "facsimileTelephoneNumber" attribute
Submitted: 2000-10-12 17:08 UTC Modified: 2000-11-14 15:02 UTC
From: espot at rosa dot nta dot no Assigned: venaas (profile)
Status: Closed Package: LDAP related
PHP Version: 4.0.3 OS: RedHat 6.2
Private report: No CVE-ID: None
 [2000-10-12 17:08 UTC] espot at rosa dot nta dot no
The following script fails with the following output.

Warning: LDAP: modify operation could not be completed. in crash.php line 18
Warning: LDAP: modify operation could not be completed. in crash.php line 21

I'm using OpenLdap 2.0.6 (same for 2.0.3)
and PHP 4.0.3 (same for 4.0.2)

if "facsimileTelephoneNumber" is substituted with "telephoneNumber" or any other attribute the script 
runs fine. (except of course for trying to delete the same value twice)


<?php
$ds=ldap_connect("localhost");  // assuming the LDAP server is on this host

if ($ds) {
  // bind with appropriate dn to give update access
  $r=ldap_bind($ds,"cn=root, o=LS, c=NO", "secret");
  
  // prepare data
  $info["cn"]="John Jones";
  $info["sn"]="Jones";
  $info["facsimileTelephoneNumber"] = "555-55555";
  $info["mail"]="jonj@here.and.now";
  $info["objectclass"]="inetOrgPerson";
  
  $r=ldap_add($ds, "cn=John Jones, o=LS, c=NO", $info);

  $modInfo["facsimileTelephoneNumber"] = "";
  ldap_modify($ds, "cn=John Jones, o=LS, c=NO", $modInfo);

  $delInfo["facsimileTelephoneNumber"] = "555-55555";
  ldap_mod_del($ds, "cn=John Jones, o=LS, c=NO", $modInfo);

  ldap_close($ds);
} else {
  echo "Unable to connect to LDAP server"; 
}
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-12 17:13 UTC] espot at rosa dot nta dot no
in line 21 modInfo should be replaced by delInfo.
The problem remains the same.
 [2000-11-04 01:51 UTC] sniper@php.net
There is no bug. 
If you first delete the attribute with ldap_modify() of course
the ldap_mod_del() fails.

--Jani
 [2000-11-05 10:47 UTC] espot at rosa dot nta dot no
The following script also fails:

<?php
$ds=ldap_connect("localhost");  // assuming the LDAP server is on this host

if ($ds) {
  // bind with appropriate dn to give update access
  $r=ldap_bind($ds,"cn=root, o=LS, c=NO", "secret");
  
  // prepare data
  $info["cn"]="John Jones";
  $info["sn"]="Jones";
  $info["facsimileTelephoneNumber"] = "555-55555";
  $info["mail"]="jonj@here.and.now";
  $info["objectclass"]="inetOrgPerson";
  
  $r=ldap_add($ds, "cn=John Jones, o=LS, c=NO", $info);

  $delInfo["facsimileTelephoneNumber"] = "555-55555";
  ldap_mod_del($ds, "cn=John Jones, o=LS, c=NO", $delInfo);

  ldap_close($ds);
} else {
  echo "Unable to connect to LDAP server"; 
}?>

 [2000-11-08 00:25 UTC] sniper@php.net
Try adding this after both ldap_add() and ldap_mod_del() functions:

echo ldap_error($ds);

--Jani
 [2000-11-08 09:43 UTC] espot at rosa dot nta dot no
After adding:

echo ldap_error($ds);

after both ldap_add() and ldap_mod_del() the new output is:

Success
Warning: LDAP: modify operation could not be completed. in /home/httpd/html/skolekatalogen/crash.php on line 19
Success
 [2000-11-14 15:02 UTC] venaas@php.net
The reason is that OpenLDAP as per RFC 2252 doesn't have equality
matching for facsimileTelephoneNumber. Why they didn't define the
matching similar to telephoneNumber is beyond me. You can fix it by
changing the schema I guess. You might want to ask about this on the
OpenLDAP lists.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 09 07:01:27 2024 UTC