summaryrefslogtreecommitdiff
path: root/source3/utils/net_ads.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/net_ads.c')
-rw-r--r--source3/utils/net_ads.c12
1 files changed, 12 insertions, 0 deletions
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;