summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-07-23 13:32:31 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-07-24 11:01:17 +0200
commit3367fd01d4711c481efc8c56fb424ba3bab68dab (patch)
treeba28403d594586b2832f7016f0c59e07f9844e2c
parentb62b0318155e0c22a0a62ec6735f507b1b6c0f5d (diff)
downloadsamba-3367fd01d4711c481efc8c56fb424ba3bab68dab.tar.gz
samba-3367fd01d4711c481efc8c56fb424ba3bab68dab.tar.bz2
samba-3367fd01d4711c481efc8c56fb424ba3bab68dab.zip
lib/param: Merge handling of security/domain master/domain logons/server role
This ensures that the same input parameters always gives the same output values in both loadparm systems. Andrew Bartlett
-rw-r--r--lib/param/loadparm.c27
-rw-r--r--lib/param/param_functions.c5
-rw-r--r--script/mks3param.pl2
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/param/loadparm.c13
-rw-r--r--source3/param/loadparm_ctx.c6
6 files changed, 29 insertions, 28 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index e744e79206..8e5fba8c20 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -83,9 +83,6 @@ static bool defaults_saved = false;
char *tls_dhpfile; \
char *loglevel; \
char *panic_action; \
- int security; \
- int domain_master; \
- int domain_logons; \
int bPreferredMaster;
#include "lib/param/param_global.h"
@@ -123,7 +120,7 @@ static struct parm_struct parm_table[] = {
.label = "domain logons",
.type = P_ENUM,
.p_class = P_GLOBAL,
- .offset = GLOBAL_VAR(domain_logons),
+ .offset = GLOBAL_VAR(bDomainLogons),
.special = NULL,
.enum_list = enum_bool_auto
},
@@ -3762,23 +3759,17 @@ struct gensec_settings *lpcfg_gensec_settings(TALLOC_CTX *mem_ctx, struct loadpa
int lpcfg_server_role(struct loadparm_context *lp_ctx)
{
- if (lp_ctx->s3_fns) {
- return lp_ctx->s3_fns->server_role();
- }
+ int domain_master = lpcfg__domain_master(lp_ctx);
- return lp_find_server_role(lp_ctx->globals->server_role,
- lp_ctx->globals->security,
- lp_ctx->globals->domain_logons,
- (lp_ctx->globals->domain_master == true) ||
- (lp_ctx->globals->domain_master == Auto));
+ return lp_find_server_role(lpcfg__server_role(lp_ctx),
+ lpcfg__security(lp_ctx),
+ lpcfg__domain_logons(lp_ctx),
+ (domain_master == true) ||
+ (domain_master == Auto));
}
int lpcfg_security(struct loadparm_context *lp_ctx)
{
- if (lp_ctx->s3_fns) {
- return lp_ctx->s3_fns->security();
- }
-
- return lp_find_security(lp_ctx->globals->server_role,
- lp_ctx->globals->security);
+ return lp_find_security(lpcfg__server_role(lp_ctx),
+ lpcfg__security(lp_ctx));
}
diff --git a/lib/param/param_functions.c b/lib/param/param_functions.c
index 7f2d878552..d7e09ffafd 100644
--- a/lib/param/param_functions.c
+++ b/lib/param/param_functions.c
@@ -177,6 +177,7 @@ FN_GLOBAL_BOOL(debug_uid, bDebugUid)
FN_GLOBAL_BOOL(defer_sharing_violations, bDeferSharingViolations)
FN_GLOBAL_BOOL(disable_netbios, bDisableNetbios)
FN_GLOBAL_BOOL(_disable_spoolss, bDisableSpoolss)
+FN_GLOBAL_BOOL(_domain_logons, bDomainLogons)
FN_GLOBAL_BOOL(dns_recursive_queries, dns_recursive_queries)
FN_GLOBAL_BOOL(enable_asu_support, bASUSupport)
FN_GLOBAL_BOOL(enable_core_files, bEnableCoreFiles)
@@ -210,7 +211,6 @@ FN_GLOBAL_BOOL(passwd_chat_debug, bPasswdChatDebug)
FN_GLOBAL_BOOL(registry_shares, bRegistryShares)
FN_GLOBAL_BOOL(reset_on_zero_vc, bResetOnZeroVC)
FN_GLOBAL_BOOL(rpc_big_endian, bRpcBigEndian)
-FN_GLOBAL_BOOL(_server_role, server_role)
FN_GLOBAL_BOOL(stat_cache, bStatCache)
FN_GLOBAL_BOOL(syslog_only, bSyslogOnly)
FN_GLOBAL_BOOL(timestamp_logs, bTimestampLogs)
@@ -286,6 +286,7 @@ FN_GLOBAL_INTEGER(ctdb_timeout, ctdb_timeout)
FN_GLOBAL_INTEGER(cups_connection_timeout, cups_connection_timeout)
FN_GLOBAL_INTEGER(deadtime, deadtime)
FN_GLOBAL_INTEGER(dgram_port, dgram_port)
+FN_GLOBAL_INTEGER(_domain_master, domain_master)
FN_GLOBAL_INTEGER(idmap_cache_time, iIdmapCacheTime)
FN_GLOBAL_INTEGER(idmap_negative_cache_time, iIdmapNegativeCacheTime)
FN_GLOBAL_INTEGER(init_logon_delay, InitLogonDelay)
@@ -329,6 +330,8 @@ FN_GLOBAL_INTEGER(passwd_chat_timeout, iPasswdChatTimeout)
FN_GLOBAL_INTEGER(passwordlevel, pwordlevel)
FN_GLOBAL_INTEGER(printcap_cache_time, PrintcapCacheTime)
FN_GLOBAL_INTEGER(restrict_anonymous, restrict_anonymous)
+FN_GLOBAL_INTEGER(_security, security)
+FN_GLOBAL_INTEGER(_server_role, server_role)
FN_GLOBAL_INTEGER(server_schannel, serverSchannel)
FN_GLOBAL_INTEGER(server_signing, server_signing)
FN_GLOBAL_INTEGER(smb2_max_read, ismb2_max_read)
diff --git a/script/mks3param.pl b/script/mks3param.pl
index 5c5eea3ce1..4222ca5744 100644
--- a/script/mks3param.pl
+++ b/script/mks3param.pl
@@ -95,8 +95,6 @@ sub print_header($$)
$file->("\tbool (*load)(const char *filename);\n");
$file->("\tbool (*set_cmdline)(const char *pszParmName, const char *pszParmValue);\n");
$file->("\tvoid (*dump)(FILE *f, bool show_defaults, int maxtoprint);\n");
- $file->("\tint (*server_role)(void);\n");
- $file->("\tint (*security)(void);\n");
}
sub print_footer($$)
diff --git a/source3/include/proto.h b/source3/include/proto.h
index ddccbb73b4..0b4f093537 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1191,6 +1191,10 @@ bool lp_getwd_cache(void);
int lp_srv_maxprotocol(void);
int lp_srv_minprotocol(void);
int lp_security(void);
+int lp__server_role(void);
+int lp__security(void);
+int lp__domain_master(void);
+bool lp__domain_logons(void);
const char **lp_auth_methods(void);
bool lp_paranoid_server_security(void);
int lp_maxdisksize(void);
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index bee204b9c7..39097395de 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -116,7 +116,6 @@ static bool defaults_saved = false;
char *szPrintcapname; \
int CupsEncrypt; \
int iPreferredMaster; \
- int domain_master; \
char *szLdapMachineSuffix; \
char *szLdapUserSuffix; \
char *szLdapIdmapSuffix; \
@@ -5197,7 +5196,6 @@ 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_BOOL(domain_logons, bDomainLogons)
static FN_GLOBAL_BOOL(_readraw, bReadRaw)
static FN_GLOBAL_BOOL(_writeraw, bWriteRaw)
@@ -5264,7 +5262,6 @@ int lp_cups_encrypt(void)
/* These functions remain in source3/param for now */
-FN_GLOBAL_INTEGER(security, security)
FN_GLOBAL_STRING(configfile, szConfigFile)
#include "lib/param/param_functions.c"
@@ -9555,7 +9552,13 @@ bool lp_readraw(void)
int lp_server_role(void)
{
return lp_find_server_role(lp__server_role(),
- lp_security(),
- lp_domain_logons(),
+ lp__security(),
+ lp__domain_logons(),
lp_domain_master_true_or_auto());
}
+
+int lp_security(void)
+{
+ return lp_find_security(lp__server_role(),
+ lp__security());
+}
diff --git a/source3/param/loadparm_ctx.c b/source3/param/loadparm_ctx.c
index 9c78f15879..75f7e38957 100644
--- a/source3/param/loadparm_ctx.c
+++ b/source3/param/loadparm_ctx.c
@@ -73,8 +73,10 @@ static const struct loadparm_s3_helpers s3_fns =
.set_cmdline = lp_set_cmdline,
.dump = lp_dump,
- .server_role = lp_server_role,
- .security = lp_security,
+ ._server_role = lp__server_role,
+ ._security = lp__security,
+ ._domain_master = lp__domain_master,
+ ._domain_logons = lp__domain_logons,
.winbind_separator = lp_winbind_separator,
.template_homedir = lp_template_homedir,