From db20fa5d4ea17b295c09a68f4210a62802704b32 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 6 Aug 2002 10:01:38 +0000 Subject: fixed 'net ads chostpass' for new ads structures (This used to be commit 3b0e60e522b669bad77e70d9c6f484a08ff84612) --- source3/utils/net_ads.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 6916bcb406..ad405fe68c 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -880,7 +880,17 @@ static int net_ads_change_localhost_pass(int argc, const char **argv) char *hostname; ADS_STATUS ret; - if (!(ads = ads_init_simple())) return -1; + if (!secrets_init()) { + DEBUG(1,("Failed to initialise secrets database\n")); + return -1; + } + + asprintf(&opt_user_name, "%s$", global_myname); + opt_password = secrets_fetch_machine_password(); + + if (!(ads = ads_startup())) { + return -1; + } hostname = strdup(global_myname); strlower(hostname); -- cgit