From 620de975f147ac9427b51ea0e1e3eabda443d4b6 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 20 Apr 2021 17:53:49 +0200 Subject: [PATCH] lib:util: Remove NIS support from string_match() Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- lib/util/access.c | 54 ------------------------------------------ lib/util/wscript_build | 2 +- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/lib/util/access.c b/lib/util/access.c index e02117fa23e..5b53894b2ce 100644 --- a/lib/util/access.c +++ b/lib/util/access.c @@ -23,10 +23,6 @@ #include "lib/util/unix_match.h" #include "lib/util/smb_strtox.h" -#if defined(HAVE_NETGROUP) -#include "system/nis.h" -#endif - #define NAME_INDEX 0 #define ADDR_INDEX 1 @@ -118,56 +114,6 @@ static bool string_match(const char *tok,const char *s) && strequal_m(tok, s + str_len - tok_len)) { return true; } - } else if (tok[0] == '@') { /* netgroup: look it up */ -#ifdef HAVE_NETGROUP - DATA_BLOB tmp; - char *mydomain = NULL; - char *hostname = NULL; - bool netgroup_ok = false; - - if (memcache_lookup( - NULL, SINGLETON_CACHE, - data_blob_string_const_null("yp_default_domain"), - &tmp)) { - - SMB_ASSERT(tmp.length > 0); - mydomain = (tmp.data[0] == '\0') - ? NULL : (char *)tmp.data; - } - else { - yp_get_default_domain(&mydomain); - - memcache_add( - NULL, SINGLETON_CACHE, - data_blob_string_const_null("yp_default_domain"), - data_blob_string_const_null(mydomain?mydomain:"")); - } - - if (!mydomain) { - DEBUG(0,("Unable to get default yp domain. " - "Try without it.\n")); - } - if (!(hostname = smb_xstrdup(s))) { - DEBUG(1,("out of memory for strdup!\n")); - return false; - } - - netgroup_ok = innetgr(tok + 1, hostname, (char *) 0, mydomain); - - DBG_INFO("%s %s of domain %s in netgroup %s\n", - netgroup_ok ? "Found" : "Could not find", - hostname, - mydomain?mydomain:"(ANY)", - tok+1); - - SAFE_FREE(hostname); - - if (netgroup_ok) - return true; -#else - DEBUG(0,("access: netgroup support is not configured\n")); - return false; -#endif } else if (strequal_m(tok, "ALL")) { /* all: match any */ return true; } else if (strequal_m(tok, "FAIL")) { /* fail: match any */ diff --git a/lib/util/wscript_build b/lib/util/wscript_build index 460661e9a63..2a99e212c5c 100644 --- a/lib/util/wscript_build +++ b/lib/util/wscript_build @@ -290,7 +290,7 @@ else: bld.SAMBA_SUBSYSTEM('access', source='access.c', - deps='interfaces samba-util tirpc nsl', + deps='interfaces samba-util', local_include=False) bld.SAMBA_SUBSYSTEM('util_str_escape',