diff options
author | Jeremy Allison <jra@samba.org> | 2019-07-12 12:10:35 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2019-09-03 08:07:37 +0000 |
commit | e48c11896904fd063619a95d3fa7ceccbf2beb56 (patch) | |
tree | e9eb03c274845b7a5d73505977638b96968f9b37 /source3/smbd/uid.c | |
parent | 16c3a00d2eb8471dfa4cf9ace003578331d2e1e0 (diff) | |
download | samba-e48c11896904fd063619a95d3fa7ceccbf2beb56.tar.gz |
CVE-2019-10197: smbd: separate out impersonation debug info into a new function.
Will be called on elsewhere on successful impersonation.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/smbd/uid.c')
-rw-r--r-- | source3/smbd/uid.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 53c7aa7b798..0952c0aff59 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -279,6 +279,28 @@ static bool check_user_ok(connection_struct *conn, return(True); } +static void print_impersonation_info(connection_struct *conn) +{ + struct smb_filename *cwdfname = NULL; + + if (!CHECK_DEBUGLVL(DBGLVL_INFO)) { + return; + } + + cwdfname = vfs_GetWd(talloc_tos(), conn); + if (cwdfname == NULL) { + return; + } + + DBG_INFO("Impersonated user: uid=(%d,%d), gid=(%d,%d), cwd=[%s]\n", + (int)getuid(), + (int)geteuid(), + (int)getgid(), + (int)getegid(), + cwdfname->base_name); + TALLOC_FREE(cwdfname); +} + /**************************************************************************** Become the user of a connection number without changing the security context stack, but modify the current_user entries. @@ -415,20 +437,7 @@ static bool change_to_user_internal(connection_struct *conn, current_user.done_chdir = true; } - if (CHECK_DEBUGLVL(DBGLVL_INFO)) { - struct smb_filename *cwdfname = vfs_GetWd(talloc_tos(), conn); - if (cwdfname == NULL) { - return false; - } - DBG_INFO("Impersonated user: uid=(%d,%d), gid=(%d,%d), cwd=[%s]\n", - (int)getuid(), - (int)geteuid(), - (int)getgid(), - (int)getegid(), - cwdfname->base_name); - TALLOC_FREE(cwdfname); - } - + print_impersonation_info(conn); return true; } |