From 7a58c800ed8e86a26b2db44a417ebaadb0dd48b7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 6 Jul 2001 04:08:24 +0000 Subject: fixed bug where we looked at the first byte of a password to determine if the password is blank. That ain't valid with encrypted passwords! Jeremy, this changes the semantics of session setup. We no longer automatically set guest=True when the client happens to choose their username == the guest username. Instead we rely on the map_to_guest code. I'm pretty sure this is now the right thing, but please look at it carefully before putting it in 2.2 This is the bug that was causing the build farm to sometimes fail. Basically we failed every 256 attempts - ie. when the first byte of the encrypted password happened to be 0 (This used to be commit 4b35a3494c53fe38532fc12cf1c57e1a3715ad0f) --- source3/smbd/reply.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 21a4eca714..da0417203d 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -873,10 +873,8 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int /* If no username is sent use the guest account */ if (!*user) { - pstrcpy(user,lp_guestaccount(-1)); - /* If no user and no password then set guest flag. */ - if( *smb_apasswd == 0) - guest = True; + pstrcpy(user,lp_guestaccount(-1)); + guest = True; } pstrcpy(current_user_info.smb_name,user); @@ -924,13 +922,6 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int add_session_user(user); - /* - * Check if the given username was the guest user with no password. - */ - - if(!guest && strequal(user,lp_guestaccount(-1)) && (*smb_apasswd == 0)) - guest = True; - /* * Check with orig_user for security=server and * security=domain. @@ -942,7 +933,6 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int smb_apasslen, smb_ntpasswd, smb_ntpasslen) && !check_hosts_equiv(user)) { - /* * If we get here then the user wasn't guest and the remote * authentication methods failed. Check the authentication -- cgit