From 91ee73e3009fdde79ce9e51ba0caac5669ed9279 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 20 Dec 2001 23:35:53 +0000 Subject: make sure we store the domain sid when joining a ADS domain (This used to be commit dfbe442c668480d88cb8b385c6b89f8e198ca500) --- source3/utils/net_ads.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/utils') diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 0853cd3bbf..7baa297230 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -210,6 +210,7 @@ static int net_ads_join(int argc, const char **argv) const char *org_unit = "Computers"; char *dn; void *res; + DOM_SID dom_sid; if (argc > 0) org_unit = argv[0]; @@ -251,6 +252,17 @@ static int net_ads_join(int argc, const char **argv) return -1; } + rc = ads_domain_sid(ads, &dom_sid); + if (!ADS_ERR_OK(rc)) { + d_printf("ads_domain_sid: %s\n", ads_errstr(rc)); + return -1; + } + + if (!secrets_store_domain_sid(lp_workgroup(), &dom_sid)) { + DEBUG(1,("Failed to save domain sid\n")); + return -1; + } + if (!secrets_store_machine_password(password)) { DEBUG(1,("Failed to save machine password\n")); return -1; -- cgit