From dc15954196e237d10c0fe3e9dd30316e1704ce25 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 12 Jul 2017 16:07:25 +0200 Subject: [PATCH] s3:client: Use KRB5CCNAME in smbspool_krb5_wrapper if set Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- source3/client/smbspool_krb5_wrapper.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c index a72006a4c4f..9a82b2a7b69 100644 --- a/source3/client/smbspool_krb5_wrapper.c +++ b/source3/client/smbspool_krb5_wrapper.c @@ -181,6 +181,13 @@ int main(int argc, char *argv[]) return CUPS_BACKEND_FAILED; } + env = getenv("KRB5CCNAME"); + if (env != NULL && env[0] != 0) { + snprintf(gen_cc, sizeof(gen_cc), "%s", env); + + goto create_env; + } + snprintf(gen_cc, sizeof(gen_cc), "/tmp/krb5cc_%d", uid); rc = lstat(gen_cc, &sb); @@ -205,6 +212,7 @@ int main(int argc, char *argv[]) } } +create_env: /* * Make sure we do not have LD_PRELOAD or other security relevant * environment variables set.