/*
 * pwchk.c -- a hacked look-alike of HP's pwchk
 * @(#)pwchk.c v1.0 14 APR 1997 Rob Thomas robt@cymru.com
 * IMHO, this utility should be offered by every *nix vendor.
 */

#include <stdio.h>
#include <pwd.h>
#include <string.h>
#include <stddef.h>

#ifndef lint
static char sccsid[] = "@(#)pwchk.c v1.0 14 APR 1997 Rob Thomas robt@cymru.com";
#endif

int
main(argc, argv)
	int argc;
	char *argv[];
{
	struct passwd *pass;

	if (argv[1] == NULL) {
		fprintf(stderr, "%s: Need a logname, chum.\n", argv[0]);
		exit(1);
	}

	if ((pass = getpwnam(argv[1])) == NULL) {
		fprintf(stderr, "%s: No such user: %s.\n", argv[0], argv[1]);
		exit(5);
	}

	fprintf(stdout, "%s:%s:%d:%d:%s:%s:%s\n", pass->pw_name, 
		pass->pw_passwd, pass->pw_uid, pass->pw_gid, pass->pw_gecos, 
		pass->pw_dir, pass->pw_shell);

	exit(0);
}

