talk(1), windows & getlogin()

Michael Cooper mikec at reed.UUCP
Thu May 9 04:19:58 AEST 1985


We have several windowing packages here that use psuedo tty's.  They work
just great except when it comes to talk(1).  Talk complains that it does
not know who you are when you using a window manager on a pty.  It fails
because of these lines from the talk source (file: get_names.c):

	    my_name = getlogin();
	    if (my_name == NULL) {
		printf("You don't exist. Go away.\n");
		exit(-1);
	    }

Without looking at the code for getlogin(), it seems that  getlogin() 
looks up your tty in /etc/utmp.  A simple fix would be to put a call in for
getpwuid(getuid()) if getlogin() == NULL.  A simple task.  I'm supprised
the people at  Bezerkeley (the place where one of the window managers comes
from - the program being a pre-release version of window(1) from 4.3bsd)
would not even think of this.  I can only hope that in 4.3bsd it will be
fixed.



-- 
					Michael Cooper

______________________________________________________________________________
{decvax, ucbvax, purdue, uw-beaver, masscomp, cbosg, aat, sdcrdcf,
 mit-ems, psu-cs, uoregon, orstcs, ihnp4, uf-cgrl, ssc-vax}!tektronix 
								\
						                 +--!reed!mikec 
{teneron, ogcvax, muddcs, cadic, oresoft, grpwre,     		/
 	  harvard, psu-cs, omen, isonvax, nsc-pdc}-------------+



More information about the Comp.unix.wizards mailing list