summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-08-31 12:18:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:26 -0500
commitdbdc0fecb6f5491cb36e93e5f39df2d89f611e17 (patch)
tree996ccd0248a25500dee25176178bcae9b2a85615 /source3/libads
parenta4c92698c652328d04206ab3b4aeabda9e5c2943 (diff)
downloadsamba-dbdc0fecb6f5491cb36e93e5f39df2d89f611e17.tar.gz
samba-dbdc0fecb6f5491cb36e93e5f39df2d89f611e17.tar.bz2
samba-dbdc0fecb6f5491cb36e93e5f39df2d89f611e17.zip
r24832: In the winbind-locator recursion case, try to pick up the kdc from the
environment. Guenther (This used to be commit 7f42fe4e08c0899f5e8addbc5135d87af193ee68)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/smb_krb5_locator.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/source3/libads/smb_krb5_locator.c b/source3/libads/smb_krb5_locator.c
index 5f90c71a2b..5de080c7ba 100644
--- a/source3/libads/smb_krb5_locator.c
+++ b/source3/libads/smb_krb5_locator.c
@@ -335,9 +335,28 @@ krb5_error_code smb_krb5_locator_lookup(void *private_data,
goto failed;
}
} else {
- /* FIXME: here comes code for locator being called from within
- * winbind */
- goto failed;
+ const char *env = NULL;
+ char *var = NULL;
+ if (asprintf(&var, "%s_%s",
+ WINBINDD_LOCATOR_KDC_ADDRESS, realm) == -1) {
+ goto failed;
+ }
+ env = getenv(var);
+ if (!env) {
+#ifdef DEBUG_KRB5
+ fprintf(stderr, "[%5u]: smb_krb5_locator_lookup: "
+ "failed to get kdc from env %s\n",
+ (unsigned int)getpid(), var);
+#endif
+ free(var);
+ goto failed;
+ }
+ free(var);
+
+ kdc_name = strdup(env);
+ if (!kdc_name) {
+ goto failed;
+ }
}
#ifdef DEBUG_KRB5
fprintf(stderr, "[%5u]: smb_krb5_locator_lookup: "