[PR PATCH] [Closed]: Fix samba_dlz when named "reloads".

github at samba.org github at samba.org
Thu Dec 20 17:39:19 UTC 2018

There's a closed pull request on the Samba Samba Github repository

Fix samba_dlz when named "reloads".
Description: Please see https://bugzilla.samba.org/show_bug.cgi?id=13214
Using a singleton instance makes samba_dlz break when named does a "reload".  Remove the singleton management and allow named to initialize a new samba_dlz_state, and destroy the old on reload.

bind does a "reload" of a dlz module by:

1.  Creating a new dlz instance state via dlz_create()
2.  Initializing it with dlz_configure()
3.  Deleting the old instance state via dlz_destroy().

Using a singleton instance would cause samba_dlz to fail after a reload.  I don't know the precise reason, here are two possibles:

- dlz_configure() on an already running instance would break it somehow.
- Returning the **same** pointer from dlz_create() as the one already running may confuse the internal bookkeeping in **bind**.  Notice how a new instance is created _before_ the old is destroyed.

Note:  This effectively undoes https://github.com/samba-team/samba/commit/34eab45cba6989b66d37c7eb74d97846014ec4eb

The issues with "state->samdb" went away with talloc 2.0.  state->samdb is already a talloc_reference() from the old 'state', and a talloc_free(state) will decrement the refcount.

More information about the samba-technical mailing list