Bug 16342

Summary: Problems with krb_realmofhost() and/or krb_get_lrealm()
Product: Base System Reporter: Andre Albsmeier <Andre.Albsmeier>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.4-STABLE   
Hardware: Any   
OS: Any   

Description Andre Albsmeier 2000-01-25 06:50:03 UTC
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.

Fix: 

unknown
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
Comment 1 Mike Barcroft freebsd_committer freebsd_triage 2001-07-21 20:07:10 UTC
State Changed
From-To: open->feedback


Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE?
Comment 2 Mike Barcroft freebsd_committer freebsd_triage 2001-07-23 17:53:29 UTC
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 -----
Comment 3 Mike Barcroft freebsd_committer freebsd_triage 2001-07-24 00:58:35 UTC
State Changed
From-To: feedback->closed


Closed at the originator's request.