]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:util: Remove NIS support from string_match()
authorAndreas Schneider <asn@samba.org>
Tue, 20 Apr 2021 15:53:49 +0000 (17:53 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 22 Apr 2021 17:57:30 +0000 (17:57 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/access.c
lib/util/wscript_build

index e02117fa23e22e28413ae31272e9906334d7cba8..5b53894b2cec08ebca901b6947dd3b26ff67b905 100644 (file)
 #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 */
index 460661e9a634e7362bda1627fd0da85084cc3520..2a99e212c5cd23d0acaff0a9c58e43f924c5bc11 100644 (file)
@@ -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',