copy of password struct needed to be made prior to calling copy_passwd_struct
authorLuke Leighton <lkcl@samba.org>
Fri, 16 Jul 1999 22:03:15 +0000 (22:03 +0000)
committerLuke Leighton <lkcl@samba.org>
Fri, 16 Jul 1999 22:03:15 +0000 (22:03 +0000)
found by Bertl <bs@vpnet.at>.

source/smbd/password.c

index 1f1ca12713a7b30e3f068e883dab636392887256..022d432787f84b13c00d2b24bd8b9c8b6223d73f 100644 (file)
@@ -472,6 +472,7 @@ BOOL pass_check_smb(char *user, char *domain, uchar *chal,
                struct passwd *pwd, uchar user_sess_key[16])
 {
        const struct passwd *pass;
+       struct passwd pw;
        struct smb_passwd *smb_pass;
 
        if (!lm_pwd || !nt_pwd)
@@ -487,12 +488,13 @@ BOOL pass_check_smb(char *user, char *domain, uchar *chal,
        else
        {
                pass = Get_Pwnam(user,True);
-       }
-
-       if (pass == NULL)
-       {
-               DEBUG(3,("Couldn't find user %s\n",user));
-               return False;
+               if (pass == NULL)
+               {
+                       DEBUG(3,("Couldn't find user %s\n",user));
+                       return False;
+               }
+               memcpy(&pw, pass, sizeof(struct passwd));
+               pass = &pw;
        }
 
        smb_pass = getsmbpwnam(user);