From 2e584a1a59b4de7c6909bf60d3f189797fff7c67 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Tue, 4 Jul 2000 10:35:07 +0000 Subject: [PATCH] (get_krbhst): only try SRV lookup if there are none in the configuration file git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8540 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/krbhst.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/krb5/krbhst.c b/lib/krb5/krbhst.c index e5c4a5483..1b54ae283 100644 --- a/lib/krb5/krbhst.c +++ b/lib/krb5/krbhst.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -58,6 +58,11 @@ add_string(char ***res, int *count, const char *string) return 0; } +/* + * do a SRV lookup for `realm, proto, service' returning the result + * in `res, count' + */ + static krb5_error_code srv_find_realm(krb5_context context, char ***res, int *count, const char *realm, const char *proto, const char *service) @@ -131,7 +136,7 @@ get_krbhst (krb5_context context, "realms", *realm, conf_string, NULL); for(r = res, count = 0; r && *r; r++, count++); - if(context->srv_lookup) { + if(count == 0 && context->srv_lookup) { char *s[] = { "udp", "tcp", "http" }, **q; for(q = s; q < s + sizeof(s) / sizeof(s[0]); q++) { ret = srv_find_realm(context, &res, &count, *realm, *q, @@ -157,6 +162,10 @@ get_krbhst (krb5_context context, return 0; } +/* + * set `hostlist' to a malloced list of kadmin servers. + */ + krb5_error_code krb5_get_krb_admin_hst (krb5_context context, const krb5_realm *realm, @@ -166,6 +175,10 @@ krb5_get_krb_admin_hst (krb5_context context, hostlist); } +/* + * set `hostlist' to a malloced list of changepw servers. + */ + krb5_error_code krb5_get_krb_changepw_hst (krb5_context context, const krb5_realm *realm, @@ -175,6 +188,10 @@ krb5_get_krb_changepw_hst (krb5_context context, hostlist); } +/* + * set `hostlist' to a malloced list of kerberos servers. + */ + krb5_error_code krb5_get_krbhst (krb5_context context, const krb5_realm *realm, @@ -183,6 +200,10 @@ krb5_get_krbhst (krb5_context context, return get_krbhst (context, realm, "kdc", "kerberos", hostlist); } +/* + * free all memory associated with `hostlist' + */ + krb5_error_code krb5_free_krbhst (krb5_context context, char **hostlist)