summaryrefslogtreecommitdiff
path: root/test/pwd_grp/pwcat.c
blob: afad8e18b8ae97648bb63e06cb26ab93b6918b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * 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>
#include <stdlib.h>

int main(int argc, char **argv)
{
    struct passwd *p;

    while ((p = getpwent()) != NULL)
	printf("%s:%s:%ld:%ld:%s:%s:%s\n",
		p->pw_name, p->pw_passwd, (long) p->pw_uid,
		(long) p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell);

    endpwent();
    return 0;
}