From: Stefan Metzmacher Date: Wed, 6 Nov 2019 07:47:31 +0000 (+0100) Subject: s3:util_sec: fix the build on non-linux platforms X-Git-Tag: ldb-2.2.0~1193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c0eed6ba7225fa6b655b3770228d2018fbeb3c4;p=thirdparty%2Fsamba.git s3:util_sec: fix the build on non-linux platforms This fixes a regression introduced by "util_sec.c: Move __thread variable to global scope" (5a80f399b51221fb0b8661f30d940ca24e1ce627). Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c index b6fb6c0a4a1..4c3d3dc7881 100644 --- a/source3/lib/util_sec.c +++ b/source3/lib/util_sec.c @@ -444,17 +444,17 @@ void become_user_permanently(uid_t uid, gid_t gid) assert_gid(gid, gid); } -#ifdef HAVE___THREAD - struct cache_t { +#if defined(HAVE_LINUX_THREAD_CREDENTIALS) && defined(HAVE___THREAD) + struct set_thread_credentials_cache { bool active; uid_t uid; gid_t gid; size_t setlen; uintptr_t gidset; }; - -static __thread struct cache_t cache; +static __thread struct set_thread_credentials_cache cache; #endif + /********************************************************** Function to set thread specific credentials. Leave saved-set uid/gid alone.Must be thread-safe code.