#include <pwd.h>

main()
{
	char *s;
	char *crypt(), *getpass();
	struct passwd *pbuf, *getpwuid();

	/*
	 * Get the guy's real (encrypted)
	 * password.
	 */
	pbuf = getpwuid(getuid());

	/*
	 * Prompt for a password, and encrypt
	 * it.  The first two characters of his
	 * real password are the salt.  
	 */
	s = crypt(getpass("Password: "), pbuf\->pw\(ulpasswd);

	if (strcmp(s, pbuf\->pw\(ulpasswd) == 0) 
		printf("Correct!\en");
	else
		printf("That's not your password!\en");
}
