Comment 1 for bug 296719

Revision history for this message
Russ Allbery (rra-debian) wrote : Re: [Bug 296719] [NEW] upgrade from 8.04 to 8.04 broke in krb5-config

Mattias Amnefelt <email address hidden> writes:

> Public bug reported:
>
> When I upgraded from 8.04 to 8.10, installation of the package
> krb5-config broke. I previously had a /etc/krb5.conf which I may have
> done some changes to but unfortunately it got lost in the debugging
> process.
>
> What I discovered was that my /etc/hostname didn't include the
> domainname part of my hostname. This lead dnsdomainname to fail with the
> error "Unknown host". When I changed this to an fqdn the installation
> succeed.

The following patch should fix this. It will be in the next release.

diff --git a/debian/changelog b/debian/changelog
index bfee20f..e4b31f6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+kerberos-configs (1.22) UNRELEASED; urgency=low
+
+ * Suppress errors from dnsdomainname when attempting to find a default
+ for the local realm. (LP: #296719)
+
+ -- Russ Allbery <email address hidden> Tue, 11 Nov 2008 12:47:01 -0800
+
 kerberos-configs (1.21) unstable; urgency=low

   * Translation updates:
diff --git a/debian/krb4-config.config b/debian/krb4-config.config
index c891da7..3bf1c26 100755
--- a/debian/krb4-config.config
+++ b/debian/krb4-config.config
@@ -10,7 +10,8 @@ if [ "x$RET" = "x" ] ; then
     if db_get krb5-config/default_realm && [ "x$RET" != "x" ] ; then
        db_set krb4-config/default_realm "$RET"
     else
- db_set krb4-config/default_realm `dnsdomainname | tr 'a-z' 'A-Z'`
+ domain=`dnsdomainname 2>/dev/null || true`
+ db_set krb4-config/default_realm `echo "$domain" | tr 'a-z' 'A-Z'`
     fi

 fi
diff --git a/debian/krb5-config.config b/debian/krb5-config.config
index cb717d8..f9a3b3e 100755
--- a/debian/krb5-config.config
+++ b/debian/krb5-config.config
@@ -10,7 +10,7 @@ if [ "x$RET" = "x" ] ; then
     if db_get krb4-config/default_realm && [ "x$RET" != "x" ] ; then
        db_set krb5-config/default_realm "$RET"
     else
- domain=`dnsdomainname`
+ domain=`dnsdomainname 2>/dev/null || true`

        # This is a hack, copied from krb5.conf, since we don't have any files
        # when the config script runs.

--
Russ Allbery (<email address hidden>) <http://www.eyrie.org/~eagle/>