RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2091062 - "error scanning directory" errors from pam_motd
Summary: "error scanning directory" errors from pam_motd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pam
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: rc
: ---
Assignee: Iker Pedrosa
QA Contact: Anuj Borah
URL:
Whiteboard:
: 2093495 (view as bug list)
Depends On:
Blocks: 2126647
TreeView+ depends on / blocked
 
Reported: 2022-05-27 13:14 UTC by Jonathan Kamens
Modified: 2023-05-16 10:58 UTC (History)
10 users (show)

Fixed In Version: pam-1.3.1-25.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2126647 (view as bug list)
Environment:
Last Closed: 2023-05-16 09:02:48 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github RedHatQE pam pull 60 0 None open "error scanning directory" errors from pam_motd 2022-10-27 15:25:35 UTC
Red Hat Issue Tracker RHELPLAN-123557 0 None None None 2022-05-27 13:29:15 UTC
Red Hat Issue Tracker RHELPLAN-123558 0 None None None 2022-05-27 13:29:17 UTC
Red Hat Issue Tracker SSSD-4703 0 None None None 2022-06-02 13:27:05 UTC
Red Hat Product Errata RHBA-2023:2954 0 None None None 2023-05-16 09:03:00 UTC

Description Jonathan Kamens 2022-05-27 13:14:38 UTC
With the recently released change to pam_motd to address 2014458, every time someone logs in with SSH I see this in /var/log/secure:

```
May 27 09:10:25 jik4 sshd[2379918]: pam_motd(sshd:session): pam_motd: error scanning directory /etc/motd.d
May 27 09:10:25 jik4 sshd[2379918]: pam_motd(sshd:session): pam_motd: error scanning directory /run/motd.d
May 27 09:10:25 jik4 sshd[2379918]: pam_motd(sshd:session): pam_motd: error scanning directory /usr/lib/motd.d
```

It shouldn't be a loggable error for an optional directory not to exist. This should be handled silently. There shouldn't be unnecessary log noise in /var/log/secure making it harder to find the logs that matter.

Comment 1 minl 2022-05-30 10:26:40 UTC
Met this issue against rhel guest image RHEL-8.7.0-20220529:

1. Create VM  and then check journalctl log:
# journalctl | grep error
May 30 02:21:48 minl-vm-disk-8.7-0529 sshd[4873]: pam_motd(sshd:session): pam_motd: error scanning directory /run/motd.d
# rpm -qa pam
pam-1.3.1-19.el8.x86_64

Additional info:
1. No such error in RHEL-8.6.0-20220420:
# rpm -qa pam
pam-1.3.1-16.el8.x86_64
# journalctl | grep error
# 
2. No such error in 9.1.0-20220529:
# rpm -qa pam
pam-1.5.1-11.el9.x86_64
# journalctl | grep error

Comment 2 Iker Pedrosa 2022-09-12 07:21:39 UTC
*** Bug 2093495 has been marked as a duplicate of this bug. ***

Comment 4 Iker Pedrosa 2022-10-27 14:13:18 UTC
master:
    pam_motd: Cleanup the code and avoid unnecessary logging - d57ab22133654033ee1da89f128a81572d320985
    pam_motd: fix NULL dereference when at least one of motd directories is not available- c2c0434bd634a817f2b16ce7f58fc96c04e88b03

Comment 9 errata-xmlrpc 2023-05-16 09:02:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (pam bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2954


Note You need to log in before you can comment on or make changes to this bug.