getpwuid() looks like it will do the trick (or getpwent() which seems
similar). The man file for getlogin() says to avoid using it for security
related purposes since it is rather easy to fool (of course the man file
is dated Sept. 3, 1995 so that might have changed...).  Thanks everyone
for your help.

Ivan Wagner

On Wed, 15 Dec 1999, Fabien Deschodt wrote:
> > > use getuid and then look that up in the /etc/passwd file. Not hard if
> you
> > > know what you're doing.
> >
> > Unless the system is using shadowed passwords.
> Why? Doesn`t it just put an x in the password field? What`s the problem?
> 
> > Is there no system call for this?
> You should have a look at the man pages of getlogin and getpwuid to make
> your choice. They may be equivalent for your need, but the second may be
> more powerful.... and you can use with getuid or geteuid.
> 
> Fabien Deschodt
> 

Reply via email to