Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2126647

Summary: "error scanning directory" errors from pam_motd
Product: Red Hat Enterprise Linux 9 Reporter: Iker Pedrosa <ipedrosa>
Component: pamAssignee: Iker Pedrosa <ipedrosa>
Status: CLOSED NOTABUG QA Contact: Anuj Borah <aborah>
Severity: unspecified Docs Contact:
Priority: low    
Version: 9.0CC: aborah, bstinson, h1k6zn2m, ipedrosa, jwboyer, minl, pbrezina, rpm, sgadekar, sssd-qe, vkuznets, xiliang, yacao
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2091062 Environment:
Last Closed: 2022-10-27 14:15:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2091062    
Bug Blocks:    

Description Iker Pedrosa 2022-09-14 07:56:07 UTC
+++ This bug was initially created as a clone of Bug #2091062 +++

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.

--- Additional comment from minl on 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

--- Additional comment from Iker Pedrosa on 2022-09-12 07:21:39 UTC ---

Comment 2 Iker Pedrosa 2022-10-27 14:15:33 UTC
The fix is already available in pam-1.5.1 version.