From d1d2a03d73b376d54aa6d010e521282746b068fe Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 26 Oct 2023 14:37:29 +0200 Subject: [PATCH] s3:utils: Initialize the memcache for smbpasswd Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Fri Oct 27 06:51:48 UTC 2023 on atb-devel-224 --- source3/utils/smbpasswd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index 950aaff67da..f2c5dfd2b0f 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -27,6 +27,7 @@ #include "passwd_proto.h" #include "lib/util/string_wrappers.h" #include "lib/param/param.h" +#include "lib/util/memcache.h" /* * Next two lines needed for SunOS and don't @@ -620,9 +621,17 @@ int main(int argc, char **argv) { TALLOC_CTX *frame = talloc_stackframe(); struct loadparm_context *lp_ctx = NULL; + struct memcache *mcache = NULL; int local_flags = 0; int ret; + mcache = memcache_init(NULL, 0); + if (mcache == NULL) { + fprintf(stderr, "%s: memcache_init failed\n", __location__); + return 1; + } + memcache_set_global(mcache); + #if defined(HAVE_SET_AUTH_PARAMETERS) set_auth_parameters(argc, argv); #endif /* HAVE_SET_AUTH_PARAMETERS */ -- 2.47.3