From 31ae9c7013be791717f6e77794ce8c8fc1c1c16c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 10 Apr 1998 01:19:18 +0000 Subject: 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. (This used to be commit 5d6f63a7e665ee19bd4508b2b40d497e9851b248) --- source3/smbd/server.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 01f9006a42..1d3c2e144c 100644 --- a/source3/smbd/server.c +++ b/source3/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)) { -- cgit