summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-12-08 00:09:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:59 -0500
commit6011531ac644bfae87cbce31a340e2c1e6ef929a (patch)
tree68e89a92f5a6b5978427b962e8101ad062381255 /source4/libnet
parentbe69066736c23f40d9131e608ead94874208da05 (diff)
downloadsamba-6011531ac644bfae87cbce31a340e2c1e6ef929a.tar.gz
samba-6011531ac644bfae87cbce31a340e2c1e6ef929a.tar.bz2
samba-6011531ac644bfae87cbce31a340e2c1e6ef929a.zip
r20073: update the computer_dn_str after ldb_rename()
metze (This used to be commit c40bc7d287664d67415ae0a8b7a272732172ec40)
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet_become_dc.c7
-rw-r--r--source4/libnet/libnet_unbecome_dc.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index 746b2429ce..5cd5f7ef22 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -1610,11 +1610,16 @@ static NTSTATUS becomeDC_ldap2_move_computer(struct libnet_BecomeDC_state *s)
}
ret = ldb_rename(s->ldap2.ldb, old_dn, new_dn);
- talloc_free(r);
if (ret != LDB_SUCCESS) {
+ talloc_free(r);
return NT_STATUS_LDAP(ret);
}
+ s->dest_dsa.computer_dn_str = ldb_dn_alloc_linearized(s, new_dn);
+ NT_STATUS_HAVE_NO_MEMORY(s->dest_dsa.computer_dn_str);
+
+ talloc_free(r);
+
return NT_STATUS_OK;
}
diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c
index bc29501ac4..ffec396e21 100644
--- a/source4/libnet/libnet_unbecome_dc.c
+++ b/source4/libnet/libnet_unbecome_dc.c
@@ -328,11 +328,16 @@ static NTSTATUS unbecomeDC_ldap_move_computer(struct libnet_UnbecomeDC_state *s)
}
ret = ldb_rename(s->ldap.ldb, old_dn, new_dn);
- talloc_free(r);
if (ret != LDB_SUCCESS) {
+ talloc_free(r);
return NT_STATUS_LDAP(ret);
}
+ s->dest_dsa.computer_dn_str = ldb_dn_alloc_linearized(s, new_dn);
+ NT_STATUS_HAVE_NO_MEMORY(s->dest_dsa.computer_dn_str);
+
+ talloc_free(r);
+
return NT_STATUS_OK;
}