summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/expand_hostname.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/krb5/expand_hostname.c')
-rw-r--r--crypto/heimdal/lib/krb5/expand_hostname.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/crypto/heimdal/lib/krb5/expand_hostname.c b/crypto/heimdal/lib/krb5/expand_hostname.c
index 7ed2dd5..28e39af 100644
--- a/crypto/heimdal/lib/krb5/expand_hostname.c
+++ b/crypto/heimdal/lib/krb5/expand_hostname.c
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: expand_hostname.c,v 1.11 2001/09/18 09:35:47 joda Exp $");
+RCSID("$Id: expand_hostname.c 22229 2007-12-08 21:40:59Z lha $");
static krb5_error_code
copy_hostname(krb5_context context,
@@ -54,7 +54,7 @@ copy_hostname(krb5_context context,
* allocated space returned in `new_hostname'.
*/
-krb5_error_code
+krb5_error_code KRB5_LIB_FUNCTION
krb5_expand_hostname (krb5_context context,
const char *orig_hostname,
char **new_hostname)
@@ -62,6 +62,9 @@ krb5_expand_hostname (krb5_context context,
struct addrinfo *ai, *a, hints;
int error;
+ if ((context->flags & KRB5_CTX_F_DNS_CANONICALIZE_HOSTNAME) == 0)
+ return copy_hostname (context, orig_hostname, new_hostname);
+
memset (&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME;
@@ -114,7 +117,7 @@ vanilla_hostname (krb5_context context,
* allocated space in `host' and return realms in `realms'.
*/
-krb5_error_code
+krb5_error_code KRB5_LIB_FUNCTION
krb5_expand_hostname_realms (krb5_context context,
const char *orig_hostname,
char **new_hostname,
@@ -124,6 +127,10 @@ krb5_expand_hostname_realms (krb5_context context,
int error;
krb5_error_code ret = 0;
+ if ((context->flags & KRB5_CTX_F_DNS_CANONICALIZE_HOSTNAME) == 0)
+ return vanilla_hostname (context, orig_hostname, new_hostname,
+ realms);
+
memset (&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME;
OpenPOWER on IntegriCloud