From James.Gosling@CMU-VLSI@CMU-10A Thu Sep 10 07:17:42 1981 Date: 10 Sep 1981 10:08:10-EDT From: James.Gosling at CMU-VLSI at CMU-10A Reply-To: James.Gosling at CMU-10A To: IngVAX.eric@Berkeley Subject: getpwwho.1 Status: R .TH GETPWWHO 3 5/9/80 .CM 2 .SH "NAME" getpwwho \- get password file entry using liberal name matching. .SH "SYNOPSIS" .B #include <pwd.h> .br .B extern struct gecos *_gecos; .sp .B struct passwd *getpwwho(name) .br .B char *name; .sp .B struct passwd *getpwambig(); .SH "DESCRIPTION" .I Getpwwho is much like .IR getpwnam (3), except that it is much more liberal about the names that it will match. .I Name may be a full login name or it may be the unique abbreviation of a persons last name, or it may be a unique abbreviation of a persons first and last name. .sp The subroutine .I getpwambig may be used to iterate through all the matches for the name given to the last call to .IR getpwwho . If .I getpwwho returns -1 then name does not uniquely determine a person, a program can then print out all the names that match by repeatedly calling .I getpwambig until .I getpwambig returns 0. .sp Both .I getpwwho and .I getpwambig return with .I _gecos pointing to a .I gecos structure that results from parsing the GECOS field of the .I passwd entry that is returned. .SH "FILES" /etc/passwd The password file. .SH "SEE ALSO" getpwnam(3), parsgecos(3) .SH "EXAMPLE" .B getpwwho("harry bovik"); .br .B getpwwho("bovik"); .br .B getpwwho("H Bovik"); .br .B getpwwho("hb"); .RS All of these match the person "Harry Q. Bovik", who has "hb" as his login name. .RE .SH "DIAGNOSTICS" .I Getpwwho return 0 if the person isn't found, -1 if the name is ambiguous. In the case that the name is ambiguous a program can iterate through all the possibilities by using .IR getpwambig . .SH "HISTORY" .TP 09-May-80 James Gosling (jag) at Carnegie-Mellon University Created.