The branch, master has been updated
       via  cd8dc47 s3:idmap_autorid: fail initialization if the domain is not 
"*"
       via  95d35dd s3:docs: fix the example in the idmap_autorid manpage to 
use "idmap config * : rangesize"
       via  b0b0b62 s3:idmap_autorid: use "idmap config <DOMAIN> : rangesize" 
instead of "autorid:rangesize"
       via  65490ea s3:idmap_autorid: add a talloc_stackframe() to 
idmap_autorid_initialize()
      from  632f672 s4-cldap: fixed the CLDAP response for IPv6 clients

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit cd8dc47bf17d2cdb1558dc6ab49320ba12af8f34
Author: Michael Adam <[email protected]>
Date:   Tue Jun 7 15:53:49 2011 +0200

    s3:idmap_autorid: fail initialization if the domain is not "*"
    
    autorid can only be used as a backend for the default idmap configuration.
    
    Autobuild-User: Michael Adam <[email protected]>
    Autobuild-Date: Tue Jun  7 19:13:18 CEST 2011 on sn-devel-104

commit 95d35dde9cecac120c0a9bcd06957cd3748b15a0
Author: Michael Adam <[email protected]>
Date:   Tue Jun 7 15:21:34 2011 +0200

    s3:docs: fix the example in the idmap_autorid manpage to use "idmap config 
* : rangesize"

commit b0b0b625b588057c8c97371934bf21eb1fd985d8
Author: Michael Adam <[email protected]>
Date:   Tue Jun 7 13:02:04 2011 +0200

    s3:idmap_autorid: use "idmap config <DOMAIN> : rangesize" instead of 
"autorid:rangesize"

commit 65490ea4e67bf82cf8fb0b8e4e74047c3f63c509
Author: Michael Adam <[email protected]>
Date:   Tue Jun 7 15:16:24 2011 +0200

    s3:idmap_autorid: add a talloc_stackframe() to idmap_autorid_initialize()

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages-3/idmap_autorid.8.xml |    2 +-
 source3/winbindd/idmap_autorid.c        |   29 +++++++++++++++++++++++------
 2 files changed, 24 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/idmap_autorid.8.xml 
b/docs-xml/manpages-3/idmap_autorid.8.xml
index ac66384..b5a9bde 100644
--- a/docs-xml/manpages-3/idmap_autorid.8.xml
+++ b/docs-xml/manpages-3/idmap_autorid.8.xml
@@ -109,7 +109,7 @@
 
        idmap config * : backend = autorid
        idmap config * : range = 1000000-19999999
-       autorid:rangesize = 1000000
+       idmap config * : rangesize = 1000000
 
        idmap config TRUSTED : backend  = ad
        idmap config TRUSTED : range    = 50000 - 99999
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c
index 1f4af33..80d8ed1 100644
--- a/source3/winbindd/idmap_autorid.c
+++ b/source3/winbindd/idmap_autorid.c
@@ -435,11 +435,22 @@ static NTSTATUS idmap_autorid_initialize(struct 
idmap_domain *dom)
        struct autorid_global_config *storedconfig = NULL;
        NTSTATUS status;
        uint32_t hwm;
+       TALLOC_CTX *frame = talloc_stackframe();
+       char *config_option = NULL;
 
-       config = TALLOC_ZERO_P(dom, struct autorid_global_config);
+       if (!strequal(dom->name, "*")) {
+               DEBUG(0, ("idmap_autorid_initialize: Error: autorid configured "
+                         "for domain '%s'. But autorid can only be used for "
+                         "the default idmap configuration.\n", dom->name));
+               status = NT_STATUS_INVALID_PARAMETER;
+               goto error;
+       }
+
+       config = TALLOC_ZERO_P(frame, struct autorid_global_config);
        if (!config) {
                DEBUG(0, ("Out of memory!\n"));
-               return NT_STATUS_NO_MEMORY;
+               status = NT_STATUS_NO_MEMORY;
+               goto error;
        }
 
        status = idmap_autorid_db_init();
@@ -447,8 +458,15 @@ static NTSTATUS idmap_autorid_initialize(struct 
idmap_domain *dom)
                goto error;
        }
 
+       config_option = talloc_asprintf(frame, "idmap config %s", dom->name);
+       if (config_option == NULL) {
+               DEBUG(0, ("Out of memory!\n"));
+               status = NT_STATUS_NO_MEMORY;
+               goto error;
+       }
+
        config->minvalue = dom->low_id;
-       config->rangesize = lp_parm_int(-1, "autorid", "rangesize", 100000);
+       config->rangesize = lp_parm_int(-1, config_option, "rangesize", 100000);
 
        if (config->rangesize < 2000) {
                DEBUG(1, ("autorid rangesize must be at least 2000\n"));
@@ -480,7 +498,7 @@ static NTSTATUS idmap_autorid_initialize(struct 
idmap_domain *dom)
                   config->minvalue, config->rangesize, config->maxranges));
 
        /* read previously stored config and current HWM */
-       storedconfig = idmap_autorid_loadconfig(talloc_tos());
+       storedconfig = idmap_autorid_loadconfig(frame);
 
        if (!dbwrap_fetch_uint32(autorid_db, HWM, &hwm)) {
                DEBUG(1, ("Fatal error while fetching current "
@@ -530,8 +548,7 @@ static NTSTATUS idmap_autorid_initialize(struct 
idmap_domain *dom)
        return NT_STATUS_OK;
 
       error:
-       talloc_free(config);
-       talloc_free(storedconfig);
+       talloc_free(frame);
 
        return status;
 }


-- 
Samba Shared Repository

Reply via email to