From: Volker Lendecke Date: Wed, 21 Nov 2018 14:28:42 +0000 (+0100) Subject: credentials: Fix set_ccache with empty creds cache X-Git-Tag: tdb-1.3.17~581 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=730beac16200b92dc6dd85a11747940d6f50600d;p=thirdparty%2Fsamba.git credentials: Fix set_ccache with empty creds cache This is an extension of bb2f7e3aee7e9b8: Without this fix in the "empty ccache" case we never set cred->ccache, so the whole call to cli_credentials_set_ccache became pointless Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c index a683caf98ef..6087da8d51f 100644 --- a/auth/credentials/credentials_krb5.c +++ b/auth/credentials/credentials_krb5.c @@ -354,14 +354,15 @@ _PUBLIC_ int cli_credentials_set_ccache(struct cli_credentials *cred, TALLOC_FREE(ccc); return ret; } + } + + cred->ccache = ccc; + cred->ccache_obtained = obtained; + talloc_steal(cred, ccc); - cred->ccache = ccc; - cred->ccache_obtained = obtained; - talloc_steal(cred, ccc); + cli_credentials_invalidate_client_gss_creds( + cred, cred->ccache_obtained); - cli_credentials_invalidate_client_gss_creds(cred, cred->ccache_obtained); - return 0; - } return 0; }