| Summary: | Confusing errors when pam_acct_mgmt() fails | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Jakub Jelen <jjelen> | ||||||
| Component: | PAM support | Assignee: | Assigned to nobody <unassigned-bugs> | ||||||
| Status: | NEW --- | ||||||||
| Severity: | enhancement | CC: | darren.moffat, dtucker | ||||||
| Priority: | P5 | ||||||||
| Version: | 8.3p1 | ||||||||
| Hardware: | Other | ||||||||
| OS: | Linux | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 3549 | ||||||||
| Attachments: |
|
||||||||
|
Description
Jakub Jelen
2020-09-08 21:18:20 AEST
FYI, it looks like the countermeasures against retrying the pam again are now implemented in the privilege separation and my tests end with the following errors: debug3: monitor_read: checking request 104 fatal: monitor_read: unpermitted request 104 so the patch might be simplified as it is no longer possible to call sshpam_init_ctx() at all if I follow the code and logs correctly. Created attachment 3545 [details]
Alternate proposal to preserve pam_acct_mgmt() return value
I'm adding a slightly different proposed patch, that I believe is both more generic, in that all error values from pam_acct_mgmt() can be passed through. It is also slightly smaller a change.
Unlike the prior patch it intentionally overrides a PAM_SUCCESS sshpam_err value with the one from pam_acct_mgmt(). This is so that an account that has successfully authenticate but for some other reason is not allowed access "just now" has an appropriate error returned (likely PAM_PERM_DENIED).
Comment on attachment 3545 [details] Alternate proposal to preserve pam_acct_mgmt() return value I think I prefer this approach, however > sshpam_err = do_pam_account(); [...] >- return (sshpam_account_status); >+ return (sshpam_err); do_pam_account returns u_int but sshpam_err is and pam_account_mgmt returns int. (sshpam_account_status is also an int but it's only used if it's set to 0 or 1) |