summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/uid.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index b36fa4df06..46a2de4f17 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -222,10 +222,13 @@ BOOL become_user(connection_struct *conn, int cnum, uint16 vuid)
snum = conn->service;
+ if((vuser != NULL) && !check_user_ok(conn, vuser, snum))
+ return False;
+
if (conn->force_user ||
lp_security() == SEC_SHARE ||
- !(vuser) || (vuser->guest) ||
- !check_user_ok(conn, vuser, snum))
+ !(vuser) || (vuser->guest)
+ )
{
uid = conn->uid;
gid = conn->gid;