URL: https://github.com/SSSD/sssd/pull/5705
Title: #5705: p11_child: do_card fix loop exit condition

assafmo commented:
"""
Also, the most recent version for Debian is v2.2.3 
(8607b4822e4b6437d87dabf714882407f8959ef2), so here's the fix for it:

```diff
[p11_child.patch.txt](https://github.com/SSSD/sssd/files/6820708/p11_child.patch.txt)
[p11_child.patch.txt](https://github.com/SSSD/sssd/files/6820710/p11_child.patch.txt)

diff --git a/src/p11_child/p11_child_nss.c b/src/p11_child/p11_child_nss.c
index d3064ff..a7520df 100644
--- a/src/p11_child/p11_child_nss.c
+++ b/src/p11_child/p11_child_nss.c
@@ -595,7 +595,7 @@ errno_t do_card(TALLOC_CTX *mem_ctx, struct p11_ctx 
*p11_ctx,
                       (slInfo.flags & CKF_REMOVABLE_DEVICE) ? "true": "false",
                       (slInfo.flags & CKF_TOKEN_PRESENT) ? "true": "false");
 
-                if (rv == SECSuccess && (slInfo.flags & CKF_REMOVABLE_DEVICE)) 
{
+                if (rv == SECSuccess && (slInfo.flags & CKF_REMOVABLE_DEVICE) 
&& (slInfo.flags & CKF_TOKEN_PRESENT)) {
                     slot = PK11_ReferenceSlot(mod_list_item->module->slots[s]);
                     break;
                 }
diff --git a/src/p11_child/p11_child_openssl.c 
b/src/p11_child/p11_child_openssl.c
index 56601b1..586af33 100644
--- a/src/p11_child/p11_child_openssl.c
+++ b/src/p11_child/p11_child_openssl.c
@@ -1714,7 +1714,7 @@ errno_t do_card(TALLOC_CTX *mem_ctx, struct p11_ctx 
*p11_ctx,
 
                 }
 
-                if ((info.flags & CKF_REMOVABLE_DEVICE)) {
+                if ((info.flags & CKF_REMOVABLE_DEVICE) && (info.flags & 
CKF_TOKEN_PRESENT)) {
                     break;
                 }
             }
```
"""

See the full comment at 
https://github.com/SSSD/sssd/pull/5705#issuecomment-880421092
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to