Michael Gasch
2004-Jan-22 13:02 UTC
[Samba] RPC: Problem Deleting LDAP-Entries in pdb_ldap.c
hi there im using samba 3.0.1 and have problems with usrmgr.exe and rpc calls to add/delete users stored in LDAP (2.1.22) an rpc call to add/delete a user gives "Access Denied" some extracts from the log --------------------------------------------------------------------------- smbldap_search_suffix: searching for:[(&(&(objectclass=sambaSamAccount)(uid=test))(objectclass=sambaSamAccount))] [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute objectClass [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute cn [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute uid [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute displayName [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute uidNumber [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute gidNumber [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaSID [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaPrimaryGroupSID [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute homeDirectory [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaAcctFlags [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaHomeDrive [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaHomePath [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaProfilePath [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaLogonScript [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaPwdCanChange [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaPwdMustChange [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaLMPassword [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaNTPassword [2004/01/22 13:46:16, 10] passdb/pdb_ldap.c:ldapsam_delete_entry(303) ldapsam_delete_entry: deleting attribute sambaPwdLastSet [2004/01/22 13:46:16, 0] passdb/pdb_ldap.c:ldapsam_delete_entry(326) ldapsam_delete_entry: Could not delete attributes for uid=test,ou=users,dc=eva,dc=mpg,dc=de, error: Naming violation (naming attribute 'uid' is not present in entry) [2004/01/22 13:46:16, 5] rpc_server/srv_samr_nt.c:_samr_delete_dom_user(3771) _samr_delete_dom_user:Failed to delete entry for user test. --------------------------------------------------------------------------- i think the problem is, that it first deletes the attribute uid, and at the end tries to delete the whole dn (dn: uid=.......), where uid is not present any more an extract of the function in pdb_ldap.c --------------------------------------------------------------------------- if (rc != LDAP_SUCCESS) { char *ld_error = NULL; ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING, &ld_error); DEBUG(0, ("could not delete attributes for %s, error: %s (%s)\n", dn, ldap_err2string(rc), ld_error?ld_error:"unknown")); SAFE_FREE(ld_error); ldap_memfree(dn); return NT_STATUS_UNSUCCESSFUL; } --------------------------------------------------------------------------- could you give me a hint please? thx micha -- "Matrix - more than a vision" ************************************************** Michael Gasch Max Planck Institute for Evolutionary Anthropology Deutscher Platz 6 04103 Leipzig Germany **************************************************
Yohann Fourteau
2004-Feb-20 09:16 UTC
[Samba] RPC: Problem Deleting LDAP-Entries in pdb_ldap.c
Hi, I've done a patch to solve the probleme of naming violation in pdb_ldap.c when deleting/changing naming attribut (uid in most cases). Here is it (in attachment). Cdt, -- Yohann F.