summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-16 10:56:40 +0100
committerGünther Deschner <gd@samba.org>2008-01-16 11:08:05 +0100
commit168e122682debee53041250292da214f88f534fa (patch)
tree3ce591c6a41f2f912fa66863cb07f9023bd24349
parent1311918d177723616a01ac5fa2c61d2f93b431a2 (diff)
downloadsamba-168e122682debee53041250292da214f88f534fa.tar.gz
samba-168e122682debee53041250292da214f88f534fa.tar.bz2
samba-168e122682debee53041250292da214f88f534fa.zip
Autofetch domain_sid while unjoining in libnetjoin.
Guenther (This used to be commit 622109895c56ed7cc02dac006f02cac89424b569)
-rw-r--r--source3/libnet/libnet_join.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index f699b09b78..af7f9a6a21 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -1280,6 +1280,17 @@ static WERROR libnet_DomainUnjoin(TALLOC_CTX *mem_ctx,
{
NTSTATUS status;
+ if (!r->in.domain_sid) {
+ struct dom_sid sid;
+ if (!secrets_fetch_domain_sid(lp_workgroup(), &sid)) {
+ libnet_unjoin_set_error_string(mem_ctx, r,
+ "Unable to fetch domain sid: are we joined?");
+ return WERR_SETUP_NOT_JOINED;
+ }
+ r->in.domain_sid = sid_dup_talloc(mem_ctx, &sid);
+ W_ERROR_HAVE_NO_MEMORY(r->in.domain_sid);
+ }
+
if (!r->in.dc_name) {
struct DS_DOMAIN_CONTROLLER_INFO *info;
status = dsgetdcname(mem_ctx,