diff options
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_ads.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index cecfb6a4d0..4f44930038 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -44,8 +44,24 @@ static ADS_STRUCT *ads_startup(void) { ADS_STRUCT *ads; int rc; + extern char *opt_password; + extern char *opt_user_name; + ads = ads_init(NULL, NULL, NULL, NULL); + if (!opt_user_name) { + opt_user_name = "administrator"; + } + + if (!opt_password) { + char *prompt; + asprintf(&prompt,"%s password: ", opt_user_name); + opt_password = getpass(prompt); + free(prompt); + } + ads->password = strdup(opt_password); + ads->user_name = strdup(opt_user_name); + rc = ads_connect(ads); if (rc) { d_printf("ads_connect: %s\n", ads_errstr(rc)); |