summaryrefslogtreecommitdiff
path: root/lib/param
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 /lib/param
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
Diffstat (limited to 'lib/param')
-rw-r--r--lib/param/loadparm.c27
-rw-r--r--lib/param/param_functions.c5
2 files changed, 13 insertions, 19 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)