static void nwrap_pw_unload(struct nwrap_cache *nwrap);
/* shadow */
+#if defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM)
struct nwrap_sp {
struct nwrap_cache *cache;
static bool nwrap_sp_parse_line(struct nwrap_cache *nwrap, char *line);
static void nwrap_sp_unload(struct nwrap_cache *nwrap);
+#endif /* defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM) */
/* group */
struct nwrap_gr {
nwrap_pw_global.cache->unload = nwrap_pw_unload;
/* shadow */
+#if defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM)
nwrap_sp_global.cache = &__nwrap_cache_sp;
nwrap_sp_global.cache->path = getenv("NSS_WRAPPER_SHADOW");
nwrap_sp_global.cache->private_data = &nwrap_sp_global;
nwrap_sp_global.cache->parse_line = nwrap_sp_parse_line;
nwrap_sp_global.cache->unload = nwrap_sp_unload;
+#endif /* defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM) */
/* group */
nwrap_gr_global.cache = &__nwrap_cache_gr;
return true;
}
+#if defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM)
bool nss_wrapper_shadow_enabled(void)
{
nwrap_init();
return true;
}
+#endif /* defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM) */
bool nss_wrapper_hosts_enabled(void)
{
return 0;
}
+#if defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM)
static bool nwrap_sp_parse_line(struct nwrap_cache *nwrap, char *line)
{
struct nwrap_sp *nwrap_sp;
nwrap_sp->num = 0;
nwrap_sp->idx = 0;
}
+#endif /* defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM) */
/*
* the caller has to call nwrap_unload() on failure
}
/* shadow */
+
+#if defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM)
+
+#ifdef HAVE_SETSPENT
static void nwrap_files_setspent(void)
{
nwrap_sp_global.idx = 0;
{
nwrap_sp_global.idx = 0;
}
+#endif /* HAVE_SETSPENT */
static struct spwd *nwrap_files_getspnam(const char *name)
{
errno = ENOENT;
return NULL;
}
+#endif /* defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM) */
/* misc functions */
static int nwrap_files_initgroups(struct nwrap_backend *b,
* SHADOW
**********************************************************/
+#if defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM)
+
+#ifdef HAVE_SETSPENT
static void nwrap_setspent(void)
{
nwrap_files_setspent();
nwrap_endspent();
}
+#endif /* HAVE_SETSPENT */
static struct spwd *nwrap_getspnam(const char *name)
{
return nwrap_getspnam(name);
}
+#endif /* defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM) */
+
/**********************************************************
* NETDB
**********************************************************/