summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_pam.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-02-11 10:32:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:37 -0500
commitaa9132cc55d43d9d197e3196fc7098eec6e8615a (patch)
tree265f77ad172f521c464011b60232aee5a02e7b68 /source3/nsswitch/winbindd_pam.c
parentfbd9e4098333e7d121207ae6991e525768d411e0 (diff)
downloadsamba-aa9132cc55d43d9d197e3196fc7098eec6e8615a.tar.gz
samba-aa9132cc55d43d9d197e3196fc7098eec6e8615a.tar.bz2
samba-aa9132cc55d43d9d197e3196fc7098eec6e8615a.zip
r5331: Support SIDs as %s replacements in the afs username map parameter.
Add 'log nt token command' parameter. If set, %s is replaced with the user sid, and %t takes all the group sids. Volker (This used to be commit e7dc9fde45c750013ad07f584599dd51f8eb8a54)
Diffstat (limited to 'source3/nsswitch/winbindd_pam.c')
-rw-r--r--source3/nsswitch/winbindd_pam.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c
index cb44ec98d7..9061391118 100644
--- a/source3/nsswitch/winbindd_pam.c
+++ b/source3/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;