summaryrefslogtreecommitdiff
path: root/source3/utils/net_ads.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-03-16 02:14:05 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-03-16 02:14:05 +0000
commit2f62a72d9aebf3cfe9aa60a0bdc73f1ae477d5b2 (patch)
tree0f8d04a13c953e82dd174ac161bf6fe838cc672a /source3/utils/net_ads.c
parent3a9bdacca98560706eeb4e625ef1ce7c92d4dfab (diff)
downloadsamba-2f62a72d9aebf3cfe9aa60a0bdc73f1ae477d5b2.tar.gz
samba-2f62a72d9aebf3cfe9aa60a0bdc73f1ae477d5b2.tar.bz2
samba-2f62a72d9aebf3cfe9aa60a0bdc73f1ae477d5b2.zip
Changes to help the kerberos change password code work on systems that
have some of the labels 'duplicated' (ie, the defines double-up). Also, to an ads_connect() to try and find our KDC. (So we don't segfualt *every* time) Andrew Bartlett (This used to be commit 56dce7ddad118051c93c62507234efca3920bc9b)
Diffstat (limited to 'source3/utils/net_ads.c')
-rw-r--r--source3/utils/net_ads.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 22b9d50ea1..0f2d673b4b 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -910,6 +910,15 @@ static int net_ads_password(int argc, const char **argv)
in realms other than default */
if (!(ads = ads_init(realm, NULL, NULL))) return -1;
+ /* we don't actually need a full connect, but it's the easy way to
+ fill in the KDC's addresss */
+ ads_connect(ads);
+
+ if (!ads || !ads->config.realm) {
+ d_printf("Didn't find the kerberos server!\n");
+ return -1;
+ }
+
asprintf(&prompt, "Enter new password for %s:", argv[0]);
new_password = getpass(prompt);