summaryrefslogtreecommitdiff
path: root/test/pwd_grp/pwcat.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-11-01 04:49:27 +0000
committerEric Andersen <andersen@codepoet.org>2003-11-01 04:49:27 +0000
commitd8fe0f7534a6b52549992238c061e4e7a5b319ab (patch)
tree94d9406e4d7d9db435322a46aa3976553b9474c9 /test/pwd_grp/pwcat.c
parentfabd08e8543c01b41f277eb2eb9f731c7b424c36 (diff)
Add some additional pwd/grp tests, to prevent me from
breaking obvious things in the future. -Erik
Diffstat (limited to 'test/pwd_grp/pwcat.c')
-rw-r--r--test/pwd_grp/pwcat.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/pwd_grp/pwcat.c b/test/pwd_grp/pwcat.c
new file mode 100644
index 000000000..d6ad0b64b
--- /dev/null
+++ b/test/pwd_grp/pwcat.c
@@ -0,0 +1,36 @@
+/*
+ * pwcat.c
+ *
+ * Generate a printable version of the password database
+ */
+/*
+ * Arnold Robbins, arnold@gnu.org, May 1993
+ * Public Domain
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <pwd.h>
+
+#if defined (STDC_HEADERS)
+#include <stdlib.h>
+#endif
+
+int
+main(argc, argv)
+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;
+}