getlogin(3)

Rick Lindsley richl at daemon.UUCP
Thu Jan 17 11:11:52 AEST 1985


Has anyone addressed the problems that getlogin() has when used from a
pty that is NOT a login pty? Script is one prime example, but a growing
number of other utilities also use ptys.

One possibility is to have getlogin trace parent process ids to arrive
at the TRUE login of a person; but this has the unpleasant side effect
of forcing any program which uses getlogin() to be setgid sys (we've
altered the perms on kmem for security reasons).

Another possibility is to have getlogin do a getuid() and getpwnam() if
it can't get a name out of utmp.

A third possibility is to ask the calling program to perform the above
check. (Getlogin will return a null string).

Before we go and choose an option, I would be interested in determining
if others have chosen a solution to this problem. I will be happy to
summarize to the net if necessary.

Rick Lindsley
Small Systems Support
Tektronix
...!{ihnp4,allegra,decvax}!tektronix!daemon!richl



More information about the Comp.unix.wizards mailing list