dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

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

836b22
From 89e94440048d1660dc9520c161597dd71c2ecb0c Mon Sep 17 00:00:00 2001
836b22
From: Sumit Bose <sbose@redhat.com>
836b22
Date: Wed, 3 Jun 2020 20:35:04 +0200
836b22
Subject: [PATCH 37/38] pam_sss: add SERVICE_IS_GDM_SMARTCARD
836b22
836b22
Resolves: https://github.com/SSSD/sssd/issues/5190
836b22
836b22
(cherry picked with changes from commit 26c794da31c215fef3e41429f6f13afdaf349bee)
836b22
836b22
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
836b22
---
836b22
 src/sss_client/pam_sss.c | 4 +++-
836b22
 1 file changed, 3 insertions(+), 1 deletion(-)
836b22
836b22
diff --git a/src/sss_client/pam_sss.c b/src/sss_client/pam_sss.c
836b22
index ab9b7478e..4dbf1733c 100644
836b22
--- a/src/sss_client/pam_sss.c
836b22
+++ b/src/sss_client/pam_sss.c
836b22
@@ -79,6 +79,8 @@
836b22
 #define DEBUG_MGS_LEN 1024
836b22
 #define MAX_AUTHTOK_SIZE (1024*1024)
836b22
 #define CHECK_AND_RETURN_PI_STRING(s) ((s != NULL && *s != '\0')? s : "(not available)")
836b22
+#define SERVICE_IS_GDM_SMARTCARD(pitem) (strcmp((pitem)->pam_service, \
836b22
+                                                "gdm-smartcard") == 0)
836b22
 
836b22
 static void logger(pam_handle_t *pamh, int level, const char *fmt, ...) {
836b22
     va_list ap;
836b22
@@ -2506,7 +2508,7 @@ static int pam_sss(enum sss_cli_command task, pam_handle_t *pamh,
836b22
                     }
836b22
                 }
836b22
 
836b22
-                if (strcmp(pi.pam_service, "gdm-smartcard") == 0) {
836b22
+                if (SERVICE_IS_GDM_SMARTCARD(&pi)) {
836b22
                     ret = check_login_token_name(pamh, &pi, quiet_mode);
836b22
                     if (ret != PAM_SUCCESS) {
836b22
                         D(("check_login_token_name failed.\n"));
836b22
-- 
836b22
2.21.1
836b22