mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
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
This commit is contained in:
parent
b62b031815
commit
3367fd01d4
@ -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));
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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($$)
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user