s3:passdb/pdb_tdb add parameter to control handling of BUILTIN
authorChristian Ambach <ambi@samba.org>
Mon, 27 May 2013 12:48:27 +0000 (14:48 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 21 Jun 2013 08:44:23 +0000 (10:44 +0200)
with tdbsam:map builtin, one can control if tdbsam should
be used to map entries from BUILTIN or not.
By default, they will be mapped (as in older releases)

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/passdb/pdb_tdb.c

index bd6e123e31cfa13a59806f68f1e4c13c8b029a4a..f256e6c7fb323c2220d409efeed0f903e1427fc8 100644 (file)
@@ -59,6 +59,7 @@ static int tdbsam_debug_level = DBGC_ALL;
 
 static struct db_context *db_sam;
 static char *tdbsam_filename;
+static bool map_builtin;
 
 struct tdbsam_convert_state {
        int32_t from;
@@ -1276,6 +1277,11 @@ static bool tdbsam_search_users(struct pdb_methods *methods,
        return true;
 }
 
+static bool tdbsam_is_responsible_for_builtin(struct pdb_methods *m)
+{
+       return map_builtin;
+}
+
 /*********************************************************************
  Initialize the tdb sam backend.  Setup the dispath table of methods,
  open the tdb, etc...
@@ -1304,6 +1310,10 @@ static NTSTATUS pdb_init_tdbsam(struct pdb_methods **pdb_method, const char *loc
        (*pdb_method)->capabilities = tdbsam_capabilities;
        (*pdb_method)->new_rid = tdbsam_new_rid;
 
+       (*pdb_method)->is_responsible_for_builtin =
+                                       tdbsam_is_responsible_for_builtin;
+       map_builtin = lp_parm_bool(-1, "tdbsam", "map builtin", true);
+
        /* save the path for later */
 
        if (!location) {