home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
misc
/
volume14
/
libpw
/
part01
/
isuidused.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
|
332 b
|
27 lines
/*
* isuidused(x) - if uid x is used, return 1 else 0
*/
#include <stdio.h>
#include <pwd.h>
struct passwd *tmp;
isuidused(x)
int x;
{
lockpwfile();
setpwent();
while ((tmp = getpwent()) != NULL) {
if (tmp->pw_uid == x) {
unlockpwfile();
endpwent();
return(1);
}
}
unlockpwfile();
endpwent();
return(0);
}