diff options
author | Jeremy Allison <jra@samba.org> | 1998-04-10 01:19:18 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-04-10 01:19:18 +0000 |
commit | 5d6f63a7e665ee19bd4508b2b40d497e9851b248 (patch) | |
tree | 52cd4e83e3872956d692dc23fbdac7955b93398f | |
parent | fc2295e0f5729585fdb3ee47edb290851d4071c5 (diff) | |
download | samba-5d6f63a7e665ee19bd4508b2b40d497e9851b248.tar.gz samba-5d6f63a7e665ee19bd4508b2b40d497e9851b248.tar.xz samba-5d6f63a7e665ee19bd4508b2b40d497e9851b248.zip |
Fix for [homes] problem with security=share. We were still relying
on a valid vuid to get the connecting username - this is *never* true
(anymore) with security=share.
Jeremy.
-rw-r--r-- | source/smbd/server.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/source/smbd/server.c b/source/smbd/server.c index 01f9006a42a..1d3c2e144c3 100644 --- a/source/smbd/server.c +++ b/source/smbd/server.c @@ -3353,11 +3353,25 @@ int make_connection(char *service,char *user,char *password, int pwlen, char *de if (*user && Get_Pwnam(user,True)) return(make_connection(user,user,password,pwlen,dev,vuid)); - if (validated_username(vuid)) - { - strcpy(user,validated_username(vuid)); - return(make_connection(user,user,password,pwlen,dev,vuid)); - } + if(lp_security() != SEC_SHARE) + { + if (validated_username(vuid)) + { + strcpy(user,validated_username(vuid)); + return(make_connection(user,user,password,pwlen,dev,vuid)); + } + } + else + { + /* + * Security = share. Try with sesssetup_user as the username. + */ + if(*sesssetup_user) + { + strcpy(user,sesssetup_user); + return(make_connection(user,user,password,pwlen,dev,vuid)); + } + } } if (!lp_snum_ok(snum) || !check_access(snum)) { |