Blame SOURCES/0021-pam_sss-add-SERVICE_IS_GDM_SMARTCARD.patch

8aada9
From 26c794da31c215fef3e41429f6f13afdaf349bee Mon Sep 17 00:00:00 2001
8aada9
From: Sumit Bose <sbose@redhat.com>
8aada9
Date: Wed, 3 Jun 2020 20:35:04 +0200
8aada9
Subject: [PATCH 21/22] pam_sss: add SERVICE_IS_GDM_SMARTCARD
8aada9
8aada9
Resolves: https://github.com/SSSD/sssd/issues/5190
8aada9
8aada9
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
8aada9
---
8aada9
 src/sss_client/pam_sss.c | 4 +++-
8aada9
 1 file changed, 3 insertions(+), 1 deletion(-)
8aada9
8aada9
diff --git a/src/sss_client/pam_sss.c b/src/sss_client/pam_sss.c
8aada9
index 69b440774..7e59f0487 100644
8aada9
--- a/src/sss_client/pam_sss.c
8aada9
+++ b/src/sss_client/pam_sss.c
8aada9
@@ -71,6 +71,8 @@
8aada9
 #define DEBUG_MGS_LEN 1024
8aada9
 #define MAX_AUTHTOK_SIZE (1024*1024)
8aada9
 #define CHECK_AND_RETURN_PI_STRING(s) ((s != NULL && *s != '\0')? s : "(not available)")
8aada9
+#define SERVICE_IS_GDM_SMARTCARD(pitem) (strcmp((pitem)->pam_service, \
8aada9
+                                                "gdm-smartcard") == 0)
8aada9
 
8aada9
 static void logger(pam_handle_t *pamh, int level, const char *fmt, ...) {
8aada9
     va_list ap;
8aada9
@@ -2580,7 +2582,7 @@ static int pam_sss(enum sss_cli_command task, pam_handle_t *pamh,
8aada9
                     return PAM_AUTHINFO_UNAVAIL;
8aada9
                 }
8aada9
 
8aada9
-                if (strcmp(pi.pam_service, "gdm-smartcard") == 0
8aada9
+                if (SERVICE_IS_GDM_SMARTCARD(&pi)
8aada9
                         || (flags & PAM_CLI_FLAGS_REQUIRE_CERT_AUTH)) {
8aada9
                     ret = check_login_token_name(pamh, &pi, retries,
8aada9
                                                  quiet_mode);
8aada9
-- 
8aada9
2.21.3
8aada9