summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-12-23 11:30:58 +0000
committerJeremy Allison <jra@samba.org>1997-12-23 11:30:58 +0000
commitd4979e7727ef94de469e66b74a9bee6f9742d4c0 (patch)
tree35f3311bee353c16c16e7f00230b95435ccc1bc6 /source3
parentd1e796d8577a666e5ef14f9bb462c080300dca3e (diff)
downloadsamba-d4979e7727ef94de469e66b74a9bee6f9742d4c0.tar.gz
samba-d4979e7727ef94de469e66b74a9bee6f9742d4c0.tar.bz2
samba-d4979e7727ef94de469e66b74a9bee6f9742d4c0.zip
Fixed security bug when 'force user' and 'user only' are set.
Reported by Brian McCauley <B.A.McCauley@bham.ac.uk>. Jeremy. (This used to be commit 00067800a25d6f5fe11e833a01d5a7a1e76dcc11)
Diffstat (limited to 'source3')
-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;