URL: https://github.com/SSSD/sssd/pull/204 Author: sumit-bose Title: #204: krb5: return to responder that pkinit is not available Action: opened
PR body: """ If pkinit is not available for a user but other authentication methods are SSSD should still fall back to local certificate based authentication if Smartcard credentials are provided.
Resolves https://pagure.io/SSSD/sssd/issue/3343 """
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/204/head:pr204 git checkout pr204
URL: https://github.com/SSSD/sssd/pull/204 Title: #204: krb5: return to responder that pkinit is not available
jhrozek commented: """ LGTM, the code comment helps understand the complex condition, thanks.
I just ran CI and Coverity to rubber-stamp the patch before pushing. """
See the full comment at https://github.com/SSSD/sssd/pull/204#issuecomment-289878411
URL: https://github.com/SSSD/sssd/pull/204 Title: #204: krb5: return to responder that pkinit is not available
lslebodn commented: """ I would personally prefer some macro or local variable because added condition is too complicated IMHO. Because there is `( (!A && !B) || ( ( A || B) && IS_SC_AUTHTOK() )` which is equivalent to ``` C = ( A || B) ( !C || ( C && IS_SC_AUTHTOK() ) ``` """
See the full comment at https://github.com/SSSD/sssd/pull/204#issuecomment-289897144
URL: https://github.com/SSSD/sssd/pull/204 Title: #204: krb5: return to responder that pkinit is not available
sumit-bose commented: """ I agree that the overall condition is complicated and I thought about extracting some conditions as well. In the end I decided against it because I think it helps to understand the conditions if each authentication type is listed explicitly. """
See the full comment at https://github.com/SSSD/sssd/pull/204#issuecomment-289905210
URL: https://github.com/SSSD/sssd/pull/204 Title: #204: krb5: return to responder that pkinit is not available
lslebodn commented: """ On (28/03/17 14:07), sumit-bose wrote:
I agree that the overall condition is complicated and I thought about extracting some conditions as well. In the end I decided against it because I think it helps to understand the conditions if each authentication type is listed explicitly.
Sure; but current indentaion does not improve it either.
If we ignore 80 collumn limit then follwing is a little bit better ``` diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c index a4128dda6..94bf1ee6d 100644 --- a/src/providers/krb5/krb5_child.c +++ b/src/providers/krb5/krb5_child.c @@ -1539,11 +1539,9 @@ static krb5_error_code get_and_save_tgt(struct krb5_req *kr, if (kr->pd->cmd == SSS_PAM_AUTHENTICATE && kerr == KRB5_PREAUTH_FAILED && kr->pkinit_prompting == false - && (( kr->password_prompting == false - && kr->otp == false) - || ((kr->otp == true - || kr->password_prompting == true) - && IS_SC_AUTHTOK(kr->pd->authtok))) ) { + && (( kr->password_prompting == false && kr->otp == false) + || ((kr->otp == true || kr->password_prompting == true) + && IS_SC_AUTHTOK(kr->pd->authtok))) ) { return ERR_NO_AUTH_METHOD_AVAILABLE; } return kerr; ```
It jut my personal opinion. Others can have different. Feel free to push current version.
LS
"""
See the full comment at https://github.com/SSSD/sssd/pull/204#issuecomment-289912004
URL: https://github.com/SSSD/sssd/pull/204 Title: #204: krb5: return to responder that pkinit is not available
jhrozek commented: """ I really don't mind one way or another. I find all the proposed versions of the condition complex, that's why I'm glad there is a comment atop them.
So from my point of view, I'm fine with the first version """
See the full comment at https://github.com/SSSD/sssd/pull/204#issuecomment-290027496
URL: https://github.com/SSSD/sssd/pull/204 Title: #204: krb5: return to responder that pkinit is not available
lslebodn commented: """ On (29/03/17 01:58), Jakub Hrozek wrote:
I really don't mind one way or another. I find all the proposed versions of the condition complex, that's why I'm glad there is a comment atop them.
So from my point of view, I'm fine with the first version
OK, go ahead and push. sorry for noise.
LS
"""
See the full comment at https://github.com/SSSD/sssd/pull/204#issuecomment-290046824
URL: https://github.com/SSSD/sssd/pull/204 Title: #204: krb5: return to responder that pkinit is not available
jhrozek commented: """ ok, thanks! """
See the full comment at https://github.com/SSSD/sssd/pull/204#issuecomment-290063709
URL: https://github.com/SSSD/sssd/pull/204 Title: #204: krb5: return to responder that pkinit is not available
Label: +Accepted
URL: https://github.com/SSSD/sssd/pull/204 Title: #204: krb5: return to responder that pkinit is not available
Label: +Pushed
URL: https://github.com/SSSD/sssd/pull/204 Title: #204: krb5: return to responder that pkinit is not available
jhrozek commented: """ * master: 1c551b1373799643f3e9ba4f696d21b8fc57dafd """
See the full comment at https://github.com/SSSD/sssd/pull/204#issuecomment-290083552
URL: https://github.com/SSSD/sssd/pull/204 Author: sumit-bose Title: #204: krb5: return to responder that pkinit is not available Action: closed
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/204/head:pr204 git checkout pr204
sssd-devel@lists.fedorahosted.org