bd5492a
diff -up Linux-PAM-0.99.8.1/modules/pam_unix/passverify.h.unix-hpux-aging Linux-PAM-0.99.8.1/modules/pam_unix/passverify.h
bd5492a
--- Linux-PAM-0.99.8.1/modules/pam_unix/passverify.h.unix-hpux-aging	2008-01-08 14:43:36.000000000 +0100
bd5492a
+++ Linux-PAM-0.99.8.1/modules/pam_unix/passverify.h	2008-01-08 15:49:43.000000000 +0100
bd5492a
@@ -13,7 +13,7 @@
bd5492a
 #define OLD_PASSWORDS_FILE      "/etc/security/opasswd"
bd5492a
 
bd5492a
 int
bd5492a
-verify_pwd_hash(const char *p, const char *hash, unsigned int nullok);
bd5492a
+verify_pwd_hash(const char *p, char *hash, unsigned int nullok);
bd5492a
 
bd5492a
 int
bd5492a
 is_pwd_shadowed(const struct passwd *pwd);
bd5492a
diff -up Linux-PAM-0.99.8.1/modules/pam_unix/passverify.c.unix-hpux-aging Linux-PAM-0.99.8.1/modules/pam_unix/passverify.c
bd5492a
--- Linux-PAM-0.99.8.1/modules/pam_unix/passverify.c.unix-hpux-aging	2008-01-08 14:43:36.000000000 +0100
bd5492a
+++ Linux-PAM-0.99.8.1/modules/pam_unix/passverify.c	2008-01-08 15:49:02.000000000 +0100
bd5492a
@@ -44,14 +44,32 @@
bd5492a
 # include "./lckpwdf.-c"
bd5492a
 #endif
bd5492a
 
bd5492a
+static void
bd5492a
+strip_hpux_aging(char *p)
bd5492a
+{
bd5492a
+	const char *valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
bd5492a
+			    "abcdefghijklmnopqrstuvwxyz"
bd5492a
+			    "0123456789./";
bd5492a
+	if ((*p != '$') && (strlen(p) > 13)) {
bd5492a
+		for (p += 13; *p != '\0'; p++) {
bd5492a
+			if (strchr(valid, *p) == NULL) {
bd5492a
+				*p = '\0';
bd5492a
+				break;
bd5492a
+			}
bd5492a
+		}
bd5492a
+	}
bd5492a
+}
bd5492a
+
bd5492a
 int
bd5492a
-verify_pwd_hash(const char *p, const char *hash, unsigned int nullok)
bd5492a
+verify_pwd_hash(const char *p, char *hash, unsigned int nullok)
bd5492a
 {
bd5492a
-	size_t hash_len = strlen(hash);
bd5492a
+	size_t hash_len;
bd5492a
 	char *pp = NULL;
bd5492a
 	int retval;
bd5492a
 	D(("called"));
bd5492a
 
bd5492a
+	strip_hpux_aging(hash);
bd5492a
+	hash_len = strlen(hash);
bd5492a
 	if (!hash_len) {
bd5492a
 		/* the stored password is NULL */
bd5492a
 		if (nullok) { /* this means we've succeeded */