diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-12-08 11:18:56 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-12-08 11:18:56 +0000 |
commit | 5d378a280f74405fccbadbfb28e1066613c76fd8 (patch) | |
tree | 3b039a256136b760164c9357dc0ce4fb3986b735 /source3/utils | |
parent | 22a76a063213bdc514816440d3838e145c4ec340 (diff) | |
download | samba-5d378a280f74405fccbadbfb28e1066613c76fd8.tar.gz samba-5d378a280f74405fccbadbfb28e1066613c76fd8.tar.bz2 samba-5d378a280f74405fccbadbfb28e1066613c76fd8.zip |
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)
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)); |