This "*SHOULD*" work on most versions of Unix.
------
/*
* This program produces a "standard" /etc/passwd file (i.e., with
* the encrypted passwords in it) if run as root.
*
* To compile it on AIX: cc -ls <program name>.
*/
#include <stdio.h>
#include <pwd.h>
#include <sys/types.h>
main(int argc, char **argv)
{
struct passwd pwentry, *pp = (struct passwd *)&pwentry;
while ((pp = getpwent()) != (struct passwd *)NULL) {
if (strlen(pp->pw_passwd) == 13) {
printf("%s:%s:%d:%d:%s:%s:%s\n", pp->pw_name, pp->pw_passwd, pp->pw_uid,
pp->pw_gid, pp->pw_gecos, pp->pw_dir, pp->pw_shell);
}
}
}
~
--
.----------------------------------------------------------------.
| Martin Marietta for U.S. EPA NDPD |
| P.O. Box 14365, MD-4501-1B |
| Research Triangle Park, NC 27709 |
| (919) 541-2901, fax (919) 541-1948 |
| |
| Tiger! Tiger! burning bright, in the forests of the night |
| What immortal hand or eye, could frame thy fearful symmetry. |
'----------------------------------------------------------------'
DISCLAIMER: views and opinions expressed herein are mine. Not
Martin Marietta's -- not the EPA's -- mine!