s3: smbd: Fileserving share access checks.
commit67fc5bff3761225223d03a44a5069f6a759aa828
authorJeremy Allison <jra@samba.org>
Mon, 17 Mar 2014 21:48:30 +0000 (17 14:48 -0700)
committerKarolin Seeger <kseeger@samba.org>
Tue, 1 Apr 2014 07:08:06 +0000 (1 09:08 +0200)
tree619f48a6e7d2f13efc7271cd298b84cb632cd7a0
parentc96bac899e5ae40bb65c60c9aab767a04dd4ff0f
s3: smbd: Fileserving share access checks.

Git commit 86d1e1db8e2747e30c89627cda123fde1e84f579
fixed share_access not being reset between users,
by changing make_connection_snum() to call a common
function check_user_share_access() in the same way
that change_to_user() (which can be called on any
incoming packet) does.

Unfortunately that bugfix was incorrect and
broke "force user" and "force group" as it
called check_user_share_access() inside
make_connection_snum() using the conn->session_info
pointer instead of the vuser->session_info pointer.

conn->session_info represents the token to use
when actually accessing the file system, and so
is modified by force user and force group.

vuser->session_info represents the "pristine"
token of the user logging in, and is never modified
by force user and force group.

Samba 3.6.x checked the share access based on
the "pristine" token of the user logging in,
not the token modified by force user and force group.
This change restores the expected behavior.

Fixes bug #9878 - force user does not work as expected

https://bugzilla.samba.org/show_bug.cgi?id=9878

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/smbd/service.c