s3:winbindd/autorid add ignore builtin parameter
authorChristian Ambach <ambi@samba.org>
Mon, 7 May 2012 17:14:56 +0000 (19:14 +0200)
committerChristian Ambach <ambi@samba.org>
Tue, 8 May 2012 07:26:07 +0000 (09:26 +0200)
BUILTIN should be handled by passdb, however if passdb does not know
about a SID, autorid creates a range for BUILTIN and does deterministic mapping

make it possible to turn off this behavior

source3/winbindd/idmap_autorid.c

index d3b38bd398bc167abc14caf5cdae4443505a8462..08dcc6595f5b6b26127121e7409b7e0905b5fa3f 100644 (file)
@@ -46,6 +46,7 @@ struct autorid_global_config {
        uint32_t minvalue;
        uint32_t rangesize;
        uint32_t maxranges;
+       bool ignore_builtin;
 };
 
 struct autorid_domain_config {
@@ -492,6 +493,8 @@ static NTSTATUS idmap_autorid_sids_to_unixids(struct idmap_domain *dom,
 
                ZERO_STRUCT(domaincfg);
 
+               DEBUG(10, ("Trying to map %s\n", sid_string_dbg(ids[i]->sid)));
+
                sid_copy(&domainsid, ids[i]->sid);
                if (!sid_split_rid(&domainsid, &rid)) {
                        DEBUG(4, ("Could not determine domain SID from %s, "
@@ -525,6 +528,13 @@ static NTSTATUS idmap_autorid_sids_to_unixids(struct idmap_domain *dom,
                        continue;
                }
 
+               /* BUILTIN is passdb's job */
+               if (dom_sid_equal(&domainsid, &global_sid_Builtin) &&
+                   global->ignore_builtin) {
+                       DEBUG(10, ("Ignoring request for BUILTIN domain\n"));
+                       continue;
+               }
+
                /*
                 * Check if the domain is around
                 */
@@ -869,6 +879,9 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
        DEBUG(5, ("%d domain ranges with a size of %d are available\n",
                  config->maxranges, config->rangesize));
 
+       config->ignore_builtin = lp_parm_bool(-1, "idmap config *",
+                                             "ignore builtin", false);
+
        /* fill the TDB common configuration */
        commonconfig->private_data = config;