[2977] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

krb5-appl/639: kcmd error reporting

daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Mon Sep 28 11:09:52 1998

Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: krb5-unassigned@RT-11.MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU, ghudson@MIT.EDU
Date: Mon, 28 Sep 1998 11:03:15 -0400
From: ghudson@MIT.EDU
Reply-To: ghudson@MIT.EDU
To: krb5-bugs@MIT.EDU


>Number:         639
>Category:       krb5-appl
>Synopsis:       kcmd reports a couple of errors to stdout
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    krb5-unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Mon Sep 28 11:04:00 EDT 1998
>Last-Modified:
>Originator:     Greg Hudson
>Organization:
MIT
>Release:        1.0pl1
>Environment:
	
System: SunOS small-gods.mit.edu 5.6 Generic_105181-05 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4

>Description:
If krb5_sendauth() fails in src/appl/bsd/kcmd.c, the resulting error
message is displayed to stdout.  It should go to stderr.

I report this as a fairly serious problem because it can easily confuse
scripts using rsh.
>How-To-Repeat:
rsh to a krb4 machine, or something, and notice that the krb5_sendauth()
error goes to stdout.
>Fix:

Index: kcmd.c
===================================================================
RCS file: /afs/dev.mit.edu/source/repository/third/krb5/src/appl/bsd/kcmd.c,v
retrieving revision 1.3
diff -c -r1.3 kcmd.c
*** kcmd.c	1998/08/14 19:44:58	1.3
--- kcmd.c	1998/09/28 14:49:39
***************
*** 343,352 ****
  			   authopts, &cksumdat, ret_cred, 0,	&error, &rep_ret, NULL);
  	krb5_xfree(cksumdat.data);
      if (status) {
! 	printf("Couldn't authenticate to server: %s\n", error_message(status));
  	if (error) {
! 	    printf("Server returned error code %d (%s)\n", error->error,
! 		   error_message(ERROR_TABLE_BASE_krb5 + error->error));
  	    if (error->text.length) {
  		fprintf(stderr, "Error text sent from server: %s\n",
  			error->text.data);
--- 343,354 ----
  			   authopts, &cksumdat, ret_cred, 0,	&error, &rep_ret, NULL);
  	krb5_xfree(cksumdat.data);
      if (status) {
! 	fprintf(stderr, "Couldn't authenticate to server: %s\n",
! 		error_message(status));
  	if (error) {
! 	    fprintf(stderr, "Server returned error code %d (%s)\n",
! 		    error->error,
! 		    error_message(ERROR_TABLE_BASE_krb5 + error->error));
  	    if (error->text.length) {
  		fprintf(stderr, "Error text sent from server: %s\n",
  			error->text.data);
>Audit-Trail:
>Unformatted:

home help back first fref pref prev next nref lref last post