summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-04-20 17:52:57 -0700
committerJeremy Allison <jra@samba.org>2012-04-23 19:52:19 +0200
commit5b5b696c1e36dc7f81da24158e0853290084dec8 (patch)
tree1ea96f31bb482924c3c9d0834d0cb5204571d5fa /source3
parentfbaaf4b21fd7253d333261ba925e8f40122335e8 (diff)
downloadsamba-5b5b696c1e36dc7f81da24158e0853290084dec8.tar.gz
samba-5b5b696c1e36dc7f81da24158e0853290084dec8.tar.bz2
samba-5b5b696c1e36dc7f81da24158e0853290084dec8.zip
Fix bug #8882 - Broken processing of %U with vfs_full_audit when force user is set.
When doing a "force user" we need to remember what the "sanitized_username" was from the original connect. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Apr 23 19:52:19 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/service.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 914cec86d8..6a2df18ce0 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -439,6 +439,7 @@ NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum)
*/
char *fuser;
+ char *sanitized_username;
struct auth_session_info *forced_serverinfo;
bool guest;
@@ -458,6 +459,16 @@ NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum)
return status;
}
+ /* We don't want to replace the original sanitized_username
+ as it is the original user given in the connect attempt.
+ This is used in '%U' substitutions. */
+ sanitized_username = discard_const_p(char,
+ forced_serverinfo->unix_info->sanitized_username);
+ TALLOC_FREE(sanitized_username);
+ forced_serverinfo->unix_info->sanitized_username =
+ talloc_move(forced_serverinfo->unix_info,
+ &conn->session_info->unix_info->sanitized_username);
+
TALLOC_FREE(conn->session_info);
conn->session_info = forced_serverinfo;