From: listout Date: Thu, 14 Jul 2022 13:21:09 +0000 (+0530) Subject: lib/util/access: source3/auth/user_util: Check for INNETGR X-Git-Tag: samba-4.17.0rc1~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb937ddc838043deb82b6a557dce8f29001d0a19;p=thirdparty%2Fsamba.git lib/util/access: source3/auth/user_util: Check for INNETGR 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 Reviewed-by: Andreas Schneider Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Mon Aug 8 07:28:31 UTC 2022 on sn-devel-184 --- diff --git a/lib/util/access.c b/lib/util/access.c index b1b4bffaeaa..f4b5ae79125 100644 --- a/lib/util/access.c +++ b/lib/util/access.c @@ -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; diff --git a/source3/auth/user_util.c b/source3/auth/user_util.c index 805f3ada231..cd97d62af4b 100644 --- a/source3/auth/user_util.c +++ b/source3/auth/user_util.c @@ -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; }