| 1 |
From: Sam Hartman <[email protected]> |
| 2 |
Date: Mon, 11 Sep 2023 14:00:42 -0600 |
| 3 |
Subject: handle the case of flags being empty or only PAM_SILENT, which is |
| 4 |
|
| 5 |
documented in other PAM implementations as meaning PAM_ESTABLISH_CRED: |
| 6 |
http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.basetechref%2Fdoc%2Fbasetrf1%2Fpam_setcred.htm |
| 7 |
--- |
| 8 |
modules/pam_group/pam_group.c | 5 ++++- |
| 9 |
1 file changed, 4 insertions(+), 1 deletion(-) |
| 10 |
|
| 11 |
diff --git a/modules/pam_group/pam_group.c b/modules/pam_group/pam_group.c |
| 12 |
index 21c04d7..7d89dd0 100644 |
| 13 |
--- a/modules/pam_group/pam_group.c |
| 14 |
+++ b/modules/pam_group/pam_group.c |
| 15 |
@@ -772,9 +772,12 @@ pam_sm_setcred (pam_handle_t *pamh, int flags, |
| 16 |
unsigned setting; |
| 17 |
|
| 18 |
/* only interested in establishing credentials */ |
| 19 |
+ /* PAM docs say that an empty flag is to be treated as PAM_ESTABLISH_CRED. |
| 20 |
+ Some people just pass PAM_SILENT, so cope with it, too. */ |
| 21 |
|
| 22 |
setting = flags; |
| 23 |
- if (!(setting & (PAM_ESTABLISH_CRED | PAM_REINITIALIZE_CRED))) { |
| 24 |
+ if (!(setting & (PAM_ESTABLISH_CRED | PAM_REINITIALIZE_CRED)) |
| 25 |
+ && (setting != 0) && (setting != PAM_SILENT)) { |
| 26 |
D(("ignoring call - not for establishing credentials")); |
| 27 |
return PAM_SUCCESS; /* don't fail because of this */ |
| 28 |
} |