Subject: bin/660: skey should send messages to stderr
To: None <gnats-admin@NetBSD.ORG>
From: Simon J. Gerraty <sjg@zen.void.oz.au>
List: netbsd-bugs
Date: 12/28/1994 04:05:07
>Number:         660
>Category:       bin
>Synopsis:       skey should send prompts and messages to stderr.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 28 04:05:01 1994
>Originator:     Simon J. Gerraty
>Organization:
Zen Programming...
>Release:        1.0
>Environment:
	
System: NetBSD zen.void.oz.au 1.0 NetBSD 1.0 (ZEN) #6: Tue Dec 13 09:55:20 EST 1994 root@zen.void.oz.au:/usr/src/sys/arch/i386/compile/ZEN i386


>Description:

	skey(1) sends all its output including password prompt and most error
	messages, to stdout.  This makes running it with output re-directed
	tedious.  Worse, if output is being piped into lpr and an error
	occurs, you waste a page...
	
>How-To-Repeat:
	# assuming you have initialized it...

	skey -n 10 99 zen.1234 > /tmp/file

	results in no prompt for password (its in the output file).
>Fix:
*** skey.c~	Tue May 24 16:48:02 1994
--- skey.c	Fri Dec 23 22:12:20 1994
***************
*** 72,85 ****
  		seed = slash;
  
  		if ((n = atoi(argv[optind])) < 0) {
! 			printf("%s not positive\n", argv[optind]);
  			usage(argv[0]);
  			exit(1);
  		}
  	} else {
  
  		if ((n = atoi(argv[optind])) < 0) {
! 			printf("%s not positive\n", argv[optind]);
  			usage(argv[0]);
  			exit(1);
  		}
--- 72,85 ----
  		seed = slash;
  
  		if ((n = atoi(argv[optind])) < 0) {
! 			fprintf(stderr, "%s not positive\n", argv[optind]);
  			usage(argv[0]);
  			exit(1);
  		}
  	} else {
  
  		if ((n = atoi(argv[optind])) < 0) {
! 			fprintf(stderr, "%s not positive\n", argv[optind]);
  			usage(argv[0]);
  			exit(1);
  		}
***************
*** 88,94 ****
  
  	/* Get user's secret password */
  	if (!pass) {
! 		printf("Enter secret password: ");
  		readpass(passwd, sizeof(passwd));
  	}
  	rip(passwd);
--- 88,94 ----
  
  	/* Get user's secret password */
  	if (!pass) {
! 		fprintf(stderr, "Enter secret password: ");
  		readpass(passwd, sizeof(passwd));
  	}
  	rip(passwd);
***************
*** 124,128 ****
  usage(s)
  	char   *s;
  {
! 	printf("Usage: %s [-n count] [-p password ] sequence# [/] key\n", s);
  }
--- 124,128 ----
  usage(s)
  	char   *s;
  {
! 	fprintf(stderr, "Usage: %s [-n count] [-p password ] sequence# [/] key\n", s);
  }

>Audit-Trail:
>Unformatted: