#44534 [Opn->Fbk]: ldap_add() does not work
| From: | jani@php.net | Date: | Wed, 26 Mar 2008 11:49:52 +0000 |
| Subject: | #44534 [Opn->Fbk]: ldap_add() does not work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-123653@lists.php.net to get a copy of this message | ||
ID: 44534
Updated by: jani@php.net
-Summary: ldap_add() (perhaps other ldap functions) crash
Reported By: thegner at trilliumit dot com
-Status: Open
+Status: Feedback
Bug Type: LDAP related
Operating System: ubuntu gutsy server
PHP Version: 5.2.5
Assigned To: fb-req-jani
New Comment:
So it doesn't crash. Then what the actual problem is? What error do you
get? (EXACTLY!) Did you check the ldap server's logs for possible
reason?
Previous Comments:
------------------------------------------------------------------------
[2008-03-25 19:47:41] thegner at trilliumit dot com
@jani:
Perhaps I am using the word "crash" too loosely. To me, if it doesn't
do what I expect, then it's crashed :).
Sorry for the mixup.
------------------------------------------------------------------------
[2008-03-25 19:29:07] jani@php.net
If it crashes, you should be seeing something in the webserver's logs?
And if it really crashes, you should be able to provide a GDB
backtrace.
------------------------------------------------------------------------
[2008-03-25 19:15:18] thegner at trilliumit dot com
Sorry,
This Line: ldap_add($gc_con, "CN=Die\, Test,OU=Users,DC=Domain,DC=Com",
$user_attributes);
should be: ldap_add($gc_con, "CN=Die\\,
Test,OU=Users,DC=Domain,DC=Com",
$user_attributes);
------------------------------------------------------------------------
[2008-03-25 19:12:42] thegner at trilliumit dot com
Description:
------------
when doing an ldap_add() with "Die" as a persons last name, the server
returns unwilling to perform. If I change only the last name to "Die2"
it operates as expected. In our environment the following user
attributes are associated with the last name.
sn
cn
displayName
distinguishedName
sAMAccountName
mailNickname
userPrincipalName
unicodePwd
The ldap directory is Microsoft Active Directory on Windows Server 2003
Reproduce code:
---------------
<?php
$user_attributes['sAMAccountName'] = "tdie";
$user_attributes['mailNickname'] = "tdie";
$user_attributes['userPrincipalName'] = "tdie@domain.com";
$user_attributes['unicodePwd'] = "\"\000t\000d\000i\000e\000\"\000";
$user_attributes['givenName'] = "Test";
$user_attributes['sn'] = "Die";
$user_attributes['cn'] = "Die, Test";
$user_attributes['displayName'] = "Die, Test";
$user_attributes['objectClass'][0] = "top";
$user_attributes['objectClass'][1] = "person";
$user_attributes['objectClass'][2] = "organizationalPerson";
$user_attributes['objectClass'][3] = "user";
//$gc_con previously set to valid ldap_connect()
ldap_add($gc_con, "CN=Die\, Test,OU=Users,DC=Domain,DC=Com",
$user_attributes);
?>
Expected result:
----------------
We should expect the object to be added to the directory.
Actual result:
--------------
Error: Add: Server unwilling to perform...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44534&edit=1