Description
issue
PR #888 introduced an approach to find the _libnss_library: https://github.com/infosiftr/postgres/blob/ab940cbb923af99e2c7cf0e0ba5305bc6815aecc/docker-entrypoint.sh#L73-L84
This approach was invalid because it used the pattern {/usr,}/lib{/*,}/libnss_wrapper.so
. Depending on environment, it might find binaries in
/usr/lib/x86_64-linux-gnu/libnss_wrapper.so
/usr/lib/libnss_wrapper.so
/lib/*/libnss_wrapper.so
/lib/libnss_wrapper.so
Later in the code, "nss_wrapper" bits get unset/cleanup, but LD_PRELOAD
is tested against /usr/lib/libnss_wrapper.so
only. So in worst-cast, the variables won't get unset: https://github.com/infosiftr/postgres/blob/ab940cbb923af99e2c7cf0e0ba5305bc6815aecc/docker-entrypoint.sh#L94
fix
hint
There might be better approaches, f.e. testing if LD_PRELOAD
has been set at all or making it POSIX-compatible, but I wanted to keep most of the original code.