From 5d378a280f74405fccbadbfb28e1066613c76fd8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Dec 2001 11:18:56 +0000 Subject: added internal sasl/gssapi code. This means we are no longer dependent on cyrus-sasl which makes the code much less fragile. Also added code to auto-determine the server name or realm (This used to be commit 435fdf276a79c2a517adcd7726933aeef3fa924b) --- source3/utils/net_ads.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/utils') 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)); -- cgit