The first commit adds a ctx kwarg to krb_login. Before this change, koji.ClientSession.krb_login always used the default context. This can be an issue when a multi-threaded application shares this context and the Kerberos cache is stored in the thread keyring.
In this scenario, the first thread to run krb_login will succeed while all others will get a "Permission denied" error. By adding the ctx kwarg, a thread can establish a context and tell krb_login to use it instead of the default context.
The second commit makes it so that you can pass in a non-file ccache location to krb_login. This is useful because a multi-threaded application may choose to store the Kerberos cache in the thread keyring [1] to avoid Kerberos cache corruption. Since krb_login prepends the passed in ccache with FILE:, the application must resort to setting the KRB_CCACHE environment variable. This is annoying and unnecessary because ccache defaults to FILE anyways if no Kerberos cache type is specified in the value for ccache [2].
The first commit adds a
ctxkwarg tokrb_login. Before this change,koji.ClientSession.krb_loginalways used the default context. This can be an issue when a multi-threaded application shares this context and the Kerberos cache is stored in the thread keyring.In this scenario, the first thread to run
krb_loginwill succeed while all others will get a "Permission denied" error. By adding thectxkwarg, a thread can establish a context and tellkrb_loginto use it instead of the default context.The second commit makes it so that you can pass in a non-file ccache location to
krb_login. This is useful because a multi-threaded application may choose to store the Kerberos cache in the thread keyring [1] to avoid Kerberos cache corruption. Sincekrb_loginprepends the passed inccachewithFILE:, the application must resort to setting theKRB_CCACHEenvironment variable. This is annoying and unnecessary because ccache defaults toFILEanyways if no Kerberos cache type is specified in the value forccache[2].1 - http://man7.org/linux/man-pages/man7/thread-keyring.7.html
2 - https://web.mit.edu/kerberos/krb5-1.12/doc/basic/ccache_def.html#ccache-types
These issues were encountered in the Module Build Service (MBS), and this is currently hot-fixed in our product deployment to resolve our issue.