I have a weird problem where the rpm command hangs for 40 seconds (it's always exactly 40 seconds) when executed as any non-root user. It doesn't matter what command line arguments are used, even "rpm" without any arguments hangs (rpm --help is the only exception).
strace shows that it hangs on a select() call with two file descriptors pointing to /etc/passwd and /etc/pam.d/other, which doesn't make any sense to me.
When executed as root it completes immediately.
The system is RHEL 7, I observed the issue on two completely different machines in different customer environments.
I'm looking for a solution or some hints where to continue the investigation.