Why does perl fail with Permission denied on /usr/local/lib64/perl5?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 8
    • Qualys

Issue

  • Perl application fails with error:

    Can't locate SSH.pm:   /usr/local/lib64/perl5/SSH.pm: Permission denied
    
  • Some content in /usr/local/{lib64,share}/perl5 was deleted

Resolution

Contact Qualys Technical Support Team for further troubleshooting and remediation.

Root Cause

Review incident article from Qualys Article Link.

Disclaimer: Links contained herein to external website(s) are provided for convenience only. Red Hat has not reviewed the links and is not responsible for the content or its availability. The inclusion of any link to an external website does not imply endorsement by Red Hat of the website or their entities, products or services. You agree that Red Hat is not responsible or liable for any loss or expenses that may result due to your use of (or reliance on) the external site or content.

Diagnostic Steps

  • Verify that Qualys agent is installed

    # rpm -qa | grep qualys
    qualys-cloud-agent-7.0.2-6.x86_64
    
  • Verify if the directories listed below have permissions that differ from the Qualys recommendations

    # [ -d /usr/local/lib64/perl5 ] && ls -ld /usr/local/lib64/perl5
    # [ -d /usr/local/share/perl5 ] && ls -ld /usr/local/share/perl5
    
    # stat -c "%a %n" /usr/local/lib64/perl5 /usr/local/share/perl5
    
  • Remediation can be achieved by ensuring all directories and files under the pair of perl directories are world-readable.

   find /usr/local/lib64/perl5 /usr/local/share/perl5 -type d -print0 | xargs -0 chmod 755
   find /usr/local/lib64/perl5 /usr/local/share/perl5 -type f -print0 | xargs -0 chmod 644

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments