rid backend seems to be initialized twice?

Dmitry Butskoy buc at odusz.so-cdu.ru
Thu Oct 11 12:38:36 GMT 2007


Dmitry Butskoy wrote:
> I use "rid" idmap backend under samba-3.0.26a, and have following (log 
> level 2) in /var/log/samba/log.winbindd-idmap:
>
>> [2007/10/09 21:30:07, 1] nsswitch/idmap.c:idmap_init(365)
>>   Initializing idmap domains
>> [2007/10/09 21:30:07, 2] lib/module.c:do_smb_load_module(64)
>>   Module '/usr/lib/samba/idmap/rid.so' loaded
>> [2007/10/09 21:30:07, 2] lib/module.c:do_smb_load_module(64)
>>   Module '/usr/lib/samba/idmap/rid.so' loaded
>> [2007/10/09 21:30:07, 0] nsswitch/idmap.c:smb_register_idmap(146)
>>   Idmap module rid already registered!
>> [2007/10/09 21:30:07, 0] lib/module.c:do_smb_load_module(69)
>>   Module '/usr/lib/samba/idmap/rid.so' initialization failed: 
>> NT_STATUS_OBJECT_NAME_COLLISION
>> [2007/10/09 21:30:07, 2] nsswitch/idmap.c:idmap_init(694)
>>   idmap_init: Unable to get methods for alloc backend rid

Well,
It is clear for me now.

Consider fragment in "nsswitch/idmap.c:idmap_init()" :

>
>     /* Initialize alloc module */
>
>     DEBUG(3, ("Initializing idmap alloc module\n"));
>
>     alloc_backend = NULL;
>     if (compat) {
yes, as I use "idmap backend" and do not use "idmap domains"
>         alloc_backend = talloc_strdup(idmap_ctx, compat_backend);
allock_backend = "rid" now...
>     } else {
>         char *ab = lp_idmap_alloc_backend();
>
>         if (ab && (ab[0] != '\0')) {
>             alloc_backend = talloc_strdup(idmap_ctx,
>                               lp_idmap_alloc_backend());
>         }
It seems that if (in the new syntax) "idmap allock backend" is not 
speciifyed, it will be NULL. But because I still use old syntax ("idmap 
backend"), the "allock_backend" variable appears to be "rid", not NULL ...
>     }
>
>     if ( alloc_backend ) {
>
>         idmap_alloc_ctx = TALLOC_ZERO_P(idmap_ctx,
>                         struct idmap_alloc_context);
>         IDMAP_CHECK_ALLOC(idmap_alloc_ctx);
>
>         idmap_alloc_ctx->methods = get_alloc_methods(alloc_backends,
>                                  alloc_backend);
still NULL
>         if ( ! idmap_alloc_ctx->methods) {
>             ret = smb_probe_module("idmap", alloc_backend);
Oops... And now "smb_probe_module()" tries to "do_smb_load_module()" of 
rid.so the second time...
>             if (NT_STATUS_IS_OK(ret)) {
>                 idmap_alloc_ctx->methods =
>                     get_alloc_methods(alloc_backends,
>                               alloc_backend);
>             }
>         }
>         if (idmap_alloc_ctx->methods) {
>
>             if (compat_params) {
>                 idmap_alloc_ctx->params =
>                     talloc_strdup(idmap_alloc_ctx,
>                               compat_params);
>                 IDMAP_CHECK_ALLOC(idmap_alloc_ctx->params);
>             } else {
>                 idmap_alloc_ctx->params = NULL;
>             }
>
>             ret = idmap_alloc_ctx->methods->init(idmap_alloc_ctx->params);
>             if ( ! NT_STATUS_IS_OK(ret)) {
>                 DEBUG(0, ("ERROR: Initialization failed for "
>                       "alloc backend %s, deferred!\n",
>                       alloc_backend));
>             } else {
>                 idmap_alloc_ctx->initialized = True;
>             }
>         } else {
>             DEBUG(2, ("idmap_init: Unable to get methods for "
>                   "alloc backend %s\n",
>                   alloc_backend));
>             /* certain compat backends are just readonly */
>             if ( compat ) {
>                 TALLOC_FREE(idmap_alloc_ctx);
>                 ret = NT_STATUS_OK;
>             } else {
>                 ret = NT_STATUS_UNSUCCESSFUL;
>             }
>         }
>     }
[snip]


It seems that it should be:

if (compat)  alloc_backend = NULL;

in the first commented fragment...



~buc



More information about the samba-technical mailing list