summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2011-08-24 10:57:49 +0200
committerKarolin Seeger <kseeger@samba.org>2012-09-21 09:44:44 +0200
commit1d5b8aa6a8c242e6b40e8a984a04bcd76bfdd884 (patch)
tree3a354175ae2753fc521cfe7ccb69eaafec0cc6e3
parent536be09e802db2f93ed02690d219ed6ccec908c3 (diff)
downloadsamba-1d5b8aa6a8c242e6b40e8a984a04bcd76bfdd884.tar.gz
s3:winbindd: make sure we only call static_init_idmap once
this is a backport of 3f14d03adbda03b821210115af4fae044a9b4a3e Fix bug #8402 - winbind log spammed with idmap messages. (cherry picked from commit 04e4325642d029e604c31b371811fafdf2b61cf8)
-rw-r--r--source3/winbindd/idmap.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c
index 7aa2853df10..2414dab224e 100644
--- a/source3/winbindd/idmap.c
+++ b/source3/winbindd/idmap.c
@@ -28,6 +28,21 @@
static_decl_idmap;
+static void idmap_init(void)
+{
+ static bool initialized;
+
+ if (initialized) {
+ return;
+ }
+
+ DEBUG(10, ("idmap_init(): calling static_init_idmap\n"));
+
+ static_init_idmap;
+
+ initialized = true;
+}
+
/**
* Pointer to the backend methods. Modules register themselves here via
* smb_register_idmap.
@@ -346,9 +361,7 @@ static struct idmap_domain *idmap_init_default_domain(TALLOC_CTX *mem_ctx)
char *modulename;
char *params;
- DEBUG(10, ("idmap_init_default_domain: calling static_init_idmap\n"));
-
- static_init_idmap;
+ idmap_init();
if (!parse_idmap_module(talloc_tos(), lp_idmap_backend(), &modulename,
&params)) {
@@ -546,7 +559,7 @@ static NTSTATUS idmap_alloc_init(struct idmap_alloc_context **ctx)
char *modulename, *params;
NTSTATUS ret = NT_STATUS_NO_MEMORY;;
- static_init_idmap;
+ idmap_init();
if (idmap_alloc_ctx != NULL) {
*ctx = idmap_alloc_ctx;