Main Page | Class List | Directories | File List | Class Members | File Members

pwcat.c

Go to the documentation of this file.
00001 /*
00002  * pwcat.c
00003  *
00004  * Generate a printable version of the password database
00005  */
00006 /*
00007  * Arnold Robbins, arnold@gnu.org, May 1993
00008  * Public Domain
00009  */
00010 
00011 #if HAVE_CONFIG_H
00012 #include <config.h>
00013 #endif
00014 
00015 #include <stdio.h>
00016 #include <pwd.h>
00017 
00018 #if defined (STDC_HEADERS)
00019 #include <stdlib.h>
00020 #endif
00021 
00022 int
00023 main(argc, argv)
00024 int argc;
00025 char **argv;
00026 {
00027     struct passwd *p;
00028 
00029     while ((p = getpwent()) != NULL)
00030         printf("%s:%s:%ld:%ld:%s:%s:%s\n",
00031             p->pw_name, p->pw_passwd, (long) p->pw_uid,
00032             (long) p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell);
00033 
00034     endpwent();
00035     return 0;
00036 }

© sourcejam.com 2005-2008