1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3: smbd: Ensure when we change security context we delete any $cwd cache.

This will ensure we *always* call into the VFS_SMB_CHDIR backends
on security context switch. The $cwd was an optimization that
was only looking at the raw filesystem path. We could delete it
completely but that is a patch for another day.

Remove knownfail on regression test.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14682
RN: vfs_shadow_copy2: core dump in make_relative_path

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Oct  8 21:28:04 UTC 2021 on sn-devel-184
This commit is contained in:
Jeremy Allison 2021-10-07 14:11:25 -07:00 committed by Ralph Boehme
parent 954e637ddc
commit 4fe9658362
2 changed files with 8 additions and 1 deletions

View File

@ -1 +0,0 @@
^samba3.blackbox.chdir-cache.*

View File

@ -360,6 +360,14 @@ static void set_sec_ctx_internal(uid_t uid, gid_t gid,
current_user.ut.ngroups = ngroups;
current_user.ut.groups = groups;
current_user.nt_user_token = ctx_p->token;
/*
* Delete any ChDir cache. We can't assume
* the new uid has access to current working
* directory.
* BUG: https://bugzilla.samba.org/show_bug.cgi?id=14682
*/
SAFE_FREE(LastDir);
}
void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, const struct security_token *token)