From andre.albsmeier@mchp.siemens.de  Mon Jan 24 22:50:00 2000
Return-Path: <andre.albsmeier@mchp.siemens.de>
Received: from goliath.siemens.de (goliath.siemens.de [194.138.37.131])
	by hub.freebsd.org (Postfix) with ESMTP id B457014BE4
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Jan 2000 22:49:59 -0800 (PST)
	(envelope-from andre.albsmeier@mchp.siemens.de)
Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14])
	by goliath.siemens.de (8.9.3/8.9.3) with ESMTP id HAA13061
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Jan 2000 07:49:58 +0100 (MET)
Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7])
	by mail1.siemens.de (8.9.3/8.9.3) with ESMTP id HAA11595
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Jan 2000 07:49:57 +0100 (MET)
Received: (from daemon@localhost)
	by curry.mchp.siemens.de (8.9.3/8.9.3) id HAA49965
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Jan 2000 07:49:57 +0100 (CET)
Message-Id: <200001250649.HAA08637@internal>
Date: Tue, 25 Jan 2000 07:49:55 +0100 (CET)
From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Problems with krb_realmofhost() and/or krb_get_lrealm()
X-Send-Pr-Version: 3.2

>Number:         16342
>Category:       bin
>Synopsis:       Problems with krb_realmofhost() and/or krb_get_lrealm()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 24 22:50:03 PST 2000
>Closed-Date:    Mon Jul 23 16:58:35 PDT 2001
>Last-Modified:  Mon Jul 23 16:59:12 PDT 2001
>Originator:     Andre Albsmeier
>Release:        FreeBSD 3.4-STABLE i386
>Organization:
>Environment:

FreeBSD-3.4-STABLE

/etc/make.conf.local contains MAKE_KERBEROS4=1
/etc/hosts as follows, please note that there is no fully qualified hostname

127.0.0.1               localhost localhost.my.domain myname.my.domain
192.168.254.254         schlappy sc

>Description:

I was using xlockmore on my laptop. The hostname was set to "schlappy".
I am not using fully qualified hostnames since I have no own domain.

When the screen was locked by xlock and I entered my password, I noticed
that it took a few seconds until the screen was unlocked again. xlock then
has crashed with a coredump. I suspected a problem in xlock and looked with
gdb at the corefile, here is part of the output:

#0  0x282235df in send () from /usr/lib/libc.so.3
#1  0x2821fa40 in res_send () from /usr/lib/libc.so.3
#2  0x2821c245 in res_query () from /usr/lib/libc.so.3
#3  0x2821c7b7 in res_querydomain () from /usr/lib/libc.so.3
#4  0x2821c4a6 in res_search () from /usr/lib/libc.so.3
#5  0x280c14bb in dns_lookup () from /usr/lib/libkrb.so.3
#6  0x280bea4b in k_gethostname () from /usr/lib/libkrb.so.3
#7  0x280bebc5 in krb_realmofhost () from /usr/lib/libkrb.so.3
#8  0x280be8e0 in krb_get_lrealm () from /usr/lib/libkrb.so.3
#9  0x280bec3e in krb_realmofhost () from /usr/lib/libkrb.so.3
#10 0x280be8e0 in krb_get_lrealm () from /usr/lib/libkrb.so.3
#11 0x280bec3e in krb_realmofhost () from /usr/lib/libkrb.so.3
#12 0x280be8e0 in krb_get_lrealm () from /usr/lib/libkrb.so.3
#13 0x280bec3e in krb_realmofhost () from /usr/lib/libkrb.so.3
#14 0x280be8e0 in krb_get_lrealm () from /usr/lib/libkrb.so.3
...
... continuing
...
#58043 0x280bec3e in krb_realmofhost () from /usr/lib/libkrb.so.3
#58044 0x280be8e0 in krb_get_lrealm () from /usr/lib/libkrb.so.3
#58045 0x280bec3e in krb_realmofhost () from /usr/lib/libkrb.so.3
#58046 0x280be8e0 in krb_get_lrealm () from /usr/lib/libkrb.so.3
#58047 0x280bec3e in krb_realmofhost () from /usr/lib/libkrb.so.3
#58048 0x280be8e0 in krb_get_lrealm () from /usr/lib/libkrb.so.3
#58049 0x280bec3e in krb_realmofhost () from /usr/lib/libkrb.so.3
#58050 0x280be8e0 in krb_get_lrealm () from /usr/lib/libkrb.so.3
#58051 0x804ff0d in krb_check_password (pwd=0x282469fc, pass=0xbfbfcd90 "PW_replaced")
    at ./passwd.c:1519
#58052 0x804fe38 in checkPasswd (buffer=0xbfbfd1f0 "PW_replaced") at ./passwd.c:1173
#58053 0x804d604 in getPassword () at ./xlock.c:2318
#58054 0x804e04a in lockDisplay (display=0x8075000, do_display=1)
    at ./xlock.c:2635
#58055 0x804fb8d in main (argc=1, argv=0xbfbfd520) at ./xlock.c:3501
#58056 0x804b34d in _start ()

It seemed that there is a problem with krb_realmofhost() and
krb_get_lrealm() which automagically are enabled when compiling
xlockmore with MAKE_KERBEROS4=1 defined in /etc/make.conf.local.

>How-To-Repeat:

I could isolate the problem with the following small test program
which has to be compiled with: cc k4test.c -lkrb -ldes

-------------------------- snip ----------------------------------

#include <stdio.h>
#include <krb.h>
#include <des.h>
#include <netinet/in.h>

main() {
 fprintf( stderr, "%s\n", krb_realmofhost( "schlappy" ));
}

-------------------------- snap ----------------------------------

The program spins around as xlock does. This stops immediately
when the hostname "schlappy" is additionally included with any
domain appended in /etc/hosts, e.g.

192.168.254.254         schlappy.domain.org schlappy sc

>Fix:

unknown

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: mike 
State-Changed-When: Sat Jul 21 12:07:10 PDT 2001 
State-Changed-Why:  

Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=16342 

From: Mike Barcroft <mike@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/16342: Problems with krb_realmofhost() and/or krb_get_lrealm()
Date: Mon, 23 Jul 2001 12:53:29 -0400

 Adding to Audit-Trail.
 
 ----- Forwarded message from Andre Albsmeier <andre.albsmeier@mchp.siemens.de> -----
 
 Delivered-To: mike@freebsd.org
 X-Envelope-Sender-Is: andre.albsmeier@mchp.siemens.de (at relayer david.siemens.de)
 Date: Mon, 23 Jul 2001 13:35:49 +0200
 From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
 To: mike@FreeBSD.org
 Subject: Re: bin/16342: Problems with krb_realmofhost() and/or krb_get_lrealm()
 User-Agent: Mutt/1.2.5i
 In-Reply-To: <200107211907.f6LJ7qt43478@freefall.freebsd.org>; from mike@FreeBSD.org on Sat, Jul 21, 2001 at 12:07:52PM -0700
 X-Echelon: BND CIA NSA Mossad KGB MI6 IRA detonator nuclear assault strike
 
 On Sat, 21-Jul-2001 at 12:07:52 -0700, mike@FreeBSD.org wrote:
 > Synopsis: Problems with krb_realmofhost() and/or krb_get_lrealm()
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: mike
 > State-Changed-When: Sat Jul 21 12:07:10 PDT 2001
 > State-Changed-Why: 
 > 
 > Does this problem still occur in newer versions of FreeBSD,
 > such as 4.3-RELEASE?
 
 I don't know. I haven't used MAKE_KERBEROS4=yes for a long
 time now. I suggest closing the PR.
 
 Thanks,
 
 	-Andre
 
 ----- End forwarded message -----
State-Changed-From-To: feedback->closed 
State-Changed-By: mike 
State-Changed-When: Mon Jul 23 16:58:35 PDT 2001 
State-Changed-Why:  

Closed at the originator's request. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=16342 
>Unformatted:
