One old, one new (rather long)

Bertl bs at vpnet.at
Fri Jul 16 13:13:40 GMT 1999


"Lonnie J. Borntreger" wrote:

> ==========================NEW==============================
> Now for the New: I can no longer authenticate.  I now see things like:
> [1999/07/15 01:32:19, 10] passdb/passdb.c:pwdb_smb_map_names(288)
>   pwdb_smb_map_names: unix 67goat nt 67goat unix 21749 nt87996
> [1999/07/15 01:32:19, 3] smbd/password.c:pass_check_smb(515)
>   Error : UNIX and SMB uids in password files do not match !
> 
> Seems funny since the uid in smbpasswd is also shown as 21749.  Actually,
> every single nt uid comes back incorrect.  I noticed that some of the
> password and passdb stuff changed in the last snapshot.  (It seems - from
> extra debugging statements - to get set incorrectly between lines 343 and
> 364 of passdb.c - during the first pass - and then fails the second time
> through - due to iterate_getsmbpwnam).
> 
> Anybody got any clues as to what is causing these errors?  They are outside
> of my scope of samba/smb/nt knowledge.

there's a function called copy_passwd_struct wich copies a
passwd struct in a static struct. smbd/password.c uses this
struct, calls a function which calls copy_passwd_struct
again and...

the patch should fix the problem, but all this passwd stuff
should really be cleaned up, imho.
-------------- next part --------------
diff -urN samba.orig/source/smbd/password.c samba/source/smbd/password.c
--- samba.orig/source/smbd/password.c	Fri Jul 16 10:38:40 1999
+++ samba/source/smbd/password.c	Fri Jul 16 15:09:02 1999
@@ -472,6 +472,7 @@
 		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 @@
 	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);


More information about the samba-ntdom mailing list