summaryrefslogtreecommitdiff
path: root/source4/auth/unix_token.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-01-30 21:49:33 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-02-13 01:25:59 +0100
commitcaf485a2bd0453b7d22600f9106a2026b1a50c79 (patch)
tree23f5b05f738a6ebd565c7b49ffe91356dd7fff4a /source4/auth/unix_token.c
parent05f9495ff36c2335ff9c69ea408cd9328f6cc6e6 (diff)
downloadsamba-caf485a2bd0453b7d22600f9106a2026b1a50c79.tar.gz
samba-caf485a2bd0453b7d22600f9106a2026b1a50c79.tar.bz2
samba-caf485a2bd0453b7d22600f9106a2026b1a50c79.zip
auth: Pass in the SMB username (for %U) into generate_session_info
This matches what Samba3 does. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Mon Feb 13 01:25:59 CET 2012 on sn-devel-104
Diffstat (limited to 'source4/auth/unix_token.c')
-rw-r--r--source4/auth/unix_token.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/auth/unix_token.c b/source4/auth/unix_token.c
index 24f3226cea..7a7d464f0d 100644
--- a/source4/auth/unix_token.c
+++ b/source4/auth/unix_token.c
@@ -125,8 +125,9 @@ NTSTATUS security_token_to_unix_token(TALLOC_CTX *mem_ctx,
/*
Fill in the auth_user_info_unix and auth_unix_token elements in a struct session_info
*/
-NTSTATUS auth_session_info_fill_unix( struct wbc_context *wbc_ctx,
+NTSTATUS auth_session_info_fill_unix(struct wbc_context *wbc_ctx,
struct loadparm_context *lp_ctx,
+ const char *original_user_name,
struct auth_session_info *session_info)
{
char *su;
@@ -149,11 +150,11 @@ NTSTATUS auth_session_info_fill_unix( struct wbc_context *wbc_ctx,
session_info->info->account_name);
NT_STATUS_HAVE_NO_MEMORY(session_info->unix_info->unix_name);
- len = strlen(session_info->info->account_name) + 1;
+ len = strlen(original_user_name) + 1;
session_info->unix_info->sanitized_username = su = talloc_array(session_info->unix_info, char, len);
NT_STATUS_HAVE_NO_MEMORY(su);
- alpha_strcpy(su, session_info->info->account_name,
+ alpha_strcpy(su, original_user_name,
". _-$", len);
return NT_STATUS_OK;