summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-09-22 00:33:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:45 -0500
commit75ea9982fb82b5c20f54910926901057b56acdc5 (patch)
tree9bfecb47fe1ff7bce55245697d02f3d7f409498a /source3/rpc_server
parent557f2cf461792913f1e9d6e8228bb20f392c62d8 (diff)
downloadsamba-75ea9982fb82b5c20f54910926901057b56acdc5.tar.gz
samba-75ea9982fb82b5c20f54910926901057b56acdc5.tar.bz2
samba-75ea9982fb82b5c20f54910926901057b56acdc5.zip
r2481: Patch from Igor Belyi <sambauser@katehok.ac93.org>. Ensure pdb
user is deleted first before deleting UNIX user (LDAP backend needs this ordering). Jeremy. (This used to be commit 2815b31e013e517a58027ba74f118209caf4d85f)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_samr_nt.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 34fad9b0ed..37617db5e8 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -3675,7 +3675,14 @@ NTSTATUS _samr_delete_dom_user(pipes_struct *p, SAMR_Q_DELETE_DOM_USER *q_u, SAM
return NT_STATUS_NO_SUCH_USER;
}
- /* delete the unix side */
+ /* First delete the samba side */
+ if (!pdb_delete_sam_account(sam_pass)) {
+ DEBUG(5,("_samr_delete_dom_user:Failed to delete entry for user %s.\n", pdb_get_username(sam_pass)));
+ pdb_free_sam(&sam_pass);
+ return NT_STATUS_CANNOT_DELETE;
+ }
+
+ /* Now delete the unix side */
/*
* note: we don't check if the delete really happened
* as the script is not necessary present
@@ -3683,13 +3690,7 @@ NTSTATUS _samr_delete_dom_user(pipes_struct *p, SAMR_Q_DELETE_DOM_USER *q_u, SAM
*/
smb_delete_user(pdb_get_username(sam_pass));
- /* and delete the samba side */
- if (!pdb_delete_sam_account(sam_pass)) {
- DEBUG(5,("_samr_delete_dom_user:Failed to delete entry for user %s.\n", pdb_get_username(sam_pass)));
- pdb_free_sam(&sam_pass);
- return NT_STATUS_CANNOT_DELETE;
- }
-
+
pdb_free_sam(&sam_pass);
if (!close_policy_hnd(p, &q_u->user_pol))