[PART2] [PATCHES] some cleanup to loadparm

Michael Adam obnox at samba.org
Wed Jul 22 21:56:21 UTC 2015


On 2015-07-22 at 22:06 +0200, Michael Adam wrote:
> On 2015-07-22 at 15:56 -0400, Ira Cooper wrote:
> > commit 87e2a4925a58db159452b3d9959cc36ecd24e202
> > Author: Michael Adam <obnox at samba.org>
> > Date:   Mon Jun 15 23:45:45 2015 +0200
> > 
> >     param: rename szLdapGroupSuffix -> _ldap_group_suffix
> > 
> >     Signed-off-by: Michael Adam <obnox at samba.org>
> > 
> > Does not compile.
> > 
> > [1321/4027] Compiling lib/param/util.c
> > [1322/4027] Compiling lib/param/param_table.c
> > [1323/4027] Compiling default/python/samba_python.empty.c
> > ../lib/param/param_table.c:2821:13: error: ‘struct loadparm_global’ has no
> > member named ‘_ldap_group_suffix’
> >    .offset  = GLOBAL_VAR(_ldap_group_suffix),
> >              ^
> > [1324/4027] Compiling python/modules.c
> > Waf: Leaving directory `/home/ira/samba/obnox/bin'
> > Build failed:  -> task failed (err #1):
> >     {task: cc param_table.c -> param_table_8.o}
> > Makefile:8: recipe for target 'all' failed
> > make: *** [all] Error 1
> > ira at ira-t430:~/samba/obnox
> > [/dev/pts/1](240/2)$ git log
> > commit 87e2a4925a58db159452b3d9959cc36ecd24e202
> > Author: Michael Adam <obnox at samba.org>
> > Date:   Mon Jun 15 23:45:45 2015 +0200
> > 
> >     param: rename szLdapGroupSuffix -> _ldap_group_suffix
> > 
> >     Signed-off-by: Michael Adam <obnox at samba.org>
> > 
> > 
> > ----
> > 
> > (Compile done on Fedora 22.)
> > 
> > I suspect that the other commits in the same pattern won't compile.
> 
> Gosh that is a rebase-artefact.
> The following patch amends that but
> that was actually supposed to be in
> the first patch.
> 
> Sorry for the inconvenience, I did not
> compile each patch after rebasing.
> 
> Will send an updated patch shortly.

Updated patchset attached.
This time I made sure each commit compiles. :)

In fact, the broken ones were only the four
rename szLdap${FOO}Suffix ones.

Cheers - Michael
-------------- next part --------------
From d5e6dc2281d02feee588752b9f46e2e25a0fe3c4 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Mon, 15 Jun 2015 23:45:45 +0200
Subject: [PATCH 01/39] param: rename szLdapGroupSuffix -> _ldap_group_suffix

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index c762259..4efcd1b 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -257,7 +257,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	char *szLdapMachineSuffix;					\
 	char *szLdapUserSuffix;						\
 	char *szLdapIdmapSuffix;					\
-	char *szLdapGroupSuffix;					\
+	char *_ldap_group_suffix;					\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;						\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 3a0247c..f73ef03 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -2818,7 +2818,7 @@ struct parm_struct parm_table[] = {
 		.label		= "ldap group suffix",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szLdapGroupSuffix),
+		.offset		= GLOBAL_VAR(_ldap_group_suffix),
 		.special	= NULL,
 		.enum_list	= NULL,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index beba137..07981a1 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -727,7 +727,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	string_set(Globals.ctx, &Globals.ldap_suffix, "");
 	string_set(Globals.ctx, &Globals.szLdapMachineSuffix, "");
 	string_set(Globals.ctx, &Globals.szLdapUserSuffix, "");
-	string_set(Globals.ctx, &Globals.szLdapGroupSuffix, "");
+	string_set(Globals.ctx, &Globals._ldap_group_suffix, "");
 	string_set(Globals.ctx, &Globals.szLdapIdmapSuffix, "");
 
 	string_set(Globals.ctx, &Globals.ldap_admin_dn, "");
@@ -2377,8 +2377,8 @@ const char *lp_ldap_user_suffix(TALLOC_CTX *ctx)
 
 const char *lp_ldap_group_suffix(TALLOC_CTX *ctx)
 {
-	if (Globals.szLdapGroupSuffix[0])
-		return append_ldap_suffix(ctx, Globals.szLdapGroupSuffix);
+	if (Globals._ldap_group_suffix[0])
+		return append_ldap_suffix(ctx, Globals._ldap_group_suffix);
 
 	return lp_string(ctx, Globals.ldap_suffix);
 }
-- 
2.4.3


From 432c1554b99109e9bad858283fabe5c593b0d282 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Mon, 15 Jun 2015 23:47:37 +0200
Subject: [PATCH 02/39] param: turn ldap group suffix into a generated function

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/ldap/ldapgroupsuffix.xml | 2 +-
 lib/param/loadparm.h                         | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/docs-xml/smbdotconf/ldap/ldapgroupsuffix.xml b/docs-xml/smbdotconf/ldap/ldapgroupsuffix.xml
index f80a069..7de0fac 100644
--- a/docs-xml/smbdotconf/ldap/ldapgroupsuffix.xml
+++ b/docs-xml/smbdotconf/ldap/ldapgroupsuffix.xml
@@ -1,7 +1,7 @@
 <samba:parameter name="ldap group suffix"
                  context="G"
                  type="string"
-                 generated_function="0"
+                 function="_ldap_group_suffix"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 	<para>This parameter specifies the suffix that is 
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 4efcd1b..85afb08 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -257,7 +257,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	char *szLdapMachineSuffix;					\
 	char *szLdapUserSuffix;						\
 	char *szLdapIdmapSuffix;					\
-	char *_ldap_group_suffix;					\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;						\
-- 
2.4.3


From 562a346696430ba7c770d64565f72ba371e6cf2f Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Mon, 15 Jun 2015 23:58:35 +0200
Subject: [PATCH 03/39] param: rename szLdapUserSuffix -> _ldap_user_suffix

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 85afb08..e111040 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -255,7 +255,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	int CupsEncrypt;						\
 	int  iPreferredMaster;						\
 	char *szLdapMachineSuffix;					\
-	char *szLdapUserSuffix;						\
+	char *_ldap_user_suffix;					\
 	char *szLdapIdmapSuffix;					\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index f73ef03..54a70ca 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -2931,7 +2931,7 @@ struct parm_struct parm_table[] = {
 		.label		= "ldap user suffix",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szLdapUserSuffix),
+		.offset		= GLOBAL_VAR(_ldap_user_suffix),
 		.special	= NULL,
 		.enum_list	= NULL,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 07981a1..ccb5a57 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -726,7 +726,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	string_set(Globals.ctx, &Globals.passdb_backend, "tdbsam");
 	string_set(Globals.ctx, &Globals.ldap_suffix, "");
 	string_set(Globals.ctx, &Globals.szLdapMachineSuffix, "");
-	string_set(Globals.ctx, &Globals.szLdapUserSuffix, "");
+	string_set(Globals.ctx, &Globals._ldap_user_suffix, "");
 	string_set(Globals.ctx, &Globals._ldap_group_suffix, "");
 	string_set(Globals.ctx, &Globals.szLdapIdmapSuffix, "");
 
@@ -2369,8 +2369,8 @@ const char *lp_ldap_machine_suffix(TALLOC_CTX *ctx)
 
 const char *lp_ldap_user_suffix(TALLOC_CTX *ctx)
 {
-	if (Globals.szLdapUserSuffix[0])
-		return append_ldap_suffix(ctx, Globals.szLdapUserSuffix);
+	if (Globals._ldap_user_suffix[0])
+		return append_ldap_suffix(ctx, Globals._ldap_user_suffix);
 
 	return lp_string(ctx, Globals.ldap_suffix);
 }
-- 
2.4.3


From 6cdf1f1f7663102c90cfd484ddaa8d546ae59dd5 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 16 Jun 2015 00:00:44 +0200
Subject: [PATCH 04/39] param: turn ldap user suffix into a generated function

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/ldap/ldapusersuffix.xml | 2 +-
 lib/param/loadparm.h                        | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/docs-xml/smbdotconf/ldap/ldapusersuffix.xml b/docs-xml/smbdotconf/ldap/ldapusersuffix.xml
index f0f1c37..8e6b8a3 100644
--- a/docs-xml/smbdotconf/ldap/ldapusersuffix.xml
+++ b/docs-xml/smbdotconf/ldap/ldapusersuffix.xml
@@ -1,7 +1,7 @@
 <samba:parameter name="ldap user suffix"
                  context="G"
                  type="string"
-                 generated_function="0"
+                 function="_ldap_user_suffix"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 	<para>
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index e111040..9b4d47b 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -255,7 +255,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	int CupsEncrypt;						\
 	int  iPreferredMaster;						\
 	char *szLdapMachineSuffix;					\
-	char *_ldap_user_suffix;					\
 	char *szLdapIdmapSuffix;					\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
-- 
2.4.3


From 9f35490736eaa6ba550b4520611ff40f0b9940d9 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 16 Jun 2015 00:04:53 +0200
Subject: [PATCH 05/39] param: rename szLdapIdmapSuffix ->
 _ldap_sz_idmap_suffix

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 9b4d47b..eff7e23 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -255,7 +255,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	int CupsEncrypt;						\
 	int  iPreferredMaster;						\
 	char *szLdapMachineSuffix;					\
-	char *szLdapIdmapSuffix;					\
+	char *_ldap_idmap_suffix;					\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;						\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 54a70ca..f4adbd3 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -2826,7 +2826,7 @@ struct parm_struct parm_table[] = {
 		.label		= "ldap idmap suffix",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szLdapIdmapSuffix),
+		.offset		= GLOBAL_VAR(_ldap_idmap_suffix),
 		.special	= NULL,
 		.enum_list	= NULL,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index ccb5a57..f43be58 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -728,7 +728,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	string_set(Globals.ctx, &Globals.szLdapMachineSuffix, "");
 	string_set(Globals.ctx, &Globals._ldap_user_suffix, "");
 	string_set(Globals.ctx, &Globals._ldap_group_suffix, "");
-	string_set(Globals.ctx, &Globals.szLdapIdmapSuffix, "");
+	string_set(Globals.ctx, &Globals._ldap_idmap_suffix, "");
 
 	string_set(Globals.ctx, &Globals.ldap_admin_dn, "");
 	Globals.ldap_ssl = LDAP_SSL_START_TLS;
@@ -2385,8 +2385,8 @@ const char *lp_ldap_group_suffix(TALLOC_CTX *ctx)
 
 const char *lp_ldap_idmap_suffix(TALLOC_CTX *ctx)
 {
-	if (Globals.szLdapIdmapSuffix[0])
-		return append_ldap_suffix(ctx, Globals.szLdapIdmapSuffix);
+	if (Globals._ldap_idmap_suffix[0])
+		return append_ldap_suffix(ctx, Globals._ldap_idmap_suffix);
 
 	return lp_string(ctx, Globals.ldap_suffix);
 }
-- 
2.4.3


From e1ca6532574120686c603b78d6c9ef92ee67d7da Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 16 Jun 2015 00:06:59 +0200
Subject: [PATCH 06/39] param: turn ldap idmap suffix into a generated function

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/ldap/ldapidmapsuffix.xml | 2 +-
 lib/param/loadparm.h                         | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/docs-xml/smbdotconf/ldap/ldapidmapsuffix.xml b/docs-xml/smbdotconf/ldap/ldapidmapsuffix.xml
index 3897c9e..1fe7e8a 100644
--- a/docs-xml/smbdotconf/ldap/ldapidmapsuffix.xml
+++ b/docs-xml/smbdotconf/ldap/ldapidmapsuffix.xml
@@ -1,7 +1,7 @@
 <samba:parameter name="ldap idmap suffix"
                  context="G"
                  type="string"
-                 generated_function="0"
+                 function="_ldap_idmap_suffix"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 	<para>
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index eff7e23..352b90b 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -255,7 +255,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	int CupsEncrypt;						\
 	int  iPreferredMaster;						\
 	char *szLdapMachineSuffix;					\
-	char *_ldap_idmap_suffix;					\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;						\
-- 
2.4.3


From 6b0dfd692fa9f09ebca795b7575fa16e0d61e53c Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 16 Jun 2015 00:12:51 +0200
Subject: [PATCH 07/39] param: rename szLdapMachineSuffix ->
 _ldap_machine_suffix

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 352b90b..ff9c8a8 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -254,7 +254,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	char *szPrintcapname;						\
 	int CupsEncrypt;						\
 	int  iPreferredMaster;						\
-	char *szLdapMachineSuffix;					\
+	char *_ldap_machine_suffix;					\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;						\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index f4adbd3..986def5 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -2834,7 +2834,7 @@ struct parm_struct parm_table[] = {
 		.label		= "ldap machine suffix",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szLdapMachineSuffix),
+		.offset		= GLOBAL_VAR(_ldap_machine_suffix),
 		.special	= NULL,
 		.enum_list	= NULL,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index f43be58..0f645b6 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -725,7 +725,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 
 	string_set(Globals.ctx, &Globals.passdb_backend, "tdbsam");
 	string_set(Globals.ctx, &Globals.ldap_suffix, "");
-	string_set(Globals.ctx, &Globals.szLdapMachineSuffix, "");
+	string_set(Globals.ctx, &Globals._ldap_machine_suffix, "");
 	string_set(Globals.ctx, &Globals._ldap_user_suffix, "");
 	string_set(Globals.ctx, &Globals._ldap_group_suffix, "");
 	string_set(Globals.ctx, &Globals._ldap_idmap_suffix, "");
@@ -2361,8 +2361,8 @@ static const char *append_ldap_suffix(TALLOC_CTX *ctx, const char *str )
 
 const char *lp_ldap_machine_suffix(TALLOC_CTX *ctx)
 {
-	if (Globals.szLdapMachineSuffix[0])
-		return append_ldap_suffix(ctx, Globals.szLdapMachineSuffix);
+	if (Globals._ldap_machine_suffix[0])
+		return append_ldap_suffix(ctx, Globals._ldap_machine_suffix);
 
 	return lp_string(ctx, Globals.ldap_suffix);
 }
-- 
2.4.3


From 3f71491a20c1669bf9497d749499db1045d77ad6 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 16 Jun 2015 00:15:23 +0200
Subject: [PATCH 08/39] param: turn ldap idmap suffix into a generated function

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/ldap/ldapmachinesuffix.xml | 2 +-
 lib/param/loadparm.h                           | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/docs-xml/smbdotconf/ldap/ldapmachinesuffix.xml b/docs-xml/smbdotconf/ldap/ldapmachinesuffix.xml
index 5651c63..e82675b 100644
--- a/docs-xml/smbdotconf/ldap/ldapmachinesuffix.xml
+++ b/docs-xml/smbdotconf/ldap/ldapmachinesuffix.xml
@@ -1,7 +1,7 @@
 <samba:parameter name="ldap machine suffix"
                  context="G"
                  type="string"
-                 generated_function="0"
+                 function="_ldap_machine_suffix"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 
 <description>
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index ff9c8a8..f7f9a71 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -254,7 +254,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	char *szPrintcapname;						\
 	int CupsEncrypt;						\
 	int  iPreferredMaster;						\
-	char *_ldap_machine_suffix;					\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;						\
-- 
2.4.3


From 0ade66934f1b94b0f98b7dc4df69ecaad1fc5e11 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 12:00:18 +0200
Subject: [PATCH 09/39] param: rename variable of 'max print jobs' to default.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.c     | 4 ++--
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 3d96bff..fe67f75 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2372,7 +2372,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 	lp_ctx->sDefault = talloc_zero(lp_ctx, struct loadparm_service);
 	lp_ctx->flags = talloc_zero_array(lp_ctx, unsigned int, num_parameters());
 
-	lp_ctx->sDefault->iMaxPrintJobs = 1000;
+	lp_ctx->sDefault->max_print_jobs = 1000;
 	lp_ctx->sDefault->bAvailable = true;
 	lp_ctx->sDefault->browseable = true;
 	lp_ctx->sDefault->read_only = true;
@@ -3089,7 +3089,7 @@ const char *lpcfg_printername(struct loadparm_service *service, struct loadparm_
  */
 int lpcfg_maxprintjobs(struct loadparm_service *service, struct loadparm_service *sDefault)
 {
-	int maxjobs = (service != NULL) ? service->iMaxPrintJobs : sDefault->iMaxPrintJobs;
+	int maxjobs = (service != NULL) ? service->max_print_jobs : sDefault->max_print_jobs;
 	if (maxjobs <= 0 || maxjobs >= PRINT_MAX_JOBID)
 		maxjobs = PRINT_MAX_JOBID - 1;
 
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index f7f9a71..2aca895 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -235,7 +235,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	bool valid;						        \
 	int usershare;							\
 	struct timespec usershare_last_mod;				\
-	int iMaxPrintJobs;						\
+	int max_print_jobs;						\
 	char *szCopy;							\
 	char *szService;						\
 	char *szInclude;						\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 986def5..a6a96d4 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -1893,7 +1893,7 @@ struct parm_struct parm_table[] = {
 		.label		= "max print jobs",
 		.type		= P_INTEGER,
 		.p_class	= P_LOCAL,
-		.offset		= LOCAL_VAR(iMaxPrintJobs),
+		.offset		= LOCAL_VAR(max_print_jobs),
 		.special	= NULL,
 		.enum_list	= NULL,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 0f645b6..7c1abde 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -158,7 +158,7 @@ static struct loadparm_service sDefault =
 	.aio_write_behind = NULL,
 	.dfree_command = NULL,
 	.min_print_space = 0,
-	.iMaxPrintJobs = 1000,
+	.max_print_jobs = 1000,
 	.max_reported_print_jobs = 0,
 	.write_cache_size = 0,
 	.create_mask = 0744,
@@ -4143,7 +4143,7 @@ void lp_set_logfile(const char *name)
 
 int lp_maxprintjobs(int snum)
 {
-	int maxjobs = LP_SNUM_OK(snum) ? ServicePtrs[snum]->iMaxPrintJobs : sDefault.iMaxPrintJobs;
+	int maxjobs = LP_SNUM_OK(snum) ? ServicePtrs[snum]->max_print_jobs : sDefault.max_print_jobs;
 	if (maxjobs <= 0 || maxjobs >= PRINT_MAX_JOBID)
 		maxjobs = PRINT_MAX_JOBID - 1;
 
-- 
2.4.3


From 39f4643b77f5c46c7331e24c6db4dd8ea39454cf Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 12:22:02 +0200
Subject: [PATCH 10/39] param: generate lp[cfg]_max_print_jobs()

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/printing/maxprintjobs.xml | 1 -
 lib/param/loadparm.h                          | 1 -
 2 files changed, 2 deletions(-)

diff --git a/docs-xml/smbdotconf/printing/maxprintjobs.xml b/docs-xml/smbdotconf/printing/maxprintjobs.xml
index 8ca8c90..f37ff0a 100644
--- a/docs-xml/smbdotconf/printing/maxprintjobs.xml
+++ b/docs-xml/smbdotconf/printing/maxprintjobs.xml
@@ -1,7 +1,6 @@
 <samba:parameter name="max print jobs"
                  context="S"
                  type="integer"
-                 generated_function="0"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
     <para>This parameter limits the maximum number of 
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 2aca895..933931f 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -235,7 +235,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	bool valid;						        \
 	int usershare;							\
 	struct timespec usershare_last_mod;				\
-	int max_print_jobs;						\
 	char *szCopy;							\
 	char *szService;						\
 	char *szInclude;						\
-- 
2.4.3


From 0e23ca8d8b57caf045ce820dda0d5ae9d0c89b08 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 12:29:54 +0200
Subject: [PATCH 11/39] param: use lp[cfg]_max_print_jobs() in
 lp[cfg]_maxprintjobs()

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.c     | 3 ++-
 source3/param/loadparm.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index fe67f75..7c44093 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -3089,7 +3089,8 @@ const char *lpcfg_printername(struct loadparm_service *service, struct loadparm_
  */
 int lpcfg_maxprintjobs(struct loadparm_service *service, struct loadparm_service *sDefault)
 {
-	int maxjobs = (service != NULL) ? service->max_print_jobs : sDefault->max_print_jobs;
+	int maxjobs = lpcfg_max_print_jobs(service, sDefault);
+
 	if (maxjobs <= 0 || maxjobs >= PRINT_MAX_JOBID)
 		maxjobs = PRINT_MAX_JOBID - 1;
 
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 7c1abde..28dba05 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4143,7 +4143,8 @@ void lp_set_logfile(const char *name)
 
 int lp_maxprintjobs(int snum)
 {
-	int maxjobs = LP_SNUM_OK(snum) ? ServicePtrs[snum]->max_print_jobs : sDefault.max_print_jobs;
+	int maxjobs = lp_max_print_jobs(snum);
+
 	if (maxjobs <= 0 || maxjobs >= PRINT_MAX_JOBID)
 		maxjobs = PRINT_MAX_JOBID - 1;
 
-- 
2.4.3


From f548605e051b2fe6f0ec5d3a69665f94ac7ede26 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 14:07:25 +0200
Subject: [PATCH 12/39] param: rename iPreferredMaster -> _preferred_master

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 4 ++--
 source3/param/loadparm.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 933931f..c49d131 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -252,7 +252,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	int iminreceivefile;						\
 	char *szPrintcapname;						\
 	int CupsEncrypt;						\
-	int  iPreferredMaster;						\
+	int  _preferred_master;						\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;						\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index a6a96d4..4edd167 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -2576,7 +2576,7 @@ struct parm_struct parm_table[] = {
 		.label		= "preferred master",
 		.type		= P_ENUM,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(iPreferredMaster),
+		.offset		= GLOBAL_VAR(_preferred_master),
 		.special	= NULL,
 		.enum_list	= enum_bool_auto,
 	},
@@ -2584,7 +2584,7 @@ struct parm_struct parm_table[] = {
 		.label		= "prefered master",
 		.type		= P_ENUM,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(iPreferredMaster),
+		.offset		= GLOBAL_VAR(_preferred_master),
 		.special	= NULL,
 		.enum_list	= enum_bool_auto,
 		.flags		= FLAG_SYNONYM,
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 28dba05..8c724bc 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -876,7 +876,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 
 	string_set(Globals.ctx, &Globals.share_backend, "classic");
 
-	Globals.iPreferredMaster = Auto;
+	Globals._preferred_master = Auto;
 
 	Globals.allow_dns_updates = DNS_UPDATE_SIGNED;
 
@@ -4101,10 +4101,10 @@ static bool lp_domain_master_true_or_auto(void)
 
 bool lp_preferred_master(void)
 {
-	if (Globals.iPreferredMaster == Auto)
+	if (Globals._preferred_master == Auto)
 		return (lp_local_master() && lp_domain_master());
 
-	return (bool)Globals.iPreferredMaster;
+	return (bool)Globals._preferred_master;
 }
 
 /*******************************************************************
-- 
2.4.3


From cec0258d45696c3b8177ae251643205edb928673 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 14:09:35 +0200
Subject: [PATCH 13/39] param: turn 'preferred master' into a generated
 function

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/browse/preferredmaster.xml | 2 +-
 lib/param/loadparm.h                           | 1 -
 source3/param/loadparm.c                       | 6 ++++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/docs-xml/smbdotconf/browse/preferredmaster.xml b/docs-xml/smbdotconf/browse/preferredmaster.xml
index 0392564..15ebd24 100644
--- a/docs-xml/smbdotconf/browse/preferredmaster.xml
+++ b/docs-xml/smbdotconf/browse/preferredmaster.xml
@@ -2,7 +2,7 @@
                  context="G"
                  type="enum"
                  enumlist="enum_bool_auto"
-                 generated_function="0"
+                 function="_preferred_master"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <synonym>prefered master</synonym>
  <description>
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index c49d131..4ed332c 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -252,7 +252,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	int iminreceivefile;						\
 	char *szPrintcapname;						\
 	int CupsEncrypt;						\
-	int  _preferred_master;						\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;						\
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 8c724bc..ad2305a 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4101,10 +4101,12 @@ static bool lp_domain_master_true_or_auto(void)
 
 bool lp_preferred_master(void)
 {
-	if (Globals._preferred_master == Auto)
+	int preferred_master = lp__preferred_master();
+
+	if (preferred_master == Auto)
 		return (lp_local_master() && lp_domain_master());
 
-	return (bool)Globals._preferred_master;
+	return (bool)preferred_master;
 }
 
 /*******************************************************************
-- 
2.4.3


From a7d7f2dcd752ab87cd66bc2cd689feded34d0f24 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 14:21:26 +0200
Subject: [PATCH 14/39] param: rename iminreceivefile -> min_receivefile_size

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 4ed332c..1911352 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -249,7 +249,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define LOADPARM_EXTRA_GLOBALS \
 	struct parmlist_entry *param_opt;				\
 	char *realm_original;						\
-	int iminreceivefile;						\
+	int min_receivefile_size;					\
 	char *szPrintcapname;						\
 	int CupsEncrypt;						\
 	char *szIdmapUID;						\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 4edd167..02f6e56 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -1314,7 +1314,7 @@ struct parm_struct parm_table[] = {
 		.label		= "min receivefile size",
 		.type		= P_BYTES,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(iminreceivefile),
+		.offset		= GLOBAL_VAR(min_receivefile_size),
 		.special	= NULL,
 		.enum_list	= NULL,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index ad2305a..339ab8a 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -850,7 +850,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	/* By default no shares out of the registry */
 	Globals.registry_shares = false;
 
-	Globals.iminreceivefile = 0;
+	Globals.min_receivefile_size = 0;
 
 	Globals.map_untrusted_to_domain = false;
 	Globals.multicast_dns_register = true;
@@ -4287,10 +4287,10 @@ void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val)
 
 int lp_min_receive_file_size(void)
 {
-	if (Globals.iminreceivefile < 0) {
+	if (Globals.min_receivefile_size < 0) {
 		return 0;
 	}
-	return Globals.iminreceivefile;
+	return Globals.min_receivefile_size;
 }
 
 /*******************************************************************
-- 
2.4.3


From b6d12b5eea869b502f76c088701d103d59136577 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 14:23:47 +0200
Subject: [PATCH 15/39] param: turn 'min receivefile size' into a generated
 function

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/protocol/minreceivefilesize.xml | 1 -
 lib/param/loadparm.h                                | 1 -
 source3/param/loadparm.c                            | 6 ++++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/docs-xml/smbdotconf/protocol/minreceivefilesize.xml b/docs-xml/smbdotconf/protocol/minreceivefilesize.xml
index c5fed6a..60d48ac 100644
--- a/docs-xml/smbdotconf/protocol/minreceivefilesize.xml
+++ b/docs-xml/smbdotconf/protocol/minreceivefilesize.xml
@@ -1,7 +1,6 @@
 <samba:parameter name="min receivefile size"
                  type="integer"
                  context="G"
-                 generated_function="0"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 <para>This option changes the behavior of <citerefentry><refentrytitle>smbd</refentrytitle>
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 1911352..2c40563 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -249,7 +249,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define LOADPARM_EXTRA_GLOBALS \
 	struct parmlist_entry *param_opt;				\
 	char *realm_original;						\
-	int min_receivefile_size;					\
 	char *szPrintcapname;						\
 	int CupsEncrypt;						\
 	char *szIdmapUID;						\
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 339ab8a..d19e144 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4287,10 +4287,12 @@ void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val)
 
 int lp_min_receive_file_size(void)
 {
-	if (Globals.min_receivefile_size < 0) {
+	int min_receivefile_size = lp_min_receivefile_size();
+
+	if (min_receivefile_size < 0) {
 		return 0;
 	}
-	return Globals.min_receivefile_size;
+	return min_receivefile_size;
 }
 
 /*******************************************************************
-- 
2.4.3


From e28d95f6fa6aad1018baad23ec8aa561dcfa2dc3 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 14:31:43 +0200
Subject: [PATCH 16/39] param: rename szPrintcapName -> printcap_name

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 4 ++--
 source3/param/loadparm.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 2c40563..46c683e 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -249,7 +249,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define LOADPARM_EXTRA_GLOBALS \
 	struct parmlist_entry *param_opt;				\
 	char *realm_original;						\
-	char *szPrintcapname;						\
+	char *printcap_name;						\
 	int CupsEncrypt;						\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 02f6e56..f2a737b 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -1917,7 +1917,7 @@ struct parm_struct parm_table[] = {
 		.label		= "printcap name",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szPrintcapname),
+		.offset		= GLOBAL_VAR(printcap_name),
 		.special	= NULL,
 		.enum_list	= NULL,
 	},
@@ -1925,7 +1925,7 @@ struct parm_struct parm_table[] = {
 		.label		= "printcap",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szPrintcapname),
+		.offset		= GLOBAL_VAR(printcap_name),
 		.special	= NULL,
 		.enum_list	= NULL,
 		.flags		= FLAG_SYNONYM,
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index d19e144..b1a404a 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4155,9 +4155,9 @@ int lp_maxprintjobs(int snum)
 
 const char *lp_printcapname(void)
 {
-	if ((Globals.szPrintcapname != NULL) &&
-	    (Globals.szPrintcapname[0] != '\0'))
-		return Globals.szPrintcapname;
+	if ((Globals.printcap_name != NULL) &&
+	    (Globals.printcap_name[0] != '\0'))
+		return Globals.printcap_name;
 
 	if (sDefault.printing == PRINT_CUPS) {
 		return "cups";
-- 
2.4.3


From 1cc61bd88e4d99b6ecd863fc2cd7a774333f67ec Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 14:34:11 +0200
Subject: [PATCH 17/39] param: turn 'printcap name' into a generated function

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/printing/printcapname.xml | 2 +-
 lib/param/loadparm.h                          | 1 -
 source3/param/loadparm.c                      | 8 +++++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/docs-xml/smbdotconf/printing/printcapname.xml b/docs-xml/smbdotconf/printing/printcapname.xml
index a6c4c75..64acc26 100644
--- a/docs-xml/smbdotconf/printing/printcapname.xml
+++ b/docs-xml/smbdotconf/printing/printcapname.xml
@@ -1,7 +1,7 @@
 <samba:parameter name="printcap name"
                  context="G"
                  type="string"
-                 generated_function="0"
+                 constant="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <synonym>printcap</synonym>
 <description>
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 46c683e..bd17007 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -249,7 +249,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define LOADPARM_EXTRA_GLOBALS \
 	struct parmlist_entry *param_opt;				\
 	char *realm_original;						\
-	char *printcap_name;						\
 	int CupsEncrypt;						\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index b1a404a..98eaec5 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4155,9 +4155,11 @@ int lp_maxprintjobs(int snum)
 
 const char *lp_printcapname(void)
 {
-	if ((Globals.printcap_name != NULL) &&
-	    (Globals.printcap_name[0] != '\0'))
-		return Globals.printcap_name;
+	const char *printcap_name = lp_printcap_name();
+
+	if ((printcap_name != NULL) &&
+	    (printcap_name[0] != '\0'))
+		return printcap_name;
 
 	if (sDefault.printing == PRINT_CUPS) {
 		return "cups";
-- 
2.4.3


From bb8c662c0c0ce7c02412768f2bf2e7fe4b89760b Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 14:49:16 +0200
Subject: [PATCH 18/39] param: treat negative values of 'smb2 max credits' as
 default.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/param/loadparm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 98eaec5..7d63d58 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1035,7 +1035,7 @@ int lp_winbind_max_domain_connections(void)
 
 int lp_smb2_max_credits(void)
 {
-	if (Globals.ismb2_max_credits == 0) {
+	if (Globals.ismb2_max_credits <= 0) {
 		Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
 	}
 	return Globals.ismb2_max_credits;
-- 
2.4.3


From f89c451aa7946bac9179fabe896ecf0817298c90 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 15:18:01 +0200
Subject: [PATCH 19/39] param: turn 'smb2 max credits' into generated option

This is achieved by moving the special treatment from
the lp_smb2_max_credits() function in the the special
handler that is called only once upon lp_load().

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/protocol/smb2maxcredits.xml |  2 +-
 lib/param/loadparm.c                            | 15 +++++++++++++++
 lib/param/loadparm.h                            |  3 +--
 lib/param/param_table.c                         |  4 ++--
 source3/param/loadparm.c                        |  9 +--------
 5 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/docs-xml/smbdotconf/protocol/smb2maxcredits.xml b/docs-xml/smbdotconf/protocol/smb2maxcredits.xml
index 572e961..90bc622 100644
--- a/docs-xml/smbdotconf/protocol/smb2maxcredits.xml
+++ b/docs-xml/smbdotconf/protocol/smb2maxcredits.xml
@@ -1,7 +1,7 @@
 <samba:parameter name="smb2 max credits"
                  type="integer"
                  context="G"
-                 generated_function="0"
+                 handler="handle_smb2_max_credits"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 <para>This option controls the maximum number of outstanding simultaneous SMB2 operations
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 7c44093..63c908b 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -1366,6 +1366,21 @@ bool handle_smb_ports(struct loadparm_context *lp_ctx, struct loadparm_service *
 	return true;
 }
 
+bool handle_smb2_max_credits(struct loadparm_context *lp_ctx,
+			     struct loadparm_service *service,
+			     const char *pszParmValue, char **ptr)
+{
+	int value = lp_int(pszParmValue);
+
+	if (value <= 0) {
+		value = DEFAULT_SMB2_MAX_CREDITS;
+	}
+
+	*(int *)ptr = value;
+
+	return true;
+}
+
 /***************************************************************************
  Initialise a copymap.
 ***************************************************************************/
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index bd17007..cdcfdc7 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -253,8 +253,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;						\
-	int winbindMaxDomainConnections;				\
-	int ismb2_max_credits;
+	int winbindMaxDomainConnections;
 
 const char* server_role_str(uint32_t role);
 int lp_find_server_role(int server_role, int security, int domain_logons, int domain_master);
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index f2a737b..8642364 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -1877,8 +1877,8 @@ struct parm_struct parm_table[] = {
 		.label		= "smb2 max credits",
 		.type		= P_INTEGER,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(ismb2_max_credits),
-		.special	= NULL,
+		.offset		= GLOBAL_VAR(smb2_max_credits),
+		.special	= handle_smb2_max_credits,
 		.enum_list	= NULL,
 	},
 	{
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 7d63d58..296d426 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -858,7 +858,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	Globals.smb2_max_read = DEFAULT_SMB2_MAX_READ;
 	Globals.smb2_max_write = DEFAULT_SMB2_MAX_WRITE;
 	Globals.smb2_max_trans = DEFAULT_SMB2_MAX_TRANSACT;
-	Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
+	Globals.smb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
 	Globals.smb2_leases = false;
 
 	string_set(Globals.ctx, &Globals.ncalrpc_dir, get_dyn_NCALRPCDIR());
@@ -1033,13 +1033,6 @@ int lp_winbind_max_domain_connections(void)
 	return MAX(1, lp_winbind_max_domain_connections_int());
 }
 
-int lp_smb2_max_credits(void)
-{
-	if (Globals.ismb2_max_credits <= 0) {
-		Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
-	}
-	return Globals.ismb2_max_credits;
-}
 int lp_cups_encrypt(void)
 {
 	int result = 0;
-- 
2.4.3


From 0e280ccc8c857c3bccdfb624a6ea7cae08fd9e6e Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 15:22:30 +0200
Subject: [PATCH 20/39] param: rename bWidelinks -> wide_links

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index cdcfdc7..867b8eb 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -238,7 +238,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	char *szCopy;							\
 	char *szService;						\
 	char *szInclude;						\
-	bool bWidelinks;						\
+	bool wide_links;						\
 	bool bAvailable;							\
 	struct parmlist_entry *param_opt;				\
 	struct bitmap *copymap;						\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 8642364..e67a4f6 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -3403,7 +3403,7 @@ struct parm_struct parm_table[] = {
 		.label		= "wide links",
 		.type		= P_BOOL,
 		.p_class	= P_LOCAL,
-		.offset		= LOCAL_VAR(bWidelinks),
+		.offset		= LOCAL_VAR(wide_links),
 		.special	= NULL,
 		.enum_list	= NULL,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 296d426..a2b827d 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -204,7 +204,7 @@ static struct loadparm_service sDefault =
 	.level2_oplocks = true,
 	.only_user = false,
 	.mangled_names = true,
-	.bWidelinks = false,
+	.wide_links = false,
 	.follow_symlinks = true,
 	.sync_always = false,
 	.strict_allocate = false,
@@ -4298,8 +4298,8 @@ int lp_min_receive_file_size(void)
 
 static bool lp_widelinks_internal(int snum)
 {
-	return (bool)(LP_SNUM_OK(snum)? ServicePtrs[(snum)]->bWidelinks :
-			sDefault.bWidelinks);
+	return (bool)(LP_SNUM_OK(snum)? ServicePtrs[(snum)]->wide_links :
+			sDefault.wide_links);
 }
 
 void widelinks_warning(int snum)
-- 
2.4.3


From c78d7de4b40afe8cf8750e39fd3e3ec15099eab7 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 15:28:33 +0200
Subject: [PATCH 21/39] param: turn 'wide links' into a generated funcion

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/misc/widelinks.xml |  1 -
 lib/param/loadparm.h                   |  1 -
 source3/param/loadparm.c               | 10 ++--------
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/docs-xml/smbdotconf/misc/widelinks.xml b/docs-xml/smbdotconf/misc/widelinks.xml
index cb1389a..09f8aa5 100644
--- a/docs-xml/smbdotconf/misc/widelinks.xml
+++ b/docs-xml/smbdotconf/misc/widelinks.xml
@@ -1,7 +1,6 @@
 <samba:parameter name="wide links"
                  context="S"
                  type="boolean"
-                 generated_function="0"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 	<para>This parameter controls whether or not links 
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 867b8eb..3f1c3c9 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -238,7 +238,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	char *szCopy;							\
 	char *szService;						\
 	char *szInclude;						\
-	bool wide_links;						\
 	bool bAvailable;							\
 	struct parmlist_entry *param_opt;				\
 	struct bitmap *copymap;						\
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index a2b827d..8aedf22 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4296,19 +4296,13 @@ int lp_min_receive_file_size(void)
  even after a configuration file reload.
 ********************************************************************/
 
-static bool lp_widelinks_internal(int snum)
-{
-	return (bool)(LP_SNUM_OK(snum)? ServicePtrs[(snum)]->wide_links :
-			sDefault.wide_links);
-}
-
 void widelinks_warning(int snum)
 {
 	if (lp_allow_insecure_wide_links()) {
 		return;
 	}
 
-	if (lp_unix_extensions() && lp_widelinks_internal(snum)) {
+	if (lp_unix_extensions() && lp_wide_links(snum)) {
 		DEBUG(0,("Share '%s' has wide links and unix extensions enabled. "
 			"These parameters are incompatible. "
 			"Wide links will be disabled for this share.\n",
@@ -4329,7 +4323,7 @@ bool lp_widelinks(int snum)
 		}
 	}
 
-	return lp_widelinks_internal(snum);
+	return lp_wide_links(snum);
 }
 
 int lp_server_role(void)
-- 
2.4.3


From e457aee1b9234256a96f69bbbcb0d27cd225eb2e Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 23:42:09 +0200
Subject: [PATCH 22/39] param: rename winbindMaxDomainConnections ->
 _winbind_max_domain_connections

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 3f1c3c9..73680bb 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -252,7 +252,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;						\
-	int winbindMaxDomainConnections;
+	int _winbind_max_domain_connections;
 
 const char* server_role_str(uint32_t role);
 int lp_find_server_role(int server_role, int security, int domain_logons, int domain_master);
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index e67a4f6..7f39b88 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -3785,7 +3785,7 @@ struct parm_struct parm_table[] = {
 		.label		= "winbind max domain connections",
 		.type		= P_INTEGER,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(winbindMaxDomainConnections),
+		.offset		= GLOBAL_VAR(_winbind_max_domain_connections),
 		.special	= NULL,
 		.enum_list	= NULL,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 8aedf22..db756d3 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -714,7 +714,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	Globals.reset_on_zero_vc = false;
 	Globals.log_writeable_files_on_exit = false;
 	Globals.create_krb5_conf = true;
-	Globals.winbindMaxDomainConnections = 1;
+	Globals._winbind_max_domain_connections = 1;
 
 	/* hostname lookups can be very expensive and are broken on
 	   a large number of sites (tridge) */
@@ -1020,7 +1020,7 @@ char *lp_ ## fn_name(TALLOC_CTX *ctx,int i) {return(lp_string((ctx), (LP_SNUM_OK
  char lp_ ## fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);}
 
 static FN_GLOBAL_INTEGER(winbind_max_domain_connections_int,
-		  winbindMaxDomainConnections)
+		  _winbind_max_domain_connections)
 
 int lp_winbind_max_domain_connections(void)
 {
-- 
2.4.3


From a92f1a73195539d98fe83758af06ecbe4ff33199 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jul 2015 23:49:45 +0200
Subject: [PATCH 23/39] param: make 'winbind max domain connections' a
 generated function.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml | 2 +-
 lib/param/loadparm.h                                        | 3 +--
 source3/param/loadparm.c                                    | 7 ++-----
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml b/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml
index c764267..be39143 100644
--- a/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml
+++ b/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml
@@ -1,7 +1,7 @@
 <samba:parameter name="winbind max domain connections"
                  context="G"
                  type="integer"
-                 generated_function="0"
+                 function="_winbind_max_domain_connections"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 	<para>This parameter specifies the maximum number of simultaneous
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 73680bb..2793d2d 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -251,8 +251,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	int CupsEncrypt;						\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
-	char *szIdmapBackend;						\
-	int _winbind_max_domain_connections;
+	char *szIdmapBackend;
 
 const char* server_role_str(uint32_t role);
 int lp_find_server_role(int server_role, int security, int domain_logons, int domain_master);
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index db756d3..216e152 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1019,18 +1019,15 @@ char *lp_ ## fn_name(TALLOC_CTX *ctx,int i) {return(lp_string((ctx), (LP_SNUM_OK
 #define FN_LOCAL_PARM_CHAR(fn_name,val) \
  char lp_ ## fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);}
 
-static FN_GLOBAL_INTEGER(winbind_max_domain_connections_int,
-		  _winbind_max_domain_connections)
-
 int lp_winbind_max_domain_connections(void)
 {
 	if (lp_winbind_offline_logon() &&
-	    lp_winbind_max_domain_connections_int() > 1) {
+	    lp__winbind_max_domain_connections() > 1) {
 		DEBUG(1, ("offline logons active, restricting max domain "
 			  "connections to 1\n"));
 		return 1;
 	}
-	return MAX(1, lp_winbind_max_domain_connections_int());
+	return MAX(1, lp__winbind_max_domain_connections());
 }
 
 int lp_cups_encrypt(void)
-- 
2.4.3


From 9538a4f684159329ebcfd8c067b85cf91ec53733 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 00:04:39 +0200
Subject: [PATCH 24/39] param: simplify lp_winbind_max_domain_connections() a
 bit

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/param/loadparm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 216e152..00ca4ec 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1021,11 +1021,10 @@ char *lp_ ## fn_name(TALLOC_CTX *ctx,int i) {return(lp_string((ctx), (LP_SNUM_OK
 
 int lp_winbind_max_domain_connections(void)
 {
-	if (lp_winbind_offline_logon() &&
-	    lp__winbind_max_domain_connections() > 1) {
+	if (lp_winbind_offline_logon()) {
 		DEBUG(1, ("offline logons active, restricting max domain "
 			  "connections to 1\n"));
-		return 1;
+		return MIN(1, lp__winbind_max_domain_connections());
 	}
 	return MAX(1, lp__winbind_max_domain_connections());
 }
-- 
2.4.3


From 9a4da0d81fd5768783a3e502c1f35905907d36d2 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 16:21:35 +0200
Subject: [PATCH 25/39] param: rename CupsEncrypt -> cups_encrypt

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 2793d2d..8199439 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -248,7 +248,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define LOADPARM_EXTRA_GLOBALS \
 	struct parmlist_entry *param_opt;				\
 	char *realm_original;						\
-	int CupsEncrypt;						\
+	int cups_encrypt;						\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 7f39b88..77cd39f 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -1983,7 +1983,7 @@ struct parm_struct parm_table[] = {
 		.label          = "cups encrypt",
 		.type           = P_ENUM,
 		.p_class        = P_GLOBAL,
-		.offset         = GLOBAL_VAR(CupsEncrypt),
+		.offset         = GLOBAL_VAR(cups_encrypt),
 		.special        = NULL,
 		.enum_list      = enum_bool_auto,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 00ca4ec..d09da4e 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1033,7 +1033,7 @@ int lp_cups_encrypt(void)
 {
 	int result = 0;
 #ifdef HAVE_HTTPCONNECTENCRYPT
-	switch (Globals.CupsEncrypt) {
+	switch (Globals.cups_encrypt) {
 		case Auto:
 			result = HTTP_ENCRYPT_REQUIRED;
 			break;
-- 
2.4.3


From aaab904983bad20fceb4c7419fd2f421853cbe6b Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 16:22:40 +0200
Subject: [PATCH 26/39] param: turn 'cups encrypt' into a generated function

Move the special stuff of the hand-written lp_cups_encrypt()
function into a handler that is called once at load time.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/printing/cupsencrypt.xml |  1 -
 lib/param/loadparm.c                         | 28 ++++++++++++++++++++++++++++
 lib/param/loadparm.h                         |  1 -
 source3/param/loadparm.c                     | 19 -------------------
 4 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/docs-xml/smbdotconf/printing/cupsencrypt.xml b/docs-xml/smbdotconf/printing/cupsencrypt.xml
index db7bf51..8094abe 100644
--- a/docs-xml/smbdotconf/printing/cupsencrypt.xml
+++ b/docs-xml/smbdotconf/printing/cupsencrypt.xml
@@ -2,7 +2,6 @@
                  context="G"
                  type="enum"
                  enumlist="enum_bool_auto"
-                 generated_function="0"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 	<para>
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 63c908b..54e8e07 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -1381,6 +1381,34 @@ bool handle_smb2_max_credits(struct loadparm_context *lp_ctx,
 	return true;
 }
 
+bool handle_cups_encrypt(struct loadparm_context *lp_ctx,
+			 struct loadparm_service *service,
+			 const char *pszParmValue, char **ptr)
+{
+	int result = 0;
+#ifdef HAVE_HTTPCONNECTENCRYPT
+	int value = lp_int(pszParmValue);
+
+	switch (value) {
+		case Auto:
+			result = HTTP_ENCRYPT_REQUIRED;
+			break;
+		case true:
+			result = HTTP_ENCRYPT_ALWAYS;
+			break;
+		case false:
+			result = HTTP_ENCRYPT_NEVER;
+			break;
+		default:
+			result = 0;
+			break;
+	}
+#endif
+	*(int *)ptr = result;
+
+	return true;
+}
+
 /***************************************************************************
  Initialise a copymap.
 ***************************************************************************/
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 8199439..de92cb8 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -248,7 +248,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define LOADPARM_EXTRA_GLOBALS \
 	struct parmlist_entry *param_opt;				\
 	char *realm_original;						\
-	int cups_encrypt;						\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
 	char *szIdmapBackend;
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index d09da4e..3a68b20 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1029,25 +1029,6 @@ int lp_winbind_max_domain_connections(void)
 	return MAX(1, lp__winbind_max_domain_connections());
 }
 
-int lp_cups_encrypt(void)
-{
-	int result = 0;
-#ifdef HAVE_HTTPCONNECTENCRYPT
-	switch (Globals.cups_encrypt) {
-		case Auto:
-			result = HTTP_ENCRYPT_REQUIRED;
-			break;
-		case true:
-			result = HTTP_ENCRYPT_ALWAYS;
-			break;
-		case false:
-			result = HTTP_ENCRYPT_NEVER;
-			break;
-	}
-#endif
-	return result;
-}
-
 /* These functions remain in source3/param for now */
 
 #include "lib/param/param_functions.c"
-- 
2.4.3


From 2927d389508af1efc25633ebb0f6c69e93c1a023 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 12 May 2015 13:41:44 +0200
Subject: [PATCH 27/39] param: make 'realm' use the standard 'realm' variable.

This way, the generated lp_realm() function matches the param_table.
realm_original is only treated in the special handler now.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.c    | 2 +-
 lib/param/param_table.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 54e8e07..4c40df7 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -1081,7 +1081,7 @@ bool handle_realm(struct loadparm_context *lp_ctx, struct loadparm_service *serv
 		return false;
 	}
 
-	lpcfg_string_set(lp_ctx->globals->ctx, ptr, pszParmValue);
+	lpcfg_string_set(lp_ctx->globals->ctx, &lp_ctx->globals->realm_original, pszParmValue);
 	lpcfg_string_set(lp_ctx->globals->ctx, &lp_ctx->globals->realm, upper);
 	lpcfg_string_set(lp_ctx->globals->ctx, &lp_ctx->globals->dnsdomain, lower);
 
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 77cd39f..c9a40f8 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -337,7 +337,7 @@ struct parm_struct parm_table[] = {
 		.label		= "realm",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(realm_original),
+		.offset		= GLOBAL_VAR(realm),
 		.special	= handle_realm,
 		.enum_list	= NULL,
 	},
-- 
2.4.3


From e72dc6630e0b3a1478b6404fae7f9f4093abcce6 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:06:39 +0200
Subject: [PATCH 28/39] param: rename bAvailable -> available

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.c     | 8 ++++----
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 4c40df7..97827ea 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -651,7 +651,7 @@ bool lpcfg_add_home(struct loadparm_context *lp_ctx,
 	if (!(*(service->comment))) {
 		service->comment = talloc_asprintf(service, "Home directory of %s", user);
 	}
-	service->bAvailable = default_service->bAvailable;
+	service->available = default_service->available;
 	service->browseable = default_service->browseable;
 
 	DEBUG(3, ("adding home's share [%s] for user '%s' at '%s'\n",
@@ -951,10 +951,10 @@ bool lpcfg_service_ok(struct loadparm_service *service)
 	{
 		DEBUG(0, ("WARNING: No path in service %s - making it unavailable!\n",
 			service->szService));
-		service->bAvailable = false;
+		service->available = false;
 	}
 
-	if (!service->bAvailable)
+	if (!service->available)
 		DEBUG(1, ("NOTE: Service %s is flagged unavailable.\n",
 			  service->szService));
 
@@ -2416,7 +2416,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 	lp_ctx->flags = talloc_zero_array(lp_ctx, unsigned int, num_parameters());
 
 	lp_ctx->sDefault->max_print_jobs = 1000;
-	lp_ctx->sDefault->bAvailable = true;
+	lp_ctx->sDefault->available = true;
 	lp_ctx->sDefault->browseable = true;
 	lp_ctx->sDefault->read_only = true;
 	lp_ctx->sDefault->map_archive = true;
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index de92cb8..8c443ef 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -238,7 +238,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	char *szCopy;							\
 	char *szService;						\
 	char *szInclude;						\
-	bool bAvailable;							\
+	bool available;							\
 	struct parmlist_entry *param_opt;				\
 	struct bitmap *copymap;						\
 	char dummy[3];		/* for alignment */
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index c9a40f8..dcbd146 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -3307,7 +3307,7 @@ struct parm_struct parm_table[] = {
 		.label		= "available",
 		.type		= P_BOOL,
 		.p_class	= P_LOCAL,
-		.offset		= LOCAL_VAR(bAvailable),
+		.offset		= LOCAL_VAR(available),
 		.special	= NULL,
 		.enum_list	= NULL,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 3a68b20..cf7e1f1 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -183,7 +183,7 @@ static struct loadparm_service sDefault =
 	.hide_unwriteable_files = false,
 	.browseable = true,
 	.access_based_share_enum = false,
-	.bAvailable = true,
+	.available = true,
 	.read_only = true,
 	.spotlight = false,
 	.guest_only = false,
@@ -1460,7 +1460,7 @@ static bool lp_add_ipc(const char *ipc_name, bool guest_ok)
 	string_set(ServicePtrs[i], &ServicePtrs[i]->comment, comment);
 	string_set(ServicePtrs[i], &ServicePtrs[i]->fstype, "IPC");
 	ServicePtrs[i]->max_connections = 0;
-	ServicePtrs[i]->bAvailable = true;
+	ServicePtrs[i]->available = true;
 	ServicePtrs[i]->read_only = true;
 	ServicePtrs[i]->guest_only = false;
 	ServicePtrs[i]->administrative_share = true;
@@ -2633,7 +2633,7 @@ static void dump_copy_map(bool *pcopymap)
 
 bool lp_snum_ok(int iService)
 {
-	return (LP_SNUM_OK(iService) && ServicePtrs[iService]->bAvailable);
+	return (LP_SNUM_OK(iService) && ServicePtrs[iService]->available);
 }
 
 /***************************************************************************
-- 
2.4.3


From 823bb3b4d553589cd18c658c3c9927a176354efa Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:08:15 +0200
Subject: [PATCH 29/39] param: rename szCopy -> copy

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 8c443ef..a81c543 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -235,7 +235,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	bool valid;						        \
 	int usershare;							\
 	struct timespec usershare_last_mod;				\
-	char *szCopy;							\
+	char *copy;							\
 	char *szService;						\
 	char *szInclude;						\
 	bool available;							\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index dcbd146..d70f94e 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -3234,7 +3234,7 @@ struct parm_struct parm_table[] = {
 		.label		= "copy",
 		.type		= P_STRING,
 		.p_class	= P_LOCAL,
-		.offset		= LOCAL_VAR(szCopy),
+		.offset		= LOCAL_VAR(copy),
 		.special	= handle_copy,
 		.enum_list	= NULL,
 		.flags		= FLAG_SYNONYM,
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index cf7e1f1..e77094b 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -122,7 +122,7 @@ static struct loadparm_service sDefault =
 	.invalid_users = NULL,
 	.valid_users = NULL,
 	.admin_users = NULL,
-	.szCopy = NULL,
+	.copy = NULL,
 	.szInclude = NULL,
 	.preexec = NULL,
 	.postexec = NULL,
-- 
2.4.3


From a97a7bf38c59a9c6fc08bdaa478926595cb791f4 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:09:35 +0200
Subject: [PATCH 30/39] param: rename szInclude -> include

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index a81c543..0893fee 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -237,7 +237,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	struct timespec usershare_last_mod;				\
 	char *copy;							\
 	char *szService;						\
-	char *szInclude;						\
+	char *include;							\
 	bool available;							\
 	struct parmlist_entry *param_opt;				\
 	struct bitmap *copymap;						\
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index d70f94e..2c292ec 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -3243,7 +3243,7 @@ struct parm_struct parm_table[] = {
 		.label		= "include",
 		.type		= P_STRING,
 		.p_class	= P_LOCAL,
-		.offset		= LOCAL_VAR(szInclude),
+		.offset		= LOCAL_VAR(include),
 		.special	= handle_include,
 		.enum_list	= NULL,
 	},
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index e77094b..28e6fef 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -123,7 +123,7 @@ static struct loadparm_service sDefault =
 	.valid_users = NULL,
 	.admin_users = NULL,
 	.copy = NULL,
-	.szInclude = NULL,
+	.include = NULL,
 	.preexec = NULL,
 	.postexec = NULL,
 	.root_preexec = NULL,
-- 
2.4.3


From 46ac2d79c92dcce7acea352996584e60b0e3def2 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:11:12 +0200
Subject: [PATCH 31/39] param: rename szIdmapBackend -> idmap_backend

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 2 +-
 lib/param/param_table.c  | 2 +-
 source3/param/loadparm.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 0893fee..7e429f6 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -250,7 +250,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	char *realm_original;						\
 	char *szIdmapUID;						\
 	char *szIdmapGID;						\
-	char *szIdmapBackend;
+	char *idmap_backend;
 
 const char* server_role_str(uint32_t role);
 int lp_find_server_role(int server_role, int security, int domain_logons, int domain_master);
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 2c292ec..f2762da 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -3564,7 +3564,7 @@ struct parm_struct parm_table[] = {
 		.label		= "idmap backend",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szIdmapBackend),
+		.offset		= GLOBAL_VAR(idmap_backend),
 		.special	= handle_idmap_backend,
 		.enum_list	= NULL,
 		.flags		= FLAG_DEPRECATED,
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 28e6fef..836d73c 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -780,7 +780,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	Globals.wins_dns_proxy = true;
 
 	Globals.allow_trusted_domains = true;
-	string_set(Globals.ctx, &Globals.szIdmapBackend, "tdb");
+	string_set(Globals.ctx, &Globals.idmap_backend, "tdb");
 
 	string_set(Globals.ctx, &Globals.template_shell, "/bin/false");
 	string_set(Globals.ctx, &Globals.template_homedir, "/home/%D/%U");
@@ -3636,7 +3636,7 @@ static bool lp_load_ex(const char *pszFname,
 		apply_lp_set_cmdline();
 	}
 
-	lp_do_parameter(-1, "idmap config * : backend", Globals.szIdmapBackend);
+	lp_do_parameter(-1, "idmap config * : backend", Globals.idmap_backend);
 
 	/* We get sections first, so have to start 'behind' to make up */
 	iServiceIndex = -1;
-- 
2.4.3


From 4bff152e7f063849c1c214399082caa832c54687 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:12:53 +0200
Subject: [PATCH 32/39] param: rename szIdmapUID -> idmap_uid

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h    | 2 +-
 lib/param/param_table.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 7e429f6..9f59f00 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -248,7 +248,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define LOADPARM_EXTRA_GLOBALS \
 	struct parmlist_entry *param_opt;				\
 	char *realm_original;						\
-	char *szIdmapUID;						\
+	char *idmap_uid;						\
 	char *szIdmapGID;						\
 	char *idmap_backend;
 
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index f2762da..eb28e9f 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -3589,7 +3589,7 @@ struct parm_struct parm_table[] = {
 		.label		= "idmap uid",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szIdmapUID),
+		.offset		= GLOBAL_VAR(idmap_uid),
 		.special	= handle_idmap_uid,
 		.enum_list	= NULL,
 		.flags		= FLAG_DEPRECATED,
@@ -3598,7 +3598,7 @@ struct parm_struct parm_table[] = {
 		.label		= "winbind uid",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szIdmapUID),
+		.offset		= GLOBAL_VAR(idmap_uid),
 		.special	= handle_idmap_uid,
 		.enum_list	= NULL,
 		.flags		= FLAG_SYNONYM,
-- 
2.4.3


From 8ee2fd4c34cd128d063e58503ae472ec533aa9c3 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:13:55 +0200
Subject: [PATCH 33/39] param: rename szIdmapGID -> idmap_gid

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h    | 2 +-
 lib/param/param_table.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 9f59f00..2b4cd27 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -249,7 +249,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 	struct parmlist_entry *param_opt;				\
 	char *realm_original;						\
 	char *idmap_uid;						\
-	char *szIdmapGID;						\
+	char *idmap_gid;						\
 	char *idmap_backend;
 
 const char* server_role_str(uint32_t role);
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index eb28e9f..c7eee9a 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -3607,7 +3607,7 @@ struct parm_struct parm_table[] = {
 		.label		= "idmap gid",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szIdmapGID),
+		.offset		= GLOBAL_VAR(idmap_gid),
 		.special	= handle_idmap_gid,
 		.enum_list	= NULL,
 		.flags		= FLAG_DEPRECATED,
@@ -3616,7 +3616,7 @@ struct parm_struct parm_table[] = {
 		.label		= "winbind gid",
 		.type		= P_STRING,
 		.p_class	= P_GLOBAL,
-		.offset		= GLOBAL_VAR(szIdmapGID),
+		.offset		= GLOBAL_VAR(idmap_gid),
 		.special	= handle_idmap_gid,
 		.enum_list	= NULL,
 		.flags		= FLAG_SYNONYM,
-- 
2.4.3


From 7d870243a84ea65a1abe9ef873f0a0ac7fa95fda Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:26:46 +0200
Subject: [PATCH 34/39] docs:smbdotconf: add 'function' parameter to  valid

This is to differentiate the variable/function name from
the parameter name, which is the non-standard "-valid".

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/misc/valid.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs-xml/smbdotconf/misc/valid.xml b/docs-xml/smbdotconf/misc/valid.xml
index fcd9dbc..8d86f9c 100644
--- a/docs-xml/smbdotconf/misc/valid.xml
+++ b/docs-xml/smbdotconf/misc/valid.xml
@@ -2,6 +2,7 @@
                  context="S"
                  type="boolean"
                  generated_function="0"
+                 function="valid"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 	<para> This parameter indicates whether a share is 
-- 
2.4.3


From 3261712685eb0981e1e933d5273d33d683397a6e Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:29:16 +0200
Subject: [PATCH 35/39] docs:smbdotconf: add 'function' parameter to
 enablespoolss

this is to specify the storage place for this reverse boolean.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/printing/enablespoolss.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs-xml/smbdotconf/printing/enablespoolss.xml b/docs-xml/smbdotconf/printing/enablespoolss.xml
index d69f8f4..68e09bf 100644
--- a/docs-xml/smbdotconf/printing/enablespoolss.xml
+++ b/docs-xml/smbdotconf/printing/enablespoolss.xml
@@ -1,6 +1,7 @@
 <samba:parameter name="enable spoolss"
                  context="G"
                  type="boolean-rev"
+                 function="_disable_spoolss"
                  synonym="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
-- 
2.4.3


From 97b2588102b7ab66682b49acec2da61494a1f364 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:29:56 +0200
Subject: [PATCH 36/39] docs:smbdotconf: add 'function' argument to writeable

This is to specify the storage place for this reverse boolean.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 docs-xml/smbdotconf/security/writeable.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs-xml/smbdotconf/security/writeable.xml b/docs-xml/smbdotconf/security/writeable.xml
index 2bf7070..14a5a02 100644
--- a/docs-xml/smbdotconf/security/writeable.xml
+++ b/docs-xml/smbdotconf/security/writeable.xml
@@ -1,6 +1,7 @@
 <samba:parameter name="writeable"
                  context="S"
                  type="boolean-rev"
+                 function="read_only"
                  synonym="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <synonym>writable</synonym>
-- 
2.4.3


From 11be927151d176e7ef3e0563231204b6fad018a7 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 28 Apr 2015 16:47:39 +0200
Subject: [PATCH 37/39] generate_param: make it possible to handle generated
 and synonym flags in iteration

Signed-off-by: Michael Adam <obnox at samba.org>
---
 script/generate_param.py | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/script/generate_param.py b/script/generate_param.py
index d79c13c..ca2b1e9 100644
--- a/script/generate_param.py
+++ b/script/generate_param.py
@@ -69,8 +69,9 @@ def iterate_all(path):
         synonym = parameter.attrib.get("synonym")
         removed = parameter.attrib.get("removed")
         generated = parameter.attrib.get("generated_function")
-        if synonym == "1" or removed == "1" or generated == "0":
+        if removed == "1":
             continue
+
         constant = parameter.attrib.get("constant")
         parm = parameter.attrib.get("parm")
         if name is None or param_type is None or context is None:
@@ -82,7 +83,9 @@ def iterate_all(path):
                'context': context,
                'function': func,
                'constant': (constant == '1'),
-               'parm': (parm == '1')}
+               'parm': (parm == '1'),
+               'synonym' : synonym,
+               'generated' : generated }
 
 # map doc attributes to a section of the generated function
 context_dict = {"G": "_GLOBAL", "S": "_LOCAL"}
@@ -98,6 +101,11 @@ def generate_functions(path_in, path_out):
             # filter out parameteric options
             if ':' in parameter['name']:
                 continue
+            if parameter['synonym'] == "1":
+                continue
+            if parameter['generated'] == "0":
+                continue
+
             output_string = "FN"
             temp = context_dict.get(parameter['context'])
             if temp is None: 
@@ -129,6 +137,10 @@ def make_s3_param_proto(path_in, path_out):
             # filter out parameteric options
             if ':' in parameter['name']:
                 continue
+            if parameter['synonym'] == "1":
+                continue
+            if parameter['generated'] == "0":
+                continue
 
             output_string = ""
             if parameter['constant']:
@@ -175,6 +187,10 @@ def make_lib_proto(path_in, path_out):
             # filter out parameteric options
             if ':' in parameter['name']:
                 continue
+            if parameter['synonym'] == "1":
+                continue
+            if parameter['generated'] == "0":
+                continue
 
             output_string = ""
             if parameter['constant']:
@@ -238,6 +254,10 @@ def make_param_defs(path_in, path_out, scope):
             # filter out parameteric options
             if ':' in parameter['name']:
                 continue
+            if parameter['synonym'] == "1":
+                continue
+            if parameter['generated'] == "0":
+                continue
 
             if (scope == "GLOBAL" and parameter['context'] != "G" or
                 scope == "LOCAL" and parameter['context'] != "S"):
-- 
2.4.3


From 63c8c87512e4042270e5fe8b4e9af316f41973d3 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:14:26 +0200
Subject: [PATCH 38/39] generate_param: generate struct entries if we don't
 generate access functions.

This shrinks LOADPARM_EXTRA_GLOBALS/LOCALS.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 9 +--------
 script/generate_param.py | 2 --
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 2b4cd27..656b20d 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -232,13 +232,9 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define DEFAULT_SMB2_MAX_CREDITS 8192
 
 #define LOADPARM_EXTRA_LOCALS						\
-	bool valid;						        \
 	int usershare;							\
 	struct timespec usershare_last_mod;				\
-	char *copy;							\
 	char *szService;						\
-	char *include;							\
-	bool available;							\
 	struct parmlist_entry *param_opt;				\
 	struct bitmap *copymap;						\
 	char dummy[3];		/* for alignment */
@@ -247,10 +243,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 
 #define LOADPARM_EXTRA_GLOBALS \
 	struct parmlist_entry *param_opt;				\
-	char *realm_original;						\
-	char *idmap_uid;						\
-	char *idmap_gid;						\
-	char *idmap_backend;
+	char *realm_original;
 
 const char* server_role_str(uint32_t role);
 int lp_find_server_role(int server_role, int security, int domain_logons, int domain_master);
diff --git a/script/generate_param.py b/script/generate_param.py
index ca2b1e9..7315d86 100644
--- a/script/generate_param.py
+++ b/script/generate_param.py
@@ -256,8 +256,6 @@ def make_param_defs(path_in, path_out, scope):
                 continue
             if parameter['synonym'] == "1":
                 continue
-            if parameter['generated'] == "0":
-                continue
 
             if (scope == "GLOBAL" and parameter['context'] != "G" or
                 scope == "LOCAL" and parameter['context'] != "S"):
-- 
2.4.3


From 81027fee2b7e0abc50a731ba883070ed1d500c39 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Wed, 22 Jul 2015 19:47:22 +0200
Subject: [PATCH 39/39] param: move dnsdomain from generate_param to
 EXTRA_GLOBALS

This is alongside realm_original which is of the same kind.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 lib/param/loadparm.h     | 1 +
 script/generate_param.py | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index 656b20d..89dcb17 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -243,6 +243,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 
 #define LOADPARM_EXTRA_GLOBALS \
 	struct parmlist_entry *param_opt;				\
+	char *dnsdomain;						\
 	char *realm_original;
 
 const char* server_role_str(uint32_t role);
diff --git a/script/generate_param.py b/script/generate_param.py
index 7315d86..351ea6b 100644
--- a/script/generate_param.py
+++ b/script/generate_param.py
@@ -241,7 +241,6 @@ def make_param_defs(path_in, path_out, scope):
             file_out.write("struct loadparm_global \n")
             file_out.write("{\n")
             file_out.write("\tTALLOC_CTX *ctx; /* Context for talloced members */\n")
-            file_out.write("\tchar *  dnsdomain;\n")
         elif scope == "LOCAL":
             file_out.write("/**\n")
             file_out.write(" * This structure describes a single service.\n")
-- 
2.4.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150722/f849cee3/attachment-0001.sig>


More information about the samba-technical mailing list