]> granicus.if.org Git - sudo/commitdiff
Missed piece from rev. 1.6, fix sudo_getpwnam() too.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 12 Mar 2005 17:27:27 +0000 (17:27 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 12 Mar 2005 17:27:27 +0000 (17:27 +0000)
pwutil.c

index 7df9fbe8d28b6f5e66bae034d7a507c26c8c5b35..e6d53a8a40272f3f3d34bb8766da071fbbf23504 100644 (file)
--- a/pwutil.c
+++ b/pwutil.c
@@ -264,8 +264,8 @@ sudo_getpwnam(name)
      * Cache passwd db entry if it exists or a negative response if not.
      */
     if ((pw = getpwnam(name)) != NULL) {
-       pw->pw_passwd = sudo_getepw(pw);        /* get shadow password */
        pw = sudo_pwdup(pw);
+       pw->pw_passwd = sudo_getepw(pw);        /* get shadow password */
        if (rbinsert(pwcache_byname, (VOID *) pw) != NULL)
            errorx(1, "unable to cache user name, already exists");
        if (rbinsert(pwcache_byuid, (VOID *) pw) != NULL)