title: Linux custom NSS module, `_nss_SERVICE_getspnam_r` is called but `_nss_SERVICE_getpwnam_r` is not
body: <p>I'm creating a custom NSS module. I managed to make it work on my local Redhat 7.3 box, configured <code>nsswitch.conf</code> correctly</p>
  
  <pre><code>passwd: files SERVICE
  shadow: files SERVICE
  </code></pre>
  
  <p>and confirmed that both <code>_nss_SERVICE_getpwnam_r</code> and  <code>_nss_SERVICE_getspnam_r</code> are called with:</p>
  
  <pre><code>getenv passwd username
  getenv shadow username
  </code></pre>
  
  <p>But after I compiled and installed it on a different box, also RedHat 7.3, only <code>_nss_SERVICE_getspnam_r</code> gets successfully called. I print out logs to make sure that as long as glibc enters the function, there will be a trace, but still can't get <code>_nss_SERVICE_getpwnam_r</code> to work properly. There must be some other configuration that overrides <code>nssswitch.conf</code> isn't there? What could possibly be the reason of this problem?</p>