]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/util/access: source3/auth/user_util: Check for INNETGR
authorlistout <brahmajit.xyz@gmail.com>
Thu, 14 Jul 2022 13:21:09 +0000 (18:51 +0530)
committerVolker Lendecke <vl@samba.org>
Mon, 8 Aug 2022 07:28:31 +0000 (07:28 +0000)
Checking for presence of both netgroup and innetgr. INNETGR is not
defined on libc's such as musl so not checking results in a build error.

Signed-off-by: listout <brahmajit.xyz@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Aug  8 07:28:31 UTC 2022 on sn-devel-184

lib/util/access.c
source3/auth/user_util.c

index b1b4bffaeaafbd417a2b1f14a51bb581370b8081..f4b5ae79125c231dcb14f94c8f7e50d9ef68ea7e 100644 (file)
@@ -115,7 +115,7 @@ static bool string_match(const char *tok,const char *s)
                        return true;
                }
        } else if (tok[0] == '@') { /* netgroup: look it up */
-#ifdef HAVE_NETGROUP
+#if defined(HAVE_NETGROUP) && defined(HAVE_INNETGR)
                DATA_BLOB tmp;
                char *mydomain = NULL;
                char *hostname = NULL;
index 805f3ada23179d577dedff3026fa1d4ff3717fac..cd97d62af4bc2db76ebb56ef757b2d03e635959e 100644 (file)
@@ -135,7 +135,7 @@ static void store_map_in_gencache(TALLOC_CTX *ctx, const char *from, const char
 
 bool user_in_netgroup(TALLOC_CTX *ctx, const char *user, const char *ngname)
 {
-#ifdef HAVE_NETGROUP
+#if defined(HAVE_NETGROUP) && defined(HAVE_INNETGR)
        char nis_domain_buf[256];
        const char *nis_domain = NULL;
        char *lowercase_user = NULL;
@@ -183,7 +183,7 @@ bool user_in_netgroup(TALLOC_CTX *ctx, const char *user, const char *ngname)
                TALLOC_FREE(lowercase_user);
                return true;
        }
-#endif /* HAVE_NETGROUP */
+#endif /* HAVE_NETGROUP and HAVE_INNETGR */
        return false;
 }