Bug 5945 - Out of memory error with Winbind idmap
Out of memory error with Winbind idmap
Status: RESOLVED FIXED
Product: Samba 3.2
Classification: Unclassified
Component: Winbind
3.2.5
Other Windows NT
: P3 normal
: ---
Assigned To: Simo Sorce
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-06 05:07 UTC by Sébastien Prud'homme
Modified: 2009-06-12 07:17 UTC (History)
2 users (show)

See Also:
vl: review+
idra: review+
gd: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sébastien Prud'homme 2008-12-06 05:07:20 UTC
Here is a small patch to prevent an out of memory error when a idmap backend has no parameters on a DC:

--- samba-3.2.4/source/winbindd/idmap.c.rmap    2008-11-29 11:06:49.000000000 +0100
+++ samba-3.2.4/source/winbindd/idmap.c 2008-11-29 11:07:31.000000000 +0100
@@ -555,8 +555,12 @@
                 * set the destructor for this domain */
                talloc_set_destructor(dom, close_domain_destructor);

-               dom->params = talloc_strdup(dom, compat_params);
-               IDMAP_CHECK_ALLOC(dom->params);
+               if (compat_params) {
+                       dom->params = talloc_strdup(dom, compat_params);
+                       IDMAP_CHECK_ALLOC(dom->params);
+               } else {
+                       dom->params = NULL;
+               }

                /* Finally instance a backend copy for this domain */
                ret = dom->methods->init(dom);
Comment 1 Guenther Deschner 2009-06-11 18:22:39 UTC
Karolin, this is apparently the no memory error we had seen lately.
Comment 2 Karolin Seeger 2009-06-12 02:45:34 UTC
Okay, this patch indeed fixes the out of memory message on my box, too.

How to reproduce without the patch:
-editposix setup
-net sam provision does not work with the following Winbind config:
 idmap uid = 10000-20000
 idmap gid = 10000-20000
 idmap backend = tdb
 idmap config DOM:backend = tdb
 idmap config DOM:range = 21000-30000

Can provide a log and the full smb.conf if needed.

Comment 3 Karolin Seeger 2009-06-12 07:03:30 UTC
Simo, sorry, Günther just acked the patch.
Maybe you like to review it nonetheless.
Pushed to v3-2-test. Will be included in 3.2.12.
Closing out bug report.

Thanks for reporting and providing the patch!
Comment 4 Simo Sorce 2009-06-12 07:17:27 UTC
No problems its evident it is good.