30 lines
473 B
C
30 lines
473 B
C
|
/*
|
||
|
* pwcat.c
|
||
|
*
|
||
|
* Generate a printable version of the password database
|
||
|
*
|
||
|
* Arnold Robbins
|
||
|
* arnold@gnu.org
|
||
|
* May 1993
|
||
|
* Public Domain
|
||
|
*/
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <pwd.h>
|
||
|
|
||
|
int
|
||
|
main(argc, argv)
|
||
|
int argc;
|
||
|
char **argv;
|
||
|
{
|
||
|
struct passwd *p;
|
||
|
|
||
|
while ((p = getpwent()) != NULL)
|
||
|
printf("%s:%s:%d:%d:%s:%s:%s\n",
|
||
|
p->pw_name, p->pw_passwd, p->pw_uid,
|
||
|
p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell);
|
||
|
|
||
|
endpwent();
|
||
|
exit(0);
|
||
|
}
|