[14921] in Athena Bugs

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

sun4 8.0J: /usr/athena/bin/finger

daemon@ATHENA.MIT.EDU (nathanw@MIT.EDU)
Wed Jan 22 16:11:57 1997

From: nathanw@MIT.EDU
To: bugs@MIT.EDU
Date: Wed, 22 Jan 1997 16:11:50 EST

System name:		cartoon
Type and version:	SPARC/Classic 8.0J (3 update(s) to same version)
Display type:		cgthree

What were you trying to do?
	Parse the output of /usr/athena/bin/finger

What's wrong:
	Under Solaris, /usr/athena/bin/finger gratuitously misformats 
	its output. There is no space after the username, so a fullname
	gecos field longer than 20 characters (and the limit is 32) will
	make the user name run into the TTY name. Also, while all platforms
	will print a "*" before the TTY if the tty is not writeable, Solaris
	will not print a space if it is writeable, so later fields are 
	misaligned.

Example:

114 sundial:nathanw>/usr/athena/bin/finger
	 
 Local:
 Login       Name              TTY  Idle    When     Office
 root     System PRIVILEGED Acpts/0      Wed 13:37  
 nathanw  Nathan Williams     *pts/1      Wed 14:40  


What should have happened:
	Things should line up nicely, and have more space. 
	Or at least be consistent across platforms. 

	Also, finger.c shouldn't be littered with gratuitous #ifdef's...

Please describe any relevant documentation references:
	finger.c


A fix:


*** finger.c.orig	Wed Jan 22 15:47:20 1997
--- finger.c	Wed Jan 22 15:49:48 1997
***************
*** 766,780 ****
  		else
  			printf("        ???          ");
  	}
- #ifndef SOLARIS
  	(void) putchar(' ');  
- #endif
  	if (pers->loggedin && !pers->writable)
  		(void) putchar('*');
- #ifndef SOLARIS
  	else
  		(void) putchar(' '); 
- #endif
  	if (*pers->tty) {
  		if (!strncmp(pers->tty, "tty", 3)) {
  			if (pers->tty[3] == 'd' && pers->loggedin)
--- 766,776 ----


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