home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
misc
/
volume14
/
libpw
/
part01
/
sortuser.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1990-07-15
|
377 b
|
27 lines
/*
* sortuser(uname) - look for uname in /etc/passwd. TRUE=1, FALSE=0
*/
#include <stdio.h>
#include <pwd.h>
struct passwd *tmp;
sortuser(uname)
char uname[10];
{
lockpwfile();
setpwent();
while ((tmp = getpwent()) != NULL) {
if (strcmp(tmp->pw_name, uname) == 0) {
endpwent();
unlockpwfile();
return(1);
}
}
unlockpwfile();
endpwent();
return(0);
}