nwrap: Fix the build on FreeBSD
[nivanova/samba-autobuild/.git] / lib / nss_wrapper / nss_wrapper.c
index a6ca81637ffe3dda29b361a6855a5da37f5afe3c..a8c97e1a461f3a95866f0b55a4e9abc76d9e8971 100644 (file)
@@ -5551,6 +5551,7 @@ void nwrap_destructor(void)
                nwrap_pw_global.num = 0;
        }
 
+#if defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM)
        if (nwrap_sp_global.cache != NULL) {
                struct nwrap_cache *c = nwrap_sp_global.cache;
 
@@ -5562,6 +5563,7 @@ void nwrap_destructor(void)
 
                nwrap_sp_global.num = 0;
        }
+#endif /* defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM) */
 
        if (nwrap_he_global.cache != NULL) {
                struct nwrap_cache *c = nwrap_he_global.cache;