public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-libs/pam/files: Linux-PAM-1.1.0-uclibc.patch
@ 2009-12-17 18:44 Diego Petteno (flameeyes)
  0 siblings, 0 replies; only message in thread
From: Diego Petteno (flameeyes) @ 2009-12-17 18:44 UTC (permalink / raw
  To: gentoo-commits

flameeyes    09/12/17 18:44:03

  Added:                Linux-PAM-1.1.0-uclibc.patch
  Log:
  Add patch to restore building on uClibc.
  (Portage version: 2.2_rc60/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  sys-libs/pam/files/Linux-PAM-1.1.0-uclibc.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/pam/files/Linux-PAM-1.1.0-uclibc.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/pam/files/Linux-PAM-1.1.0-uclibc.patch?rev=1.1&content-type=text/plain

Index: Linux-PAM-1.1.0-uclibc.patch
===================================================================
Index: Linux-PAM-1.1.0/modules/pam_pwhistory/opasswd.c
===================================================================
--- Linux-PAM-1.1.0.orig/modules/pam_pwhistory/opasswd.c
+++ Linux-PAM-1.1.0/modules/pam_pwhistory/opasswd.c
@@ -94,6 +94,23 @@ parse_entry (char *line, opwd *data)
   return 0;
 }
 
+static int
+compare_password(const char *newpass, const char *oldpass)
+{
+  char *outval;
+#ifdef HAVE_CRYPT_R
+  struct crypt_data output;
+
+  output.initialized = 0;
+
+  outval = crypt_r (newpass, oldpass, &output);
+#else
+  outval = crypt (newpass, oldpass);
+#endif
+
+  return strcmp(outval, oldpass) == 0;
+}
+
 /* Check, if the new password is already in the opasswd file.  */
 int
 check_old_password (pam_handle_t *pamh, const char *user,
@@ -167,12 +184,9 @@ check_old_password (pam_handle_t *pamh, 
   if (found)
     {
       const char delimiters[] = ",";
-      struct crypt_data output;
       char *running;
       char *oldpass;
 
-      memset (&output, 0, sizeof (output));
-
       running = strdupa (entry.old_passwords);
       if (running == NULL)
 	return PAM_BUF_ERR;
@@ -180,7 +194,7 @@ check_old_password (pam_handle_t *pamh, 
       do {
 	oldpass = strsep (&running, delimiters);
 	if (oldpass && strlen (oldpass) > 0 &&
-	    strcmp (crypt_r (newpass, oldpass, &output), oldpass) == 0)
+	    compare_password(newpass, oldpass) )
 	  {
 	    if (debug)
 	      pam_syslog (pamh, LOG_DEBUG, "New password already used");
Index: Linux-PAM-1.1.0/configure.in
===================================================================
--- Linux-PAM-1.1.0.orig/configure.in
+++ Linux-PAM-1.1.0/configure.in
@@ -458,7 +458,7 @@ AC_FUNC_MEMCMP
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(fseeko gethostname gettimeofday lckpwdf mkdir select)
 AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol uname)
-AC_CHECK_FUNCS(getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
+AC_CHECK_FUNCS(getutent_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
 AC_CHECK_FUNCS(getgrouplist getline getdelim)
 AC_CHECK_FUNCS(inet_ntop inet_pton ruserok_af)
 
Index: Linux-PAM-1.1.0/modules/pam_timestamp/pam_timestamp.c
===================================================================
--- Linux-PAM-1.1.0.orig/modules/pam_timestamp/pam_timestamp.c
+++ Linux-PAM-1.1.0/modules/pam_timestamp/pam_timestamp.c
@@ -200,7 +200,13 @@ check_login_time(const char *ruser, time
 	time_t oldest_login = 0;
 
 	setutent();
-	while(!getutent_r(&utbuf, &ut)) {
+	while(
+#ifdef HAVE_GETUTENT_R
+	      !getutent_r(&utbuf, &ut)
+#else
+	      (ut = getutent()) != NULL
+#endif
+	      ) {
 		if (ut->ut_type != USER_PROCESS) {
 			continue;
 		}






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-17 18:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-17 18:44 [gentoo-commits] gentoo-x86 commit in sys-libs/pam/files: Linux-PAM-1.1.0-uclibc.patch Diego Petteno (flameeyes)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox