mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3-winbindd: support the DIR pragma for raw kerberos user pam authentication.
It is currently only available in MIT. In addition, allow to define custom filepaths for FILE, WRFILE and DIR pragmas and substitute one occurence of the %u pattern. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Pair-Programmed-With: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
73e6feff9b
commit
7ad3a367d5
@ -492,6 +492,29 @@ static const char *generate_krb5_ccache(TALLOC_CTX *mem_ctx,
|
||||
gen_cc = talloc_asprintf(
|
||||
mem_ctx, "WRFILE:/tmp/krb5cc_%d", uid);
|
||||
}
|
||||
if (strequal(type, "DIR")) {
|
||||
gen_cc = talloc_asprintf(
|
||||
mem_ctx, "DIR:/run/user/%d/krb5cc", uid);
|
||||
}
|
||||
|
||||
if (strnequal(type, "FILE:/", 6) ||
|
||||
strnequal(type, "WRFILE:/", 8) ||
|
||||
strnequal(type, "DIR:/", 5)) {
|
||||
|
||||
/* we allow only one "%u" substitution */
|
||||
|
||||
char *p;
|
||||
|
||||
p = strchr(type, '%');
|
||||
if (p != NULL) {
|
||||
|
||||
p++;
|
||||
|
||||
if (p != NULL && *p == 'u' && strchr(p, '%') == NULL) {
|
||||
gen_cc = talloc_asprintf(mem_ctx, type, uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*user_ccache_file = gen_cc;
|
||||
|
Loading…
Reference in New Issue
Block a user