[Pkg-shadow-commits] r3339 - in upstream/trunk: . src

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Mon Jun 13 18:25:35 UTC 2011


Author: nekral-guest
Date: 2011-06-13 18:25:34 +0000 (Mon, 13 Jun 2011)
New Revision: 3339

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/su.c
Log:
	* src/su.c: Updating pwent after expire() is not useful. Only the
	password information may have changed and they are not used
	anymore afterwards.

Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2011-06-12 19:57:02 UTC (rev 3338)
+++ upstream/trunk/ChangeLog	2011-06-13 18:25:34 UTC (rev 3339)
@@ -4,6 +4,12 @@
 
 2011-06-05  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/su.c: Updating pwent after expire() is not useful. Only the
+	password information may have changed and they are not used
+	anymore afterwards.
+
+2011-06-05  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* NEWS, src/su.c: Do not forward the controlling terminal to
 	commands executed with -c. This prevents tty hijacking which could
 	lead to execution with the caller's privileges. This required to

Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c	2011-06-12 19:57:02 UTC (rev 3338)
+++ upstream/trunk/src/su.c	2011-06-13 18:25:34 UTC (rev 3339)
@@ -2,7 +2,7 @@
  * Copyright (c) 1989 - 1994, Julianne Frances Haugh
  * Copyright (c) 1996 - 2000, Marek Michałkiewicz
  * Copyright (c) 2000 - 2006, Tomasz Kłoczko
- * Copyright (c) 2007 - 2010, Nicolas François
+ * Copyright (c) 2007 - 2011, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -868,16 +868,7 @@
 			spwd = pwd_to_spwd (&pwent);
 		}
 
-		if (expire (&pwent, spwd) != 0) {
-			/* !USE_PAM, no need for xgetpwnam */
-			struct passwd *pwd = getpwnam (name);
-
-			/* !USE_PAM, no need for xgetspnam */
-			spwd = getspnam (name);
-			if (NULL != pwd) {
-				pwent = *pwd;
-			}
-		}
+		(void) expire (&pwent, spwd);
 	}
 
 	/*




More information about the Pkg-shadow-commits mailing list