]> granicus.if.org Git - shadow/commitdiff
* src/su.c: Updating pwent after expire() is not useful. Only the
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 13 Jun 2011 18:25:34 +0000 (18:25 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 13 Jun 2011 18:25:34 +0000 (18:25 +0000)
password information may have changed and they are not used
anymore afterwards.

ChangeLog
src/su.c

index 575367847bf30f39389d35b5340e5732e9f8d292..4648a19eed88e1507aa07d6161112b49445a79d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
 
        * man/po/fr.po: French manpages translation
 
+2011-06-05  Nicolas François  <nicolas.francois@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@centraliens.net>
 
        * NEWS, src/su.c: Do not forward the controlling terminal to
index f93db7dc34bcac46301b9afb6e23aa3dcad6ec25..cdc26f9dbdc622c4d06b36db36e2655ee3df2904 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -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 @@ int main (int argc, char **argv)
                        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);
        }
 
        /*