s3:utils: Initialize the memcache for smbpasswd
[amitay/samba-autobuild/.git] / source3 / utils / smbpasswd.c
index 950aaff67da1c224d95739f34fd516db75282c29..f2c5dfd2b0ff84c2377330e1a582340f45d9f19f 100644 (file)
@@ -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 */