Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: binary MIME-Version: 1.0 X-Mailer: MIME-tools 5.411 (Entity 5.404) X-RT-Original-Encoding: iso-8859-1 Content-Length: 3961 From schemers@slapshot.stanford.edu Sun Dec 22 18:51:43 1996 Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.69.0.28]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id SAA24561 for ; Sun, 22 Dec 1996 18:51:43 -0500 Received: from slapshot.Stanford.EDU by MIT.EDU with SMTP id AA19493; Sun, 22 Dec 96 18:51:37 EST Received: (from schemers@localhost) by slapshot.stanford.edu (8.8.4/8.7.3) id PAA20539; Sun, 22 Dec 1996 15:50:41 -0800 (PST) Message-Id: Date: 22 Dec 1996 15:50:38 -0800 From: Roland Schemers Sender: schemers@slapshot.stanford.edu Cc: krb5-bugs@MIT.EDU In-Reply-To: blizzard@odin.nyser.net's message of 22 Dec 1996 21:35:55 GMT Subject: krb__get_srvtabname() segfaults if krb5.conf missing References: <59k9jr$4ka@news.appliedtheory.com> >Number: 317 >Category: krb5-libs >Synopsis: krb__get_srvtabname() segfaults if krb5.conf missing >Confidential: yes >Severity: serious >Priority: medium >Responsible: tlyu >State: closed >Class: sw-bug >Submitter-Id: unknown >Arrival-Date: Sun Dec 22 18:52:00 EST 1996 >Last-Modified: Thu Aug 07 16:32:49 EDT 1997 >Originator: >Organization: >Release: krb5-1.0 >Environment: >Description: The following message is a courtesy copy of an article that has been posted as well. blizzard@odin.nyser.net (Christopher Blizzard) writes: > > There seems to be a problem with running the v5 telnetd server without a > krb5.conf file in place when using a v4 telnet client. The telnetd server > will seg fault silently on startup. To work around this, touch > /etc/krb5.conf > The bug is in src/lib/krb4/g_cnffile.c:krb__get_srvtabname, line 61: char * krb__get_srvtabname(default_srvtabname) char *default_srvtabname; { krb5_context context; const char* names[3]; char **full_name = 0, **cpp; krb5_error_code retval; char *retname; krb5_init_context(&context); names[0] = "libdefaults"; names[1] = "krb4_srvtab"; names[2] = 0; 61: retval = profile_get_values(context->profile, names, &full_name); if (retval == 0 && full_name && full_name[0]) { retname = strdup(full_name[0]); for (cpp = full_name; *cpp; cpp++) krb5_xfree(*cpp); krb5_xfree(full_name); } else { retname = strdup(default_srvtabname); } krb5_free_context(context); return retname; } krb5_int_context is failing and setting context to NULL. Thus the call to profile_get_values fails. Just need to rearrange things slightly, i.e: krb5_init_context(&context); names[0] = "libdefaults"; names[1] = "krb4_srvtab"; names[2] = 0; if (context && (retval = profile_get_values(context->profile, names, &full_name)) && retval == 0 && full_name && full_name[0]) { retname = strdup(full_name[0]); for (cpp = full_name; *cpp; cpp++) krb5_xfree(*cpp); krb5_xfree(full_name); } else { retname = strdup(default_srvtabname); } if (context) krb5_free_context(context); return retname; roland >How-To-Repeat: >Fix: >Audit-Trail: Responsible-Changed-From-To: gnats-admin->tlyu Responsible-Changed-By: tlyu Responsible-Changed-When: Thu Mar 20 12:38:07 1997 Responsible-Changed-Why: Refiled State-Changed-From-To: open-analyzed State-Changed-By: tlyu State-Changed-When: Thu Mar 20 12:41:02 1997 State-Changed-Why: This shouldn't be too hard to deal with. From: Tom Yu To: schemers@stanford.edu Cc: krb5-bugs@MIT.EDU Subject: Re: krb5-libs/317: krb__get_srvtabname() segfaults if krb5.conf missing Date: Thu, 20 Mar 1997 12:43:01 -0500 We apologize for not getting back to you sooner, but we have in fact received your bug report. We have not had a chance yet to look at it in detail, but the changes you suggest seem resonable. ---Tom State-Changed-From-To: analyzed-closed State-Changed-By: tlyu State-Changed-When: Thu Aug 7 16:32:24 1997 State-Changed-Why: Fixed lib/krb4/g_cnffile.c 1.4 >Unformatted: