s3:loadparm: add new boolean parameter "idmap read only"
authorMichael Adam <obnox@samba.org>
Tue, 1 Jun 2010 13:35:01 +0000 (15:35 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 1 Jun 2010 15:19:48 +0000 (17:19 +0200)
This will be used to be able to put the default idmap config
read only. This can make sense for instance with the tdb2
idmap backend and using the idmap script feature.

source3/include/proto.h
source3/param/loadparm.c

index 69605d8e00c08114d75c2fc7a136ee954dad71ae..ae78914ee13e2cbeb61cf9926cd21fb095254e45 100644 (file)
@@ -3996,6 +3996,7 @@ bool lp_winbind_rpc_only(void);
 bool lp_create_krb5_conf(void);
 int lp_winbind_max_domain_connections(void);
 const char *lp_idmap_backend(void);
+bool lp_idmap_read_only(void);
 int lp_idmap_cache_time(void);
 int lp_idmap_negative_cache_time(void);
 int lp_keepalive(void);
index 5cc8669031c491c0205b1abd8c8debddbdfc27d8..b793f3dd077dd3089da5deb4a46e6c7e0802ac2f 100644 (file)
@@ -203,6 +203,7 @@ struct global {
        bool bCreateKrb5Conf;
        int winbindMaxDomainConnections;
        char *szIdmapBackend;
+       bool bIdmapReadOnly;
        char *szAddShareCommand;
        char *szChangeShareCommand;
        char *szDeleteShareCommand;
@@ -4411,6 +4412,15 @@ static struct parm_struct parm_table[] = {
                .enum_list      = NULL,
                .flags          = FLAG_ADVANCED,
        },
+       {
+               .label          = "idmap read only",
+               .type           = P_BOOL,
+               .p_class        = P_GLOBAL,
+               .ptr            = &Globals.bIdmapReadOnly,
+               .special        = NULL,
+               .enum_list      = NULL,
+               .flags          = FLAG_ADVANCED,
+       },
        {
                .label          = "idmap cache time",
                .type           = P_INTEGER,
@@ -5125,6 +5135,7 @@ static void init_globals(bool first_time_only)
 
        Globals.bAllowTrustedDomains = True;
        string_set(&Globals.szIdmapBackend, "tdb");
+       Globals.bIdmapReadOnly = false;
 
        string_set(&Globals.szTemplateShell, "/bin/false");
        string_set(&Globals.szTemplateHomedir, "/home/%D/%U");
@@ -5422,6 +5433,7 @@ FN_GLOBAL_INTEGER(lp_winbind_max_domain_connections,
                  &Globals.winbindMaxDomainConnections)
 
 FN_GLOBAL_CONST_STRING(lp_idmap_backend, &Globals.szIdmapBackend)
+FN_GLOBAL_BOOL(lp_idmap_read_only, &Globals.bIdmapReadOnly)
 FN_GLOBAL_INTEGER(lp_idmap_cache_time, &Globals.iIdmapCacheTime)
 FN_GLOBAL_INTEGER(lp_idmap_negative_cache_time, &Globals.iIdmapNegativeCacheTime)
 FN_GLOBAL_INTEGER(lp_keepalive, &Globals.iKeepalive)