Skip Menu |
 

Subject: Repeated lookups of local computer name on Windows
Download (untitled) / with headers
text/plain 1.1KiB
Every time we want to look up a SRV or URI record, we call
krb5int_dns_init(), which calls res_init() (absent res_ninit()
support or being on a Mac). On Windows this is implemented via the
wshelper library. The wshelper res_init() initializes a global
structure _res, but does not check if _res is already initialized (as
it could via _res.options & RES_INIT).

As part of its work, it tries to determine a local domain name and
search path. Unless the LOCALDOMAIN environment variable is set, it
does this by calling GetComputerName() and looking up the result in
DNS with DnsQuery_A() with the DNS_QUERY_BYPASS_CACHE and
DNS_QUERY_NO_LOCAL_NAME flags. On a VM I set up using Windows 10,
this lookup takes approximately one second to fail (I'm not sure
why), causing kinit to take several seconds in a typical exchange.

We do not currently make use of the local domain or search path in
the resolver configuration, since we always look up absolute domain
names (dnssrv.c:prepare_lookup_buf()). We have some interest in a
local domain name to expand short names when
dns_canonicalize_hostname is set to false, but it would need to be
determined from on-machine configuration, not DNS.
From: ghudson@mit.edu
Subject: git commit

Stop using wshelper for SRV/TXT lookups

Add Windows-specific versions of k5_try_realm_txt_rr(),
k5_make_uri_query(), and krb5int_make_srv_query_realm(), bypassing
wshelper and using DnsQuery_UTF8() directly. Windows does not
currently know how to decode URI records and has no interface to allow
the caller to do so, so disable URI lookups on Windows for now.

Add a comment that dnsglue.h is not used on Windows (since DnsQuery
parses out and decodes SRV and TXT records for us), and remove the
header conditionals from it.

https://github.com/krb5/krb5/commit/67de45e349912caccfba73aff6ebda111281e819
Author: Greg Hudson <ghudson@mit.edu>
Commit: 67de45e349912caccfba73aff6ebda111281e819
Branch: master
src/config/win-pre.in | 21 +--------
src/lib/Makefile.in | 2 +-
src/lib/krb5/os/dnsglue.c | 108 ++++++++++++++++++++++++++++++++++----------
src/lib/krb5/os/dnsglue.h | 7 +--
src/lib/krb5/os/dnssrv.c | 79 +++++++++++++++++++++++++++++++-
5 files changed, 164 insertions(+), 53 deletions(-)
From: ghudson@mit.edu
Subject: git commit
Download (untitled) / with headers
text/plain 2.2KiB

Remove wshelper library

https://github.com/krb5/krb5/commit/76aaa786db1051cd56ef8ac9157f8a30301c3949
Author: Greg Hudson <ghudson@mit.edu>
Commit: 76aaa786db1051cd56ef8ac9157f8a30301c3949
Branch: master
src/Makefile.in | 9 +-
src/config/win-pre.in | 2 -
src/lib/krb5/os/Makefile.in | 2 +-
src/util/Makefile.in | 2 +-
src/util/wshelper/Makefile.in | 64 ---
src/util/wshelper/dllmain.c | 262 ----------
src/util/wshelper/gethna.c | 477 -------------------
src/util/wshelper/hesiod.c | 359 --------------
src/util/wshelper/hesmailh.c | 87 ----
src/util/wshelper/hespwnam.c | 196 --------
src/util/wshelper/hesservb.c | 137 ------
src/util/wshelper/inetaton.c | 153 ------
src/util/wshelper/pwd.h | 15 -
src/util/wshelper/res_comp.c | 361 --------------
src/util/wshelper/res_init.c | 814 --------------------------------
src/util/wshelper/res_quer.c | 561 ----------------------
src/util/wshelper/resource.h | 29 --
src/util/wshelper/resource.rc | 64 ---
src/util/wshelper/string.rc | 29 --
src/util/wshelper/ver.rc.inc | 57 ---
src/util/wshelper/wsh-int.h | 5 -
src/util/wshelper/wshelp32.def | 33 --
src/util/wshelper/wshelp64.def | 33 --
src/util/wshelper/wshelper.def | 42 --
src/windows/include/arpa/nameser.h | 263 ----------
src/windows/include/hesiod.h | 217 ---------
src/windows/include/mitwhich.h | 84 ----
src/windows/include/resolv.h | 284 -----------
src/windows/include/wshelper.h | 148 ------
src/windows/installer/wix/features.wxi | 4 -
src/windows/installer/wix/files.wxi | 21 -
src/windows/installer/wix/platform.wxi | 4 -
src/windows/leash/Leash.cpp | 3 -
src/windows/leash/Makefile.in | 8 +-
src/windows/leashdll/leash-int.h | 4 -
src/windows/leashdll/lshfunc.c | 2 -
src/windows/leashdll/timesync.c | 4 -
src/windows/version.rc | 11 -
38 files changed, 4 insertions(+), 4846 deletions(-)