summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2020-02-19 13:20:14 -0800
committerKarolin Seeger <kseeger@samba.org>2020-02-21 09:20:14 +0000
commit370278fca390c2cdbd4fe523a27208bfa094a81a (patch)
tree4714b94f8bc613eb411c0ef2af8000d713a100d7
parent4ee5642bea361a3308df4743c69e6f10052a262a (diff)
downloadsamba-370278fca390c2cdbd4fe523a27208bfa094a81a.tar.gz
s3: VFS: full_audit. Use system session_info if called from a temporary share definition.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14283 Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(v4-11-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-11-test): Fri Feb 21 09:20:14 UTC 2020 on sn-devel-184
-rw-r--r--source3/modules/vfs_full_audit.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index a442563115c..bdeff2aae46 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -478,6 +478,7 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn)
{
char *prefix = NULL;
char *result;
+ const struct auth_session_info *session_info = conn->session_info;
prefix = talloc_strdup(ctx,
lp_parm_const_string(SNUM(conn), "full_audit",
@@ -485,13 +486,24 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn)
if (!prefix) {
return NULL;
}
+
+ if (session_info == NULL) {
+ /*
+ * conn->session_info can be NULL if we're
+ * called from a temporary conn created in
+ * the MSDFS and other code. It's been created
+ * by root so just use the system session.
+ */
+ session_info = get_session_info_system();
+ }
+
result = talloc_sub_full(ctx,
lp_servicename(talloc_tos(), SNUM(conn)),
- conn->session_info->unix_info->unix_name,
+ session_info->unix_info->unix_name,
conn->connectpath,
- conn->session_info->unix_token->gid,
- conn->session_info->unix_info->sanitized_username,
- conn->session_info->info->domain_name,
+ session_info->unix_token->gid,
+ session_info->unix_info->sanitized_username,
+ session_info->info->domain_name,
prefix);
TALLOC_FREE(prefix);
return result;