## What this fixes
The archive_file resource failed on Infra Client 17.7 with LoadError: Could not open library 'libarchive.so.13': /lib64/liblzma.so.5: version `XZ_5.2' not found, on CentOS 7 / RHEL 7. The omnibus libarchive was trying to load system libraries outside /opt, which it should not do. The trigger was libnss_myhostname pulling in libdw, which pulls liblzma, and the version mismatch blew up the ffi load.
## The fix
The root cause is on the OS side: libnss_myhostname on CentOS/RHEL 7 drags in libdw and liblzma, whose versions clash with the omnibus libarchive. The workaround confirmed by a maintainer is to edit /etc/nsswitch.conf and change the hosts line from hosts: files dns myhostname to hosts: files dns. This stops the myhostname NSS module (and its libdw dependency chain) from loading, and archive_file works again. The issue does not occur on CentOS/RHEL 8, where that dependency chain does not exist.
Source: https://github.com/chef/chef/issues/12228
## Why it happens
The thread above nails the cause, so the fix addresses that directly rather than symptoms. Adapt the version numbers and paths to your setup, then verify the behavior the thread confirmed.
## Source
https://github.com/chef/chef/issues/12228