summaryrefslogtreecommitdiff
path: root/source/nsswitch/winbindd_pam.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/nsswitch/winbindd_pam.c')
-rw-r--r--source/nsswitch/winbindd_pam.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/nsswitch/winbindd_pam.c b/source/nsswitch/winbindd_pam.c
index cb44ec98d76..90613911182 100644
--- a/source/nsswitch/winbindd_pam.c
+++ b/source/nsswitch/winbindd_pam.c
@@ -372,10 +372,22 @@ done:
afsname = realloc_string_sub(afsname, "%u", name_user);
afsname = realloc_string_sub(afsname, "%U", name_user);
+ {
+ DOM_SID user_sid;
+ fstring sidstr;
+
+ sid_copy(&user_sid, &info3.dom_sid.sid);
+ sid_append_rid(&user_sid, info3.user_rid);
+ sid_to_string(sidstr, &user_sid);
+ afsname = realloc_string_sub(afsname, "%s", sidstr);
+ }
+
if (afsname == NULL) goto no_token;
strlower_m(afsname);
+ DEBUG(10, ("Generating token for user %s\n", afsname));
+
cell = strchr(afsname, '@');
if (cell == NULL) goto no_token;