[krbdev.mit.edu #3438] enhancement: report errno when generic I/O errors happen in kinit
The RT System itself via RT
rt-comment at krbdev.mit.edu
Mon Feb 6 17:10:07 EST 2006
>From krb5-bugs-incoming-bounces at PCH.mit.edu Mon Feb 6 17:10:03 2006
Received: from pch.mit.edu (PCH.MIT.EDU [18.7.21.90]) by krbdev.mit.edu (8.9.3p2) with ESMTP
id RAA12214; Mon, 6 Feb 2006 17:10:03 -0500 (EST)
Received: from pch.mit.edu (pch.mit.edu [127.0.0.1])
by pch.mit.edu (8.12.8p2/8.12.8) with ESMTP id k16M9Wei007990
for <krb5-send-pr at krbdev.mit.edu>; Mon, 6 Feb 2006 17:09:32 -0500
Received: from pacific-carrier-annex.mit.edu (PACIFIC-CARRIER-ANNEX.MIT.EDU
[18.7.21.83])
by pch.mit.edu (8.12.8p2/8.12.8) with ESMTP id k16KABei014640
for <krb5-bugs-incoming at PCH.mit.edu>; Mon, 6 Feb 2006 15:10:11 -0500
Received: from rapier.boston.redhat.com (nat-pool-bos.redhat.com
[66.187.230.200])
by pacific-carrier-annex.mit.edu (8.12.4/8.9.2) with ESMTP id
k16KA3VL027332
for <krb5-bugs at mit.edu>; Mon, 6 Feb 2006 15:10:04 -0500 (EST)
Received: from rapier.boston.redhat.com (localhost.localdomain [127.0.0.1])
by rapier.boston.redhat.com (8.13.5/8.13.5) with ESMTP id
k16KA3eE030106
for <krb5-bugs at mit.edu>; Mon, 6 Feb 2006 15:10:03 -0500
Received: (from nalin at localhost)
by rapier.boston.redhat.com (8.13.5/8.13.5/Submit) id k16KA33h030105;
Mon, 6 Feb 2006 15:10:03 -0500
Date: Mon, 6 Feb 2006 15:10:03 -0500
Message-Id: <200602062010.k16KA33h030105 at rapier.boston.redhat.com>
To: krb5-bugs at mit.edu
Subject: enhancement: more detailed error reporting when kinit runs out of disk
From: nalin at redhat.com
X-send-pr-version: 3.99
X-Spam-Score: -1.638
X-Spam-Flag: NO
X-Scanned-By: MIMEDefang 2.42
X-Mailman-Approved-At: Mon, 06 Feb 2006 17:09:31 -0500
X-BeenThere: krb5-bugs-incoming at mailman.mit.edu
X-Mailman-Version: 2.1.6
Precedence: list
Reply-To: nalin at redhat.com
Sender: krb5-bugs-incoming-bounces at PCH.mit.edu
Errors-To: krb5-bugs-incoming-bounces at PCH.mit.edu
>Submitter-Id: net
>Originator:
>Organization:
>Confidential: no
>Synopsis: enhancement: report errno when generic I/O errors happen in kinit
>Severity: non-critical
>Priority: low
>Category: krb5-clients
>Class: change-request
>Release: 1.4.3
>Environment:
System: Linux rapier.boston.redhat.com 2.6.15-1.1826.2.10_FC5smp #1 SMP Wed Jan 11 18:27:54 EST 2006 i686 i686 i386 GNU/Linux
Architecture: i686
>Description:
When 'kinit' encounters an ENOSPC error, the error message which
the user sees is vague because KRB5_CC_IO encompasses a number
of different errors.
>How-To-Repeat:
Fill a filesystem ("cat /dev/zero > foo.img" as root). Set
KRB5CCNAME to point to a file on that filesystem which does not
yet exist. Attempt to run "kinit" as a non-superuser.
>Fix:
A suggested patch. We don't get a way to pass the OS-level
error up to the caller, so we're not guaranteed that it's still
the right value when we return to the point where we issue the
error message, but luckily we don't do anything to change it, so
in practice it turns out to still contain the right value.
--- krb5-1.4.3/src/clients/kinit/kinit.c 2006-02-06 13:50:06.000000000 -0500
+++ krb5-1.4.3/src/clients/kinit/kinit.c 2006-02-06 13:49:41.000000000 -0500
@@ -34,6 +34,7 @@
#else
#undef HAVE_KRB524
#endif
+#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
@@ -846,8 +847,14 @@
code = krb5_cc_initialize(k5->ctx, k5->cc, k5->me);
if (code) {
- com_err(progname, code, "when initializing cache %s",
- opts->k5_cache_name?opts->k5_cache_name:"");
+ if ((code == KRB5_CC_IO) && (errno != 0)) {
+ com_err(progname, code, "when initializing cache %s: %s",
+ opts->k5_cache_name?opts->k5_cache_name:"",
+ strerror(errno));
+ } else {
+ com_err(progname, code, "when initializing cache %s",
+ opts->k5_cache_name?opts->k5_cache_name:"");
+ }
goto cleanup;
}
More information about the krb5-bugs
mailing list