-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
krb5: return to responder that pkinit is not available #204
Conversation
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
LGTM, the code comment helps understand the complex condition, thanks. I just ran CI and Coverity to rubber-stamp the patch before pushing. |
I would personally prefer some macro or local variable because added condition is too complicated IMHO. Because there is
|
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. |
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
|
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 |
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
|
ok, thanks! |
|
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