From: Andreas Schneider Date: Thu, 26 Oct 2023 12:37:29 +0000 (+0200) Subject: s3:utils: Initialize the memcache for smbpasswd X-Git-Tag: talloc-2.4.2~975 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1d2a03d73b376d54aa6d010e521282746b068fe;p=thirdparty%2Fsamba.git 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 --- 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 */