diff options
| author | Jeffrey Altman <jaltman@secure-endpoints.com> | 1999-06-30 15:12:42 +0000 |
|---|---|---|
| committer | Jeffrey Altman <jaltman@secure-endpoints.com> | 1999-06-30 15:12:42 +0000 |
| commit | 8a60b820c9e8a01924029050f4ae9b1408ceaaa2 (patch) | |
| tree | c3c7776f561feef98543a4b63876ed1c3dab8eb5 /src/lib | |
| parent | 040a0fa7a6a565b2413afc1decbb4bc545b5d9be (diff) | |
| download | krb5-8a60b820c9e8a01924029050f4ae9b1408ceaaa2.tar.gz krb5-8a60b820c9e8a01924029050f4ae9b1408ceaaa2.tar.xz krb5-8a60b820c9e8a01924029050f4ae9b1408ceaaa2.zip | |
krb5_try_realm_txt_rr() should allow the resolv library to expand
the local domain or domain searchlist when the query is being
performed without the specification of a hostname or domain.
When 'name' is NULL or "", no '.' should be appended to the query.
Appending a '.' in that circumstance will result in an inability
to resolv the REALM if gethostname() does not return a fully
qualified domain name as on Windows and Solaris.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11536 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/krb5/os/hst_realm.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/lib/krb5/os/hst_realm.c b/src/lib/krb5/os/hst_realm.c index 13b3a7a3e..a2c76ade2 100644 --- a/src/lib/krb5/os/hst_realm.c +++ b/src/lib/krb5/os/hst_realm.c @@ -119,15 +119,21 @@ krb5_try_realm_txt_rr(prefix, name, realm) if ( strlen(prefix) + strlen(name) + 3 > MAX_DNS_NAMELEN ) return KRB5_ERR_HOST_REALM_UNKNOWN; sprintf(host,"%s.%s", prefix, name); - } - /* Realm names don't (normally) end with ".", but if the query - doesn't end with "." and doesn't get an answer as is, the - resolv code will try appending the local domain. Since the - realm names are absolutes, let's stop that. */ - h = host + strlen (host); - if (h > host && h[-1] != '.') - strcpy (h, "."); + /* Realm names don't (normally) end with ".", but if the query + doesn't end with "." and doesn't get an answer as is, the + resolv code will try appending the local domain. Since the + realm names are absolutes, let's stop that. + + But only if a name has been specified. If we are performing + a search on the prefix alone then the intention is to allow + the local domain or domain search lists to be expanded. + */ + + h = host + strlen (host); + if (h > host && h[-1] != '.') + strcpy (h, "."); + } size = res_search(host, C_IN, T_TXT, answer.bytes, sizeof(answer.bytes)); if (size < 0) |
