1
0
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:
Günther Deschner 2013-07-18 19:05:51 +02:00 committed by Jeremy Allison
parent 73e6feff9b
commit 7ad3a367d5

View File

@ -492,6 +492,29 @@ static const char *generate_krb5_ccache(TALLOC_CTX *mem_ctx,
gen_cc = talloc_asprintf( gen_cc = talloc_asprintf(
mem_ctx, "WRFILE:/tmp/krb5cc_%d", uid); 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; *user_ccache_file = gen_cc;