#include <cups/http.h>
#endif
-#ifdef CLUSTER_SUPPORT
-#include "ctdb_private.h"
-#endif
-
bool bLoaded = false;
extern userdom_struct current_user_info;
static bool defaults_saved = false;
-#define LOADPARM_EXTRA_GLOBALS \
- struct parmlist_entry *param_opt; \
- char *realm_original; \
- char *loglevel; \
- int iminreceivefile; \
- char *szPrintcapname; \
- int CupsEncrypt; \
- int iPreferredMaster; \
- char *szLdapMachineSuffix; \
- char *szLdapUserSuffix; \
- char *szLdapIdmapSuffix; \
- char *szLdapGroupSuffix; \
- char *szStateDir; \
- char *szCacheDir; \
- char *szUsershareTemplateShare; \
- char *szIdmapUID; \
- char *szIdmapGID; \
- char *szIdmapBackend; \
- int winbindMaxDomainConnections; \
- int ismb2_max_credits; \
- char *tls_keyfile; \
- char *tls_certfile; \
- char *tls_cafile; \
- char *tls_crlfile; \
- char *tls_dhpfile;
-
-#include "param/param_global.h"
+#include "lib/param/param_global.h"
static struct loadparm_global Globals;
.szInclude = NULL,
.preexec = NULL,
.postexec = NULL,
- .rootpreexec = NULL,
- .rootpostexec = NULL,
+ .root_preexec = NULL,
+ .root_postexec = NULL,
.cups_options = NULL,
- .printcommand = NULL,
- .lpqcommand = NULL,
- .lprmcommand = NULL,
- .lppausecommand = NULL,
- .lpresumecommand = NULL,
- .queuepausecommand = NULL,
- .queueresumecommand = NULL,
+ .print_command = NULL,
+ .lpq_command = NULL,
+ .lprm_command = NULL,
+ .lppause_command = NULL,
+ .lpresume_command = NULL,
+ .queuepause_command = NULL,
+ .queueresume_command = NULL,
._printername = NULL,
.printjob_username = NULL,
.dont_descend = NULL,
.hosts_allow = NULL,
.hosts_deny = NULL,
- .magicscript = NULL,
- .magicoutput = NULL,
+ .magic_script = NULL,
+ .magic_output = NULL,
.veto_files = NULL,
.hide_files = NULL,
.veto_oplock_files = NULL,
.comment = NULL,
.force_user = NULL,
.force_group = NULL,
- .readlist = NULL,
- .writelist = NULL,
+ .read_list = NULL,
+ .write_list = NULL,
.volume = NULL,
.fstype = NULL,
.vfs_objects = NULL,
.msdfs_proxy = NULL,
.aio_write_behind = NULL,
.dfree_command = NULL,
- .minprintspace = 0,
+ .min_print_space = 0,
.iMaxPrintJobs = 1000,
- .max_reported_jobs = 0,
+ .max_reported_print_jobs = 0,
.write_cache_size = 0,
.create_mask = 0744,
.force_create_mode = 0,
.block_size = 1024,
.dfree_cache_time = 0,
.preexec_close = false,
- .rootpreexec_close = false,
+ .root_preexec_close = false,
.case_sensitive = Auto,
.preserve_case = true,
.short_preserve_case = true,
.oplocks = true,
.kernel_oplocks = false,
.level2_oplocks = true,
- .onlyuser = false,
+ .only_user = false,
.mangled_names = true,
.bWidelinks = false,
.follow_symlinks = true,
- .syncalways = false,
+ .sync_always = false,
.strict_allocate = false,
.strict_sync = false,
.mangling_char = '~',
.dos_filetime_resolution = false,
.fake_directory_create_times = false,
.blocking_locks = true,
- .inherit_perms = false,
+ .inherit_permissions = false,
.inherit_acls = false,
.inherit_owner = false,
.msdfs_root = false,
case PRINT_AIX:
case PRINT_LPRNT:
case PRINT_LPROS2:
- string_set(&pService->lpqcommand, "lpq -P'%p'");
- string_set(&pService->lprmcommand, "lprm -P'%p' %j");
- string_set(&pService->printcommand, "lpr -r -P'%p' %s");
+ string_set(&pService->lpq_command, "lpq -P'%p'");
+ string_set(&pService->lprm_command, "lprm -P'%p' %j");
+ string_set(&pService->print_command, "lpr -r -P'%p' %s");
break;
case PRINT_LPRNG:
case PRINT_PLP:
- string_set(&pService->lpqcommand, "lpq -P'%p'");
- string_set(&pService->lprmcommand, "lprm -P'%p' %j");
- string_set(&pService->printcommand, "lpr -r -P'%p' %s");
- string_set(&pService->queuepausecommand, "lpc stop '%p'");
- string_set(&pService->queueresumecommand, "lpc start '%p'");
- string_set(&pService->lppausecommand, "lpc hold '%p' %j");
- string_set(&pService->lpresumecommand, "lpc release '%p' %j");
+ string_set(&pService->lpq_command, "lpq -P'%p'");
+ string_set(&pService->lprm_command, "lprm -P'%p' %j");
+ string_set(&pService->print_command, "lpr -r -P'%p' %s");
+ string_set(&pService->queuepause_command, "lpc stop '%p'");
+ string_set(&pService->queueresume_command, "lpc start '%p'");
+ string_set(&pService->lppause_command, "lpc hold '%p' %j");
+ string_set(&pService->lpresume_command, "lpc release '%p' %j");
break;
case PRINT_CUPS:
case PRINT_IPRINT:
/* set the lpq command to contain the destination printer
name only. This is used by cups_queue_get() */
- string_set(&pService->lpqcommand, "%p");
- string_set(&pService->lprmcommand, "");
- string_set(&pService->printcommand, "");
- string_set(&pService->lppausecommand, "");
- string_set(&pService->lpresumecommand, "");
- string_set(&pService->queuepausecommand, "");
- string_set(&pService->queueresumecommand, "");
+ string_set(&pService->lpq_command, "%p");
+ string_set(&pService->lprm_command, "");
+ string_set(&pService->print_command, "");
+ string_set(&pService->lppause_command, "");
+ string_set(&pService->lpresume_command, "");
+ string_set(&pService->queuepause_command, "");
+ string_set(&pService->queueresume_command, "");
break;
case PRINT_SYSV:
case PRINT_HPUX:
- string_set(&pService->lpqcommand, "lpstat -o%p");
- string_set(&pService->lprmcommand, "cancel %p-%j");
- string_set(&pService->printcommand, "lp -c -d%p %s; rm %s");
- string_set(&pService->queuepausecommand, "disable %p");
- string_set(&pService->queueresumecommand, "enable %p");
+ string_set(&pService->lpq_command, "lpstat -o%p");
+ string_set(&pService->lprm_command, "cancel %p-%j");
+ string_set(&pService->print_command, "lp -c -d%p %s; rm %s");
+ string_set(&pService->queuepause_command, "disable %p");
+ string_set(&pService->queueresume_command, "enable %p");
#ifndef HPUX
- string_set(&pService->lppausecommand, "lp -i %p-%j -H hold");
- string_set(&pService->lpresumecommand, "lp -i %p-%j -H resume");
+ string_set(&pService->lppause_command, "lp -i %p-%j -H hold");
+ string_set(&pService->lpresume_command, "lp -i %p-%j -H resume");
#endif /* HPUX */
break;
case PRINT_QNX:
- string_set(&pService->lpqcommand, "lpq -P%p");
- string_set(&pService->lprmcommand, "lprm -P%p %j");
- string_set(&pService->printcommand, "lp -r -P%p %s");
+ string_set(&pService->lpq_command, "lpq -P%p");
+ string_set(&pService->lprm_command, "lprm -P%p %j");
+ string_set(&pService->print_command, "lp -r -P%p %s");
break;
#if defined(DEVELOPER) || defined(ENABLE_SELFTEST)
tmp = talloc_asprintf(tmp_ctx, "vlp %s print %%p %%s",
tdbfile);
- string_set(&pService->printcommand,
+ string_set(&pService->print_command,
tmp ? tmp : "vlp print %p %s");
tmp = talloc_asprintf(tmp_ctx, "vlp %s lpq %%p",
tdbfile);
- string_set(&pService->lpqcommand,
+ string_set(&pService->lpq_command,
tmp ? tmp : "vlp lpq %p");
tmp = talloc_asprintf(tmp_ctx, "vlp %s lprm %%p %%j",
tdbfile);
- string_set(&pService->lprmcommand,
+ string_set(&pService->lprm_command,
tmp ? tmp : "vlp lprm %p %j");
tmp = talloc_asprintf(tmp_ctx, "vlp %s lppause %%p %%j",
tdbfile);
- string_set(&pService->lppausecommand,
+ string_set(&pService->lppause_command,
tmp ? tmp : "vlp lppause %p %j");
tmp = talloc_asprintf(tmp_ctx, "vlp %s lpresume %%p %%j",
tdbfile);
- string_set(&pService->lpresumecommand,
+ string_set(&pService->lpresume_command,
tmp ? tmp : "vlp lpresume %p %j");
tmp = talloc_asprintf(tmp_ctx, "vlp %s queuepause %%p",
tdbfile);
- string_set(&pService->queuepausecommand,
+ string_set(&pService->queuepause_command,
tmp ? tmp : "vlp queuepause %p");
tmp = talloc_asprintf(tmp_ctx, "vlp %s queueresume %%p",
tdbfile);
- string_set(&pService->queueresumecommand,
+ string_set(&pService->queueresume_command,
tmp ? tmp : "vlp queueresume %p");
TALLOC_FREE(tmp_ctx);
string_set(&Globals.passwd_program, "");
string_set(&Globals.lock_directory, get_dyn_LOCKDIR());
- string_set(&Globals.szStateDir, get_dyn_STATEDIR());
- string_set(&Globals.szCacheDir, get_dyn_CACHEDIR());
+ string_set(&Globals.state_directory, get_dyn_STATEDIR());
+ string_set(&Globals.cache_directory, get_dyn_CACHEDIR());
string_set(&Globals.pid_directory, get_dyn_PIDDIR());
string_set(&Globals.nbt_client_socket_address, "0.0.0.0");
/*
/* Was 65535 (0xFFFF). 0x4101 matches W2K and causes major speed improvements... */
/* Discovered by 2 days of pain by Don McCall @ HP :-). */
Globals.max_xmit = 0x4104;
- Globals.maxmux = 50; /* This is *needed* for profile support. */
- Globals.lpqcachetime = 30; /* changed to handle large print servers better -- jerry */
+ Globals.max_mux = 50; /* This is *needed* for profile support. */
+ Globals.lpq_cache_time = 30; /* changed to handle large print servers better -- jerry */
Globals._disable_spoolss = false;
Globals.max_smbd_processes = 0;/* no limit specified */
- Globals.usernamelevel = 0;
+ Globals.username_level = 0;
Globals.deadtime = 0;
Globals.getwd_cache = true;
Globals.large_readwrite = true;
Globals.max_log_size = 5000;
Globals.max_open_files = max_open_files();
- Globals.srv_maxprotocol = PROTOCOL_SMB3_00;
- Globals.srv_minprotocol = PROTOCOL_LANMAN1;
- Globals.cli_maxprotocol = PROTOCOL_NT1;
- Globals.cli_minprotocol = PROTOCOL_CORE;
+ Globals.server_max_protocol = PROTOCOL_SMB3_00;
+ Globals.server_min_protocol = PROTOCOL_LANMAN1;
+ Globals.client_max_protocol = PROTOCOL_NT1;
+ Globals.client_min_protocol = PROTOCOL_CORE;
Globals._security = SEC_AUTO;
- Globals.encrypted_passwords = true;
+ Globals.encrypt_passwords = true;
Globals.client_schannel = Auto;
Globals.winbind_sealed_pipes = true;
Globals.require_strong_key = true;
Globals.server_schannel = Auto;
- Globals.bReadRaw = true;
- Globals.bWriteRaw = true;
+ Globals.read_raw = true;
+ Globals.write_raw = true;
Globals.null_passwords = false;
+ Globals.old_password_allowed_period = 60;
Globals.obey_pam_restrictions = false;
Globals.syslog = 1;
Globals.syslog_only = false;
Globals.timestamp_logs = true;
- string_set(&Globals.loglevel, "0");
+ string_set(&Globals.log_level, "0");
Globals.debug_prefix_timestamp = false;
Globals.debug_hires_timestamp = true;
Globals.debug_pid = false;
Globals.lm_announce = Auto; /* = Auto: send only if LM clients found */
Globals.lm_interval = 60;
#if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT))
- Globals.nis_home_map = false;
+ Globals.nis_homedir = false;
#ifdef WITH_NISPLUS_HOME
string_set(&Globals.homedir_map, "auto_home.org_dir");
#else
*/
- Globals.ms_add_printer_wizard = true;
+ Globals.show_add_printer_wizard = true;
Globals.os_level = 20;
Globals.local_master = true;
Globals._domain_master = Auto; /* depending on _domain_logons */
string_set(&Globals.cups_server, "");
string_set(&Globals.iprint_server, "");
-#ifdef CLUSTER_SUPPORT
- string_set(&Globals.ctdbd_socket, CTDB_PATH);
-#else
- string_set(&Globals.ctdbd_socket, "");
-#endif
+ string_set(&Globals._ctdbd_socket, "");
Globals.cluster_addresses = NULL;
Globals.clustering = false;
}
string_set(&Globals.usershare_path, s);
SAFE_FREE(s);
- string_set(&Globals.szUsershareTemplateShare, "");
+ string_set(&Globals.usershare_template_share, "");
Globals.usershare_max_shares = 0;
/* By default disallow sharing of directories not owned by the sharer. */
Globals.usershare_owner_only = true;
Globals.tls_enabled = true;
- string_set(&Globals.tls_keyfile, "tls/key.pem");
- string_set(&Globals.tls_certfile, "tls/cert.pem");
- string_set(&Globals.tls_cafile, "tls/ca.pem");
+ string_set(&Globals._tls_keyfile, "tls/key.pem");
+ string_set(&Globals._tls_certfile, "tls/cert.pem");
+ string_set(&Globals._tls_cafile, "tls/ca.pem");
string_set(&Globals.share_backend, "classic");
callers without affecting the source string.
********************************************************************/
-static char *lp_string(TALLOC_CTX *ctx, const char *s)
+char *lp_string(TALLOC_CTX *ctx, const char *s)
{
char *ret;
#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_BOOL(_readraw, bReadRaw)
-static FN_GLOBAL_BOOL(_writeraw, bWriteRaw)
-
-/* If lp_statedir() and lp_cachedir() are explicitely set during the
- * build process or in smb.conf, we use that value. Otherwise they
- * default to the value of lp_lock_directory(). */
-const char *lp_statedir(void) {
- if ((strcmp(get_dyn_STATEDIR(), get_dyn_LOCKDIR()) != 0) ||
- (strcmp(get_dyn_STATEDIR(), Globals.szStateDir) != 0))
- return(*(char **)(&Globals.szStateDir) ?
- *(char **)(&Globals.szStateDir) : "");
- else
- return(*(char **)(&Globals.lock_directory) ?
- *(char **)(&Globals.lock_directory) : "");
-}
-const char *lp_cachedir(void) {
- if ((strcmp(get_dyn_CACHEDIR(), get_dyn_LOCKDIR()) != 0) ||
- (strcmp(get_dyn_CACHEDIR(), Globals.szCacheDir) != 0))
- return(*(char **)(&Globals.szCacheDir) ?
- *(char **)(&Globals.szCacheDir) : "");
- else
- return(*(char **)(&Globals.lock_directory) ?
- *(char **)(&Globals.lock_directory) : "");
-}
static FN_GLOBAL_INTEGER(winbind_max_domain_connections_int,
winbindMaxDomainConnections)
/* These functions remain in source3/param for now */
-FN_GLOBAL_STRING(configfile, szConfigFile)
-
#include "lib/param/param_functions.c"
FN_LOCAL_STRING(servicename, szService)
FN_LOCAL_CONST_STRING(const_servicename, szService)
+/* These functions cannot be auto-generated */
+FN_LOCAL_BOOL(autoloaded, autoloaded)
+
/* local prototypes */
static int map_parameter_canonical(const char *pszParmName, bool *inverse);
}
/* Ensure the template share exists if it's set. */
- if (Globals.szUsershareTemplateShare[0]) {
+ if (Globals.usershare_template_share[0]) {
/* We can't use lp_servicenumber here as we are recommending that
template shares have -valid=false set. */
for (snum_template = iNumServices - 1; snum_template >= 0; snum_template--) {
if (ServicePtrs[snum_template]->szService &&
strequal(ServicePtrs[snum_template]->szService,
- Globals.szUsershareTemplateShare)) {
+ Globals.usershare_template_share)) {
break;
}
}
if (snum_template == -1) {
DEBUG(0,("load_usershare_service: usershare template share %s "
"does not exist.\n",
- Globals.szUsershareTemplateShare ));
+ Globals.usershare_template_share ));
return -1;
}
}
}
/* Ensure the template share exists if it's set. */
- if (Globals.szUsershareTemplateShare[0]) {
+ if (Globals.usershare_template_share[0]) {
/* We can't use lp_servicenumber here as we are recommending that
template shares have -valid=false set. */
for (snum_template = iNumServices - 1; snum_template >= 0; snum_template--) {
if (ServicePtrs[snum_template]->szService &&
strequal(ServicePtrs[snum_template]->szService,
- Globals.szUsershareTemplateShare)) {
+ Globals.usershare_template_share)) {
break;
}
}
if (snum_template == -1) {
DEBUG(0,("load_usershare_shares: usershare template share %s "
"does not exist.\n",
- Globals.szUsershareTemplateShare ));
+ Globals.usershare_template_share ));
return ret;
}
}
if (Globals.iminreceivefile < 0) {
return 0;
}
- return MIN(Globals.iminreceivefile, BUFFER_SIZE);
+ return Globals.iminreceivefile;
}
/*******************************************************************
return lp_widelinks_internal(snum);
}
-bool lp_writeraw(void)
-{
- if (lp_async_smb_echo_handler()) {
- return false;
- }
- return lp__writeraw();
-}
-
-bool lp_readraw(void)
-{
- if (lp_async_smb_echo_handler()) {
- return false;
- }
- return lp__readraw();
-}
-
int lp_server_role(void)
{
return lp_find_server_role(lp__server_role(),
return lp_find_security(lp__server_role(),
lp__security());
}
+
+struct loadparm_global * get_globals(void)
+{
+ return &Globals;
+}