From a69fee3ca6383df87f6e5d669d532d07767bc112 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 13 May 2005 12:21:35 +0000 Subject: r6779: Use the SID in the user token for the %s expansion in 'afs username map'. This fixes a rather weird problem where an algorithmic SID ended up as the replacement for %s. Volker (This used to be commit 67dbc91b27aeeeab3cc1360137db1dd955728061) --- source3/lib/afs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/afs.c b/source3/lib/afs.c index 7f79429b9e..b8173f7cc1 100644 --- a/source3/lib/afs.c +++ b/source3/lib/afs.c @@ -209,20 +209,21 @@ char *afs_createtoken_str(const char *username, const char *cell) BOOL afs_login(connection_struct *conn) { + extern struct current_user current_user; DATA_BLOB ticket; pstring afs_username; char *cell; BOOL result; char *ticket_str; - DOM_SID user_sid; + const DOM_SID *user_sid; struct ClearToken ct; pstrcpy(afs_username, lp_afs_username_map()); standard_sub_conn(conn, afs_username, sizeof(afs_username)); - if (NT_STATUS_IS_OK(uid_to_sid(&user_sid, conn->uid))) - pstring_sub(afs_username, "%s", sid_string_static(&user_sid)); + user_sid = ¤t_user.nt_user_token->user_sids[0]; + pstring_sub(afs_username, "%s", sid_string_static(user_sid)); /* The pts command always generates completely lower-case user * names. */ -- cgit