summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/generic.c8
-rw-r--r--source4/param/loadparm.c788
-rw-r--r--source4/param/param.h388
-rw-r--r--source4/param/provision.c6
-rw-r--r--source4/param/pyparam.c48
-rw-r--r--source4/param/pyparam.h2
-rw-r--r--source4/param/pyparam_util.c8
-rw-r--r--source4/param/secrets.c2
-rw-r--r--source4/param/share_classic.c74
-rw-r--r--source4/param/share_ldb.c2
-rw-r--r--source4/param/tests/loadparm.c66
-rw-r--r--source4/param/util.c42
12 files changed, 752 insertions, 682 deletions
diff --git a/source4/param/generic.c b/source4/param/generic.c
index 29b97bc09e..8becffbce5 100644
--- a/source4/param/generic.c
+++ b/source4/param/generic.c
@@ -233,14 +233,14 @@ int param_use(struct loadparm_context *lp_ctx, struct param_context *ctx)
bool isglobal = strcmp(section->name, "global") == 0;
for (param = section->parameters->entries; param; param = param->next) {
if (isglobal)
- lp_do_global_parameter(lp_ctx, param->key,
+ lpcfg_do_global_parameter(lp_ctx, param->key,
param->value);
else {
struct loadparm_service *service =
- lp_service(lp_ctx, section->name);
+ lpcfg_service(lp_ctx, section->name);
if (service == NULL)
- service = lp_add_service(lp_ctx, lp_default_service(lp_ctx), section->name);
- lp_do_service_parameter(lp_ctx, service, param->key, param->value);
+ service = lpcfg_add_service(lp_ctx, lpcfg_default_service(lp_ctx), section->name);
+ lpcfg_do_service_parameter(lp_ctx, service, param->key, param->value);
}
}
}
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 8c0f7d4d24..9d3c532458 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -534,7 +534,7 @@ struct loadparm_context {
};
-struct loadparm_service *lp_default_service(struct loadparm_context *lp_ctx)
+struct loadparm_service *lpcfg_default_service(struct loadparm_context *lp_ctx)
{
return lp_ctx->sDefault;
}
@@ -542,7 +542,7 @@ struct loadparm_service *lp_default_service(struct loadparm_context *lp_ctx)
/*
return the parameter table
*/
-struct parm_struct *lp_parm_table(void)
+struct parm_struct *lpcfg_parm_table(void)
{
return parm_table;
}
@@ -601,161 +601,177 @@ static const char *lp_string(const char *s)
parameters from the rest of the program are defined
*/
+/*
+ * the creation of separate lpcfg_*() and lp_*() functions is to allow
+ * for code compatibility between existing Samba4 and Samba3 code.
+ */
+
+/* this global context supports the lp_*() function varients */
+static struct loadparm_context *global_loadparm_context;
+
+#define lpcfg_default_service global_loadparm_context->sDefault
+#define lpcfg_global_service(i) global_loadparm_context->services[i]
+
#define FN_GLOBAL_STRING(fn_name,var_name) \
- const char *fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return NULL; return lp_ctx->globals->var_name ? lp_string(lp_ctx->globals->var_name) : "";}
+ _PUBLIC_ const char *lpcfg_ ## fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return NULL; return lp_ctx->globals->var_name ? lp_string(lp_ctx->globals->var_name) : "";} \
+ _PUBLIC_ const char *lp_ ## fn_name(void) { return lpcfg_ ## fn_name(global_loadparm_context); }
+
#define FN_GLOBAL_CONST_STRING(fn_name,var_name) \
- const char *fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return NULL; return lp_ctx->globals->var_name ? lp_ctx->globals->var_name : "";}
+ _PUBLIC_ const char *lpcfg_ ## fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return NULL; return lp_ctx->globals->var_name ? lp_ctx->globals->var_name : "";} \
+ _PUBLIC_ const char *lp_ ## fn_name(void) { return lpcfg_ ## fn_name(global_loadparm_context); }
+
#define FN_GLOBAL_LIST(fn_name,var_name) \
- const char **fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return NULL; return lp_ctx->globals->var_name;}
+ _PUBLIC_ const char **lpcfg_ ## fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return NULL; return lp_ctx->globals->var_name;} \
+ _PUBLIC_ const char **lp_ ## fn_name(void) { return lpcfg_ ## fn_name(global_loadparm_context); }
+
#define FN_GLOBAL_BOOL(fn_name,var_name) \
- bool fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return false; return lp_ctx->globals->var_name;}
-#if 0 /* unused */
-#define FN_GLOBAL_CHAR(fn_name,ptr) \
- char fn_name(void) {return(*(char *)(ptr));}
-#endif
+ _PUBLIC_ bool lpcfg_ ## fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return false; return lp_ctx->globals->var_name;} \
+ _PUBLIC_ bool lp_ ## fn_name(void) { return lpcfg_ ## fn_name(global_loadparm_context); }
+
#define FN_GLOBAL_INTEGER(fn_name,var_name) \
- int fn_name(struct loadparm_context *lp_ctx) {return lp_ctx->globals->var_name;}
+ _PUBLIC_ int lpcfg_ ## fn_name(struct loadparm_context *lp_ctx) {return lp_ctx->globals->var_name;} \
+ _PUBLIC_ int lp_ ## fn_name(void) { return lpcfg_ ## fn_name(global_loadparm_context); }
#define FN_LOCAL_STRING(fn_name,val) \
- const char *fn_name(struct loadparm_service *service, struct loadparm_service *sDefault) {return(lp_string((const char *)((service != NULL && service->val != NULL) ? service->val : sDefault->val)));}
+ _PUBLIC_ const char *lpcfg_ ## fn_name(struct loadparm_service *service, struct loadparm_service *sDefault) {return(lp_string((const char *)((service != NULL && service->val != NULL) ? service->val : sDefault->val)));} \
+ _PUBLIC_ const char *lp_ ## fn_name(int i) { return lpcfg_ ## fn_name(lpcfg_global_service(i), lpcfg_default_service); }
+
#define FN_LOCAL_LIST(fn_name,val) \
- const char **fn_name(struct loadparm_service *service, struct loadparm_service *sDefault) {return(const char **)(service != NULL && service->val != NULL? service->val : sDefault->val);}
+ _PUBLIC_ const char **lpcfg_ ## fn_name(struct loadparm_service *service, struct loadparm_service *sDefault) {return(const char **)(service != NULL && service->val != NULL? service->val : sDefault->val);} \
+ _PUBLIC_ const char **lp_ ## fn_name(int i) { return lpcfg_ ## fn_name(lpcfg_global_service(i), lpcfg_default_service); }
+
#define FN_LOCAL_BOOL(fn_name,val) \
- bool fn_name(struct loadparm_service *service, struct loadparm_service *sDefault) {return((service != NULL)? service->val : sDefault->val);}
-#define FN_LOCAL_INTEGER(fn_name,val) \
- int fn_name(struct loadparm_service *service, struct loadparm_service *sDefault) {return((service != NULL)? service->val : sDefault->val);}
-
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_server_role, server_role)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_sid_generator, sid_generator)
-_PUBLIC_ FN_GLOBAL_LIST(lp_smb_ports, smb_ports)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_nbt_port, nbt_port)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_dgram_port, dgram_port)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_cldap_port, cldap_port)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_krb5_port, krb5_port)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_kpasswd_port, kpasswd_port)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_web_port, web_port)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_tls_enabled, tls_enabled)
-_PUBLIC_ FN_GLOBAL_STRING(lp_share_backend, szShareBackend)
-_PUBLIC_ FN_GLOBAL_STRING(lp_sam_url, szSAM_URL)
-_PUBLIC_ FN_GLOBAL_STRING(lp_idmap_url, szIDMAP_URL)
-_PUBLIC_ FN_GLOBAL_STRING(lp_secrets_url, szSECRETS_URL)
-_PUBLIC_ FN_GLOBAL_STRING(lp_spoolss_url, szSPOOLSS_URL)
-_PUBLIC_ FN_GLOBAL_STRING(lp_wins_config_url, szWINS_CONFIG_URL)
-_PUBLIC_ FN_GLOBAL_STRING(lp_wins_url, szWINS_URL)
-_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_winbind_separator, szWinbindSeparator)
-_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_winbindd_socket_directory, szWinbinddSocketDirectory)
-_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_winbindd_privileged_socket_directory, szWinbinddPrivilegedSocketDirectory)
-_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_template_shell, szTemplateShell)
-_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_template_homedir, szTemplateHomedir)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_winbind_sealed_pipes, bWinbindSealedPipes)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_idmap_trusted_only, bIdmapTrustedOnly)
-_PUBLIC_ FN_GLOBAL_STRING(lp_private_dir, szPrivateDir)
-_PUBLIC_ FN_GLOBAL_STRING(lp_serverstring, szServerString)
-_PUBLIC_ FN_GLOBAL_STRING(lp_lockdir, szLockDir)
-_PUBLIC_ FN_GLOBAL_STRING(lp_modulesdir, szModulesDir)
-_PUBLIC_ FN_GLOBAL_STRING(lp_setupdir, szSetupDir)
-_PUBLIC_ FN_GLOBAL_STRING(lp_ncalrpc_dir, ncalrpc_dir)
-_PUBLIC_ FN_GLOBAL_STRING(lp_dos_charset, dos_charset)
-_PUBLIC_ FN_GLOBAL_STRING(lp_unix_charset, unix_charset)
-_PUBLIC_ FN_GLOBAL_STRING(lp_display_charset, display_charset)
-_PUBLIC_ FN_GLOBAL_STRING(lp_piddir, szPidDir)
-_PUBLIC_ FN_GLOBAL_LIST(lp_rndc_command, szRNDCCommand)
-_PUBLIC_ FN_GLOBAL_LIST(lp_dns_update_command, szDNSUpdateCommand)
-_PUBLIC_ FN_GLOBAL_LIST(lp_spn_update_command, szSPNUpdateCommand)
-_PUBLIC_ FN_GLOBAL_STRING(lp_nsupdate_command, szNSUpdateCommand)
-_PUBLIC_ FN_GLOBAL_LIST(lp_dcerpc_endpoint_servers, dcerpc_ep_servers)
-_PUBLIC_ FN_GLOBAL_LIST(lp_server_services, server_services)
-_PUBLIC_ FN_GLOBAL_STRING(lp_ntptr_providor, ntptr_providor)
-_PUBLIC_ FN_GLOBAL_STRING(lp_auto_services, szAutoServices)
-_PUBLIC_ FN_GLOBAL_STRING(lp_passwd_chat, szPasswdChat)
-_PUBLIC_ FN_GLOBAL_LIST(lp_passwordserver, szPasswordServers)
-_PUBLIC_ FN_GLOBAL_LIST(lp_name_resolve_order, szNameResolveOrder)
-_PUBLIC_ FN_GLOBAL_STRING(lp_realm, szRealm_upper)
-_PUBLIC_ FN_GLOBAL_STRING(lp_dnsdomain, szRealm_lower)
-_PUBLIC_ FN_GLOBAL_STRING(lp_socket_options, socket_options)
-_PUBLIC_ FN_GLOBAL_STRING(lp_workgroup, szWorkgroup)
-_PUBLIC_ FN_GLOBAL_STRING(lp_netbios_name, szNetbiosName)
-_PUBLIC_ FN_GLOBAL_STRING(lp_netbios_scope, szNetbiosScope)
-_PUBLIC_ FN_GLOBAL_LIST(lp_wins_server_list, szWINSservers)
-_PUBLIC_ FN_GLOBAL_LIST(lp_interfaces, szInterfaces)
-_PUBLIC_ FN_GLOBAL_STRING(lp_socket_address, szSocketAddress)
-_PUBLIC_ FN_GLOBAL_LIST(lp_netbios_aliases, szNetbiosAliases)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_disable_netbios, bDisableNetbios)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_wins_support, bWINSsupport)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_wins_dns_proxy, bWINSdnsProxy)
-_PUBLIC_ FN_GLOBAL_STRING(lp_wins_hook, szWINSHook)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_local_master, bLocalMaster)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_readraw, bReadRaw)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_large_readwrite, bLargeReadwrite)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_writeraw, bWriteRaw)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_null_passwords, bNullPasswords)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_obey_pam_restrictions, bObeyPamRestrictions)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_encrypted_passwords, bEncryptPasswords)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_time_server, bTimeServer)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_bind_interfaces_only, bBindInterfacesOnly)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_unicode, bUnicode)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_nt_status_support, bNTStatusSupport)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_lanman_auth, bLanmanAuth)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_ntlm_auth, bNTLMAuth)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_client_plaintext_auth, bClientPlaintextAuth)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_client_lanman_auth, bClientLanManAuth)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_client_ntlmv2_auth, bClientNTLMv2Auth)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_client_use_spnego_principal, client_use_spnego_principal)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_host_msdfs, bHostMSDfs)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_unix_extensions, bUnixExtensions)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_use_spnego, bUseSpnego)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_rpc_big_endian, bRpcBigEndian)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_max_wins_ttl, max_wins_ttl)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_min_wins_ttl, min_wins_ttl)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_maxmux, max_mux)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_max_xmit, max_xmit)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_passwordlevel, pwordlevel)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_srv_maxprotocol, srv_maxprotocol)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_srv_minprotocol, srv_minprotocol)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_cli_maxprotocol, cli_maxprotocol)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_cli_minprotocol, cli_minprotocol)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_security, security)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_paranoid_server_security, paranoid_server_security)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_announce_as, announce_as)
-
-const char *lp_servicename(const struct loadparm_service *service)
-{
- return lp_string((const char *)service->szService);
-}
+ _PUBLIC_ bool lpcfg_ ## fn_name(struct loadparm_service *service, struct loadparm_service *sDefault) {return((service != NULL)? service->val : sDefault->val);} \
+ _PUBLIC_ bool lp_ ## fn_name(int i) { return lpcfg_ ## fn_name(lpcfg_global_service(i), lpcfg_default_service); }
-_PUBLIC_ FN_LOCAL_STRING(lp_pathname, szPath)
-static FN_LOCAL_STRING(_lp_printername, szPrintername)
-_PUBLIC_ FN_LOCAL_LIST(lp_hostsallow, szHostsallow)
-_PUBLIC_ FN_LOCAL_LIST(lp_hostsdeny, szHostsdeny)
-_PUBLIC_ FN_LOCAL_STRING(lp_comment, comment)
-_PUBLIC_ FN_LOCAL_STRING(lp_fstype, fstype)
-static FN_LOCAL_STRING(lp_volume, volume)
-_PUBLIC_ FN_LOCAL_LIST(lp_ntvfs_handler, ntvfs_handler)
-_PUBLIC_ FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot)
-_PUBLIC_ FN_LOCAL_BOOL(lp_browseable, bBrowseable)
-_PUBLIC_ FN_LOCAL_BOOL(lp_readonly, bRead_only)
-_PUBLIC_ FN_LOCAL_BOOL(lp_print_ok, bPrint_ok)
-_PUBLIC_ FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden)
-_PUBLIC_ FN_LOCAL_BOOL(lp_map_archive, bMap_archive)
-_PUBLIC_ FN_LOCAL_BOOL(lp_strict_locking, bStrictLocking)
-_PUBLIC_ FN_LOCAL_BOOL(lp_oplocks, bOplocks)
-_PUBLIC_ FN_LOCAL_BOOL(lp_strict_sync, bStrictSync)
-_PUBLIC_ FN_LOCAL_BOOL(lp_ci_filesystem, bCIFileSystem)
-_PUBLIC_ FN_LOCAL_BOOL(lp_map_system, bMap_system)
-_PUBLIC_ FN_LOCAL_INTEGER(lp_max_connections, iMaxConnections)
-_PUBLIC_ FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy)
-_PUBLIC_ FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask)
-_PUBLIC_ FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode)
-_PUBLIC_ FN_LOCAL_INTEGER(lp_dir_mask, iDir_mask)
-_PUBLIC_ FN_LOCAL_INTEGER(lp_force_dir_mode, iDir_force_mode)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_server_signing, server_signing)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_client_signing, client_signing)
-
-_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_ntp_signd_socket_directory, szNTPSignDSocketDirectory)
+#define FN_LOCAL_INTEGER(fn_name,val) \
+ _PUBLIC_ int lpcfg_ ## fn_name(struct loadparm_service *service, struct loadparm_service *sDefault) {return((service != NULL)? service->val : sDefault->val);} \
+ _PUBLIC_ int lp_ ## fn_name(int i) { return lpcfg_ ## fn_name(lpcfg_global_service(i), lpcfg_default_service); }
+
+FN_GLOBAL_INTEGER(server_role, server_role)
+FN_GLOBAL_INTEGER(sid_generator, sid_generator)
+FN_GLOBAL_LIST(smb_ports, smb_ports)
+FN_GLOBAL_INTEGER(nbt_port, nbt_port)
+FN_GLOBAL_INTEGER(dgram_port, dgram_port)
+FN_GLOBAL_INTEGER(cldap_port, cldap_port)
+FN_GLOBAL_INTEGER(krb5_port, krb5_port)
+FN_GLOBAL_INTEGER(kpasswd_port, kpasswd_port)
+FN_GLOBAL_INTEGER(web_port, web_port)
+FN_GLOBAL_BOOL(tls_enabled, tls_enabled)
+FN_GLOBAL_STRING(share_backend, szShareBackend)
+FN_GLOBAL_STRING(sam_url, szSAM_URL)
+FN_GLOBAL_STRING(idmap_url, szIDMAP_URL)
+FN_GLOBAL_STRING(secrets_url, szSECRETS_URL)
+FN_GLOBAL_STRING(spoolss_url, szSPOOLSS_URL)
+FN_GLOBAL_STRING(wins_config_url, szWINS_CONFIG_URL)
+FN_GLOBAL_STRING(wins_url, szWINS_URL)
+FN_GLOBAL_CONST_STRING(winbind_separator, szWinbindSeparator)
+FN_GLOBAL_CONST_STRING(winbindd_socket_directory, szWinbinddSocketDirectory)
+FN_GLOBAL_CONST_STRING(winbindd_privileged_socket_directory, szWinbinddPrivilegedSocketDirectory)
+FN_GLOBAL_CONST_STRING(template_shell, szTemplateShell)
+FN_GLOBAL_CONST_STRING(template_homedir, szTemplateHomedir)
+FN_GLOBAL_BOOL(winbind_sealed_pipes, bWinbindSealedPipes)
+FN_GLOBAL_BOOL(idmap_trusted_only, bIdmapTrustedOnly)
+FN_GLOBAL_STRING(private_dir, szPrivateDir)
+FN_GLOBAL_STRING(serverstring, szServerString)
+FN_GLOBAL_STRING(lockdir, szLockDir)
+FN_GLOBAL_STRING(modulesdir, szModulesDir)
+FN_GLOBAL_STRING(setupdir, szSetupDir)
+FN_GLOBAL_STRING(ncalrpc_dir, ncalrpc_dir)
+FN_GLOBAL_STRING(dos_charset, dos_charset)
+FN_GLOBAL_STRING(unix_charset, unix_charset)
+FN_GLOBAL_STRING(display_charset, display_charset)
+FN_GLOBAL_STRING(piddir, szPidDir)
+FN_GLOBAL_LIST(rndc_command, szRNDCCommand)
+FN_GLOBAL_LIST(dns_update_command, szDNSUpdateCommand)
+FN_GLOBAL_LIST(spn_update_command, szSPNUpdateCommand)
+FN_GLOBAL_STRING(nsupdate_command, szNSUpdateCommand)
+FN_GLOBAL_LIST(dcerpc_endpoint_servers, dcerpc_ep_servers)
+FN_GLOBAL_LIST(server_services, server_services)
+FN_GLOBAL_STRING(ntptr_providor, ntptr_providor)
+FN_GLOBAL_STRING(auto_services, szAutoServices)
+FN_GLOBAL_STRING(passwd_chat, szPasswdChat)
+FN_GLOBAL_LIST(passwordserver, szPasswordServers)
+FN_GLOBAL_LIST(name_resolve_order, szNameResolveOrder)
+FN_GLOBAL_STRING(realm, szRealm_upper)
+FN_GLOBAL_STRING(dnsdomain, szRealm_lower)
+FN_GLOBAL_STRING(socket_options, socket_options)
+FN_GLOBAL_STRING(workgroup, szWorkgroup)
+FN_GLOBAL_STRING(netbios_name, szNetbiosName)
+FN_GLOBAL_STRING(netbios_scope, szNetbiosScope)
+FN_GLOBAL_LIST(wins_server_list, szWINSservers)
+FN_GLOBAL_LIST(interfaces, szInterfaces)
+FN_GLOBAL_STRING(socket_address, szSocketAddress)
+FN_GLOBAL_LIST(netbios_aliases, szNetbiosAliases)
+FN_GLOBAL_BOOL(disable_netbios, bDisableNetbios)
+FN_GLOBAL_BOOL(wins_support, bWINSsupport)
+FN_GLOBAL_BOOL(wins_dns_proxy, bWINSdnsProxy)
+FN_GLOBAL_STRING(wins_hook, szWINSHook)
+FN_GLOBAL_BOOL(local_master, bLocalMaster)
+FN_GLOBAL_BOOL(readraw, bReadRaw)
+FN_GLOBAL_BOOL(large_readwrite, bLargeReadwrite)
+FN_GLOBAL_BOOL(writeraw, bWriteRaw)
+FN_GLOBAL_BOOL(null_passwords, bNullPasswords)
+FN_GLOBAL_BOOL(obey_pam_restrictions, bObeyPamRestrictions)
+FN_GLOBAL_BOOL(encrypted_passwords, bEncryptPasswords)
+FN_GLOBAL_BOOL(time_server, bTimeServer)
+FN_GLOBAL_BOOL(bind_interfaces_only, bBindInterfacesOnly)
+FN_GLOBAL_BOOL(unicode, bUnicode)
+FN_GLOBAL_BOOL(nt_status_support, bNTStatusSupport)
+FN_GLOBAL_BOOL(lanman_auth, bLanmanAuth)
+FN_GLOBAL_BOOL(ntlm_auth, bNTLMAuth)
+FN_GLOBAL_BOOL(client_plaintext_auth, bClientPlaintextAuth)
+FN_GLOBAL_BOOL(client_lanman_auth, bClientLanManAuth)
+FN_GLOBAL_BOOL(client_ntlmv2_auth, bClientNTLMv2Auth)
+FN_GLOBAL_BOOL(client_use_spnego_principal, client_use_spnego_principal)
+FN_GLOBAL_BOOL(host_msdfs, bHostMSDfs)
+FN_GLOBAL_BOOL(unix_extensions, bUnixExtensions)
+FN_GLOBAL_BOOL(use_spnego, bUseSpnego)
+FN_GLOBAL_BOOL(rpc_big_endian, bRpcBigEndian)
+FN_GLOBAL_INTEGER(max_wins_ttl, max_wins_ttl)
+FN_GLOBAL_INTEGER(min_wins_ttl, min_wins_ttl)
+FN_GLOBAL_INTEGER(maxmux, max_mux)
+FN_GLOBAL_INTEGER(max_xmit, max_xmit)
+FN_GLOBAL_INTEGER(passwordlevel, pwordlevel)
+FN_GLOBAL_INTEGER(srv_maxprotocol, srv_maxprotocol)
+FN_GLOBAL_INTEGER(srv_minprotocol, srv_minprotocol)
+FN_GLOBAL_INTEGER(cli_maxprotocol, cli_maxprotocol)
+FN_GLOBAL_INTEGER(cli_minprotocol, cli_minprotocol)
+FN_GLOBAL_INTEGER(security, security)
+FN_GLOBAL_BOOL(paranoid_server_security, paranoid_server_security)
+FN_GLOBAL_INTEGER(announce_as, announce_as)
+
+FN_LOCAL_STRING(pathname, szPath)
+FN_LOCAL_LIST(hostsallow, szHostsallow)
+FN_LOCAL_LIST(hostsdeny, szHostsdeny)
+FN_LOCAL_STRING(comment, comment)
+FN_LOCAL_STRING(fstype, fstype)
+FN_LOCAL_LIST(ntvfs_handler, ntvfs_handler)
+FN_LOCAL_BOOL(msdfs_root, bMSDfsRoot)
+FN_LOCAL_BOOL(browseable, bBrowseable)
+FN_LOCAL_BOOL(readonly, bRead_only)
+FN_LOCAL_BOOL(print_ok, bPrint_ok)
+FN_LOCAL_BOOL(map_hidden, bMap_hidden)
+FN_LOCAL_BOOL(map_archive, bMap_archive)
+FN_LOCAL_BOOL(strict_locking, bStrictLocking)
+FN_LOCAL_BOOL(oplocks, bOplocks)
+FN_LOCAL_BOOL(strict_sync, bStrictSync)
+FN_LOCAL_BOOL(ci_filesystem, bCIFileSystem)
+FN_LOCAL_BOOL(map_system, bMap_system)
+FN_LOCAL_INTEGER(max_connections, iMaxConnections)
+FN_LOCAL_INTEGER(csc_policy, iCSCPolicy)
+FN_LOCAL_INTEGER(create_mask, iCreate_mask)
+FN_LOCAL_INTEGER(force_create_mode, iCreate_force_mode)
+FN_LOCAL_INTEGER(dir_mask, iDir_mask)
+FN_LOCAL_INTEGER(force_dir_mode, iDir_force_mode)
+FN_GLOBAL_INTEGER(server_signing, server_signing)
+FN_GLOBAL_INTEGER(client_signing, client_signing)
+
+FN_GLOBAL_CONST_STRING(ntp_signd_socket_directory, szNTPSignDSocketDirectory)
/* local prototypes */
static int map_parameter(const char *pszParmName);
-static struct loadparm_service *getservicebyname(struct loadparm_context *lp_ctx,
+static struct loadparm_service *getservicebyname(struct loadparm_context *lp_ctx,
const char *pszServiceName);
static void copy_service(struct loadparm_service *pserviceDest,
struct loadparm_service *pserviceSource,
@@ -767,7 +783,7 @@ static void init_copymap(struct loadparm_service *pservice);
/* This is a helper function for parametrical options support. */
/* It returns a pointer to parametrical option value if it exists or NULL otherwise */
/* Actual parametrical functions are quite simple */
-const char *lp_get_parametric(struct loadparm_context *lp_ctx,
+const char *lpcfg_get_parametric(struct loadparm_context *lp_ctx,
struct loadparm_service *service,
const char *type, const char *option)
{
@@ -878,11 +894,11 @@ static bool lp_bool(const char *s)
* Returned value is allocated in 'lp_talloc' context
*/
-const char *lp_parm_string(struct loadparm_context *lp_ctx,
- struct loadparm_service *service, const char *type,
- const char *option)
+const char *lpcfg_parm_string(struct loadparm_context *lp_ctx,
+ struct loadparm_service *service, const char *type,
+ const char *option)
{
- const char *value = lp_get_parametric(lp_ctx, service, type, option);
+ const char *value = lpcfg_get_parametric(lp_ctx, service, type, option);
if (value)
return lp_string(value);
@@ -896,13 +912,13 @@ const char *lp_parm_string(struct loadparm_context *lp_ctx,
* Returned value is allocated in 'lp_talloc' context
*/
-const char **lp_parm_string_list(TALLOC_CTX *mem_ctx,
- struct loadparm_context *lp_ctx,
- struct loadparm_service *service,
- const char *type,
- const char *option, const char *separator)
+const char **lpcfg_parm_string_list(TALLOC_CTX *mem_ctx,
+ struct loadparm_context *lp_ctx,
+ struct loadparm_service *service,
+ const char *type,
+ const char *option, const char *separator)
{
- const char *value = lp_get_parametric(lp_ctx, service, type, option);
+ const char *value = lpcfg_get_parametric(lp_ctx, service, type, option);
if (value != NULL)
return (const char **)str_list_make(mem_ctx, value, separator);
@@ -915,11 +931,11 @@ const char **lp_parm_string_list(TALLOC_CTX *mem_ctx,
* Parametric option has following syntax: 'Type: option = value'
*/
-int lp_parm_int(struct loadparm_context *lp_ctx,
- struct loadparm_service *service, const char *type,
- const char *option, int default_v)
+int lpcfg_parm_int(struct loadparm_context *lp_ctx,
+ struct loadparm_service *service, const char *type,
+ const char *option, int default_v)
{
- const char *value = lp_get_parametric(lp_ctx, service, type, option);
+ const char *value = lpcfg_get_parametric(lp_ctx, service, type, option);
if (value)
return lp_int(value);
@@ -933,13 +949,13 @@ int lp_parm_int(struct loadparm_context *lp_ctx,
* Parametric option has following syntax: 'Type: option = value'.
*/
-int lp_parm_bytes(struct loadparm_context *lp_ctx,
+int lpcfg_parm_bytes(struct loadparm_context *lp_ctx,
struct loadparm_service *service, const char *type,
const char *option, int default_v)
{
uint64_t bval;
- const char *value = lp_get_parametric(lp_ctx, service, type, option);
+ const char *value = lpcfg_get_parametric(lp_ctx, service, type, option);
if (value && conv_str_size(value, &bval)) {
if (bval <= INT_MAX) {
@@ -955,11 +971,11 @@ int lp_parm_bytes(struct loadparm_context *lp_ctx,
* Type is a part of option before ':'
* Parametric option has following syntax: 'Type: option = value'
*/
-unsigned long lp_parm_ulong(struct loadparm_context *lp_ctx,
+unsigned long lpcfg_parm_ulong(struct loadparm_context *lp_ctx,
struct loadparm_service *service, const char *type,
const char *option, unsigned long default_v)
{
- const char *value = lp_get_parametric(lp_ctx, service, type, option);
+ const char *value = lpcfg_get_parametric(lp_ctx, service, type, option);
if (value)
return lp_ulong(value);
@@ -968,11 +984,11 @@ unsigned long lp_parm_ulong(struct loadparm_context *lp_ctx,
}
-double lp_parm_double(struct loadparm_context *lp_ctx,
+double lpcfg_parm_double(struct loadparm_context *lp_ctx,
struct loadparm_service *service, const char *type,
const char *option, double default_v)
{
- const char *value = lp_get_parametric(lp_ctx, service, type, option);
+ const char *value = lpcfg_get_parametric(lp_ctx, service, type, option);
if (value != NULL)
return lp_double(value);
@@ -985,11 +1001,11 @@ double lp_parm_double(struct loadparm_context *lp_ctx,
* Parametric option has following syntax: 'Type: option = value'
*/
-bool lp_parm_bool(struct loadparm_context *lp_ctx,
- struct loadparm_service *service, const char *type,
- const char *option, bool default_v)
+bool lpcfg_parm_bool(struct loadparm_context *lp_ctx,
+ struct loadparm_service *service, const char *type,
+ const char *option, bool default_v)
{
- const char *value = lp_get_parametric(lp_ctx, service, type, option);
+ const char *value = lpcfg_get_parametric(lp_ctx, service, type, option);
if (value != NULL)
return lp_bool(value);
@@ -1037,9 +1053,9 @@ static bool string_set(TALLOC_CTX *mem_ctx, char **dest, const char *src)
* service.
*/
-struct loadparm_service *lp_add_service(struct loadparm_context *lp_ctx,
- const struct loadparm_service *pservice,
- const char *name)
+struct loadparm_service *lpcfg_add_service(struct loadparm_context *lp_ctx,
+ const struct loadparm_service *pservice,
+ const char *name)
{
int i;
struct loadparm_service tservice;
@@ -1078,7 +1094,7 @@ struct loadparm_service *lp_add_service(struct loadparm_context *lp_ctx,
tsp = talloc_realloc(lp_ctx, lp_ctx->services, struct loadparm_service *, num_to_alloc);
if (!tsp) {
- DEBUG(0,("lp_add_service: failed to enlarge services!\n"));
+ DEBUG(0,("lpcfg_add_service: failed to enlarge services!\n"));
return NULL;
} else {
lp_ctx->services = tsp;
@@ -1090,7 +1106,7 @@ struct loadparm_service *lp_add_service(struct loadparm_context *lp_ctx,
lp_ctx->services[i] = init_service(lp_ctx->services, lp_ctx->sDefault);
if (lp_ctx->services[i] == NULL) {
- DEBUG(0,("lp_add_service: out of memory!\n"));
+ DEBUG(0,("lpcfg_add_service: out of memory!\n"));
return NULL;
}
copy_service(lp_ctx->services[i], &tservice, NULL);
@@ -1104,14 +1120,14 @@ struct loadparm_service *lp_add_service(struct loadparm_context *lp_ctx,
* from service ifrom.
*/
-bool lp_add_home(struct loadparm_context *lp_ctx,
+bool lpcfg_add_home(struct loadparm_context *lp_ctx,
const char *pszHomename,
struct loadparm_service *default_service,
const char *user, const char *pszHomedir)
{
struct loadparm_service *service;
- service = lp_add_service(lp_ctx, default_service, pszHomename);
+ service = lpcfg_add_service(lp_ctx, default_service, pszHomename);
if (service == NULL)
return false;
@@ -1120,7 +1136,7 @@ bool lp_add_home(struct loadparm_context *lp_ctx,
|| strequal(default_service->szPath, lp_ctx->sDefault->szPath)) {
service->szPath = talloc_strdup(service, pszHomedir);
} else {
- service->szPath = string_sub_talloc(service, lp_pathname(default_service, lp_ctx->sDefault), "%H", pszHomedir);
+ service->szPath = string_sub_talloc(service, lpcfg_pathname(default_service, lp_ctx->sDefault), "%H", pszHomedir);
}
if (!(*(service->comment))) {
@@ -1139,10 +1155,10 @@ bool lp_add_home(struct loadparm_context *lp_ctx,
* Add the IPC service.
*/
-static bool lp_add_hidden(struct loadparm_context *lp_ctx, const char *name,
- const char *fstype)
+static bool lpcfg_add_hidden(struct loadparm_context *lp_ctx, const char *name,
+ const char *fstype)
{
- struct loadparm_service *service = lp_add_service(lp_ctx, lp_ctx->sDefault, name);
+ struct loadparm_service *service = lpcfg_add_service(lp_ctx, lp_ctx->sDefault, name);
if (service == NULL)
return false;
@@ -1159,7 +1175,7 @@ static bool lp_add_hidden(struct loadparm_context *lp_ctx, const char *name,
service->bBrowseable = false;
if (strcasecmp(fstype, "IPC") == 0) {
- lp_do_service_parameter(lp_ctx, service, "ntvfs handler",
+ lpcfg_do_service_parameter(lp_ctx, service, "ntvfs handler",
"default");
}
@@ -1178,7 +1194,7 @@ bool lp_add_printer(struct loadparm_context *lp_ctx,
{
const char *comment = "From Printcap";
struct loadparm_service *service;
- service = lp_add_service(lp_ctx, default_service, pszPrintername);
+ service = lpcfg_add_service(lp_ctx, default_service, pszPrintername);
if (service == NULL)
return false;
@@ -1231,7 +1247,7 @@ static int map_parameter(const char *pszParmName)
/**
return the parameter structure for a parameter
*/
-struct parm_struct *lp_parm_struct(const char *name)
+struct parm_struct *lpcfg_parm_struct(const char *name)
{
int parmnum = map_parameter(name);
if (parmnum == -1) return NULL;
@@ -1241,7 +1257,7 @@ struct parm_struct *lp_parm_struct(const char *name)
/**
return the parameter pointer for a parameter
*/
-void *lp_parm_ptr(struct loadparm_context *lp_ctx,
+void *lpcfg_parm_ptr(struct loadparm_context *lp_ctx,
struct loadparm_service *service, struct parm_struct *parm)
{
if (service == NULL) {
@@ -1259,7 +1275,7 @@ void *lp_parm_ptr(struct loadparm_context *lp_ctx,
* Find a service by name. Otherwise works like get_service.
*/
-static struct loadparm_service *getservicebyname(struct loadparm_context *lp_ctx,
+static struct loadparm_service *getservicebyname(struct loadparm_context *lp_ctx,
const char *pszServiceName)
{
int iService;
@@ -1737,8 +1753,8 @@ static bool set_variable(TALLOC_CTX *mem_ctx, int parmnum, void *parm_ptr,
}
-bool lp_do_global_parameter(struct loadparm_context *lp_ctx,
- const char *pszParmName, const char *pszParmValue)
+bool lpcfg_do_global_parameter(struct loadparm_context *lp_ctx,
+ const char *pszParmName, const char *pszParmValue)
{
int parmnum = map_parameter(pszParmName);
void *parm_ptr;
@@ -1757,15 +1773,15 @@ bool lp_do_global_parameter(struct loadparm_context *lp_ctx,
return true;
}
- parm_ptr = lp_parm_ptr(lp_ctx, NULL, &parm_table[parmnum]);
+ parm_ptr = lpcfg_parm_ptr(lp_ctx, NULL, &parm_table[parmnum]);
return set_variable(lp_ctx, parmnum, parm_ptr,
pszParmName, pszParmValue, lp_ctx);
}
-bool lp_do_service_parameter(struct loadparm_context *lp_ctx,
- struct loadparm_service *service,
- const char *pszParmName, const char *pszParmValue)
+bool lpcfg_do_service_parameter(struct loadparm_context *lp_ctx,
+ struct loadparm_service *service,
+ const char *pszParmName, const char *pszParmValue)
{
void *parm_ptr;
int i;
@@ -1817,18 +1833,18 @@ static bool do_parameter(const char *pszParmName, const char *pszParmValue,
struct loadparm_context *lp_ctx = (struct loadparm_context *)userdata;
if (lp_ctx->bInGlobalSection)
- return lp_do_global_parameter(lp_ctx, pszParmName,
+ return lpcfg_do_global_parameter(lp_ctx, pszParmName,
pszParmValue);
else
- return lp_do_service_parameter(lp_ctx, lp_ctx->currentService,
- pszParmName, pszParmValue);
+ return lpcfg_do_service_parameter(lp_ctx, lp_ctx->currentService,
+ pszParmName, pszParmValue);
}
/*
variable argument do parameter
*/
-bool lp_do_global_parameter_var(struct loadparm_context *lp_ctx, const char *pszParmName, const char *fmt, ...) PRINTF_ATTRIBUTE(3, 4);
-bool lp_do_global_parameter_var(struct loadparm_context *lp_ctx,
+bool lpcfg_do_global_parameter_var(struct loadparm_context *lp_ctx, const char *pszParmName, const char *fmt, ...) PRINTF_ATTRIBUTE(3, 4);
+bool lpcfg_do_global_parameter_var(struct loadparm_context *lp_ctx,
const char *pszParmName, const char *fmt, ...)
{
char *s;
@@ -1838,7 +1854,7 @@ bool lp_do_global_parameter_var(struct loadparm_context *lp_ctx,
va_start(ap, fmt);
s = talloc_vasprintf(NULL, fmt, ap);
va_end(ap);
- ret = lp_do_global_parameter(lp_ctx, pszParmName, s);
+ ret = lpcfg_do_global_parameter(lp_ctx, pszParmName, s);
talloc_free(s);
return ret;
}
@@ -1849,8 +1865,8 @@ bool lp_do_global_parameter_var(struct loadparm_context *lp_ctx,
parsing code. It sets the parameter then marks the parameter as unable to be modified
by smb.conf processing
*/
-bool lp_set_cmdline(struct loadparm_context *lp_ctx, const char *pszParmName,
- const char *pszParmValue)
+bool lpcfg_set_cmdline(struct loadparm_context *lp_ctx, const char *pszParmName,
+ const char *pszParmValue)
{
int parmnum = map_parameter(pszParmName);
int i;
@@ -1872,7 +1888,7 @@ bool lp_set_cmdline(struct loadparm_context *lp_ctx, const char *pszParmName,
/* reset the CMDLINE flag in case this has been called before */
lp_ctx->flags[parmnum] &= ~FLAG_CMDLINE;
- if (!lp_do_global_parameter(lp_ctx, pszParmName, pszParmValue)) {
+ if (!lpcfg_do_global_parameter(lp_ctx, pszParmName, pszParmValue)) {
return false;
}
@@ -1892,7 +1908,7 @@ bool lp_set_cmdline(struct loadparm_context *lp_ctx, const char *pszParmName,
/*
set a option from the commandline in 'a=b' format. Use to support --option
*/
-bool lp_set_option(struct loadparm_context *lp_ctx, const char *option)
+bool lpcfg_set_option(struct loadparm_context *lp_ctx, const char *option)
{
char *p, *s;
bool ret;
@@ -1910,7 +1926,7 @@ bool lp_set_option(struct loadparm_context *lp_ctx, const char *option)
*p = 0;
- ret = lp_set_cmdline(lp_ctx, s, p+1);
+ ret = lpcfg_set_cmdline(lp_ctx, s, p+1);
free(s);
return ret;
}
@@ -2040,8 +2056,8 @@ static bool do_section(const char *pszSectionName, void *userdata)
/* issued by the post-processing of a previous section. */
DEBUG(2, ("Processing section \"[%s]\"\n", pszSectionName));
- if ((lp_ctx->currentService = lp_add_service(lp_ctx, lp_ctx->sDefault,
- pszSectionName))
+ if ((lp_ctx->currentService = lpcfg_add_service(lp_ctx, lp_ctx->sDefault,
+ pszSectionName))
== NULL) {
DEBUG(0, ("Failed to add a new service\n"));
return false;
@@ -2098,10 +2114,10 @@ static void dump_globals(struct loadparm_context *lp_ctx, FILE *f,
if (parm_table[i].pclass == P_GLOBAL &&
parm_table[i].offset != -1 &&
(i == 0 || (parm_table[i].offset != parm_table[i - 1].offset))) {
- if (!show_defaults && (lp_ctx->flags[i] & FLAG_DEFAULT))
+ if (!show_defaults && (lp_ctx->flags[i] & FLAG_DEFAULT))
continue;
fprintf(f, "\t%s = ", parm_table[i].label);
- print_parameter(&parm_table[i], lp_parm_ptr(lp_ctx, NULL, &parm_table[i]), f);
+ print_parameter(&parm_table[i], lpcfg_parm_ptr(lp_ctx, NULL, &parm_table[i]), f);
fprintf(f, "\n");
}
if (lp_ctx->globals->param_opt != NULL) {
@@ -2156,19 +2172,19 @@ static void dump_a_service(struct loadparm_service * pService, struct loadparm_s
}
}
-bool lp_dump_a_parameter(struct loadparm_context *lp_ctx,
- struct loadparm_service *service,
- const char *parm_name, FILE * f)
+bool lpcfg_dump_a_parameter(struct loadparm_context *lp_ctx,
+ struct loadparm_service *service,
+ const char *parm_name, FILE * f)
{
struct parm_struct *parm;
void *ptr;
- parm = lp_parm_struct(parm_name);
+ parm = lpcfg_parm_struct(parm_name);
if (!parm) {
return false;
}
- ptr = lp_parm_ptr(lp_ctx, service,parm);
+ ptr = lpcfg_parm_ptr(lp_ctx, service,parm);
print_parameter(parm, ptr, f);
fprintf(f, "\n");
@@ -2181,8 +2197,9 @@ bool lp_dump_a_parameter(struct loadparm_context *lp_ctx,
* Return NULL when out of parameters.
*/
-struct parm_struct *lp_next_parameter(struct loadparm_context *lp_ctx, int snum, int *i,
- int allparameters)
+
+struct parm_struct *lpcfg_next_parameter(struct loadparm_context *lp_ctx, int snum, int *i,
+ int allparameters)
{
if (snum == -1) {
/* do the globals */
@@ -2229,8 +2246,8 @@ struct parm_struct *lp_next_parameter(struct loadparm_context *lp_ctx, int snum,
/**
* Auto-load some home services.
*/
-static void lp_add_auto_services(struct loadparm_context *lp_ctx,
- const char *str)
+static void lpcfg_add_auto_services(struct loadparm_context *lp_ctx,
+ const char *str)
{
return;
}
@@ -2321,145 +2338,145 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
}
}
- lp_do_global_parameter(lp_ctx, "share backend", "classic");
+ lpcfg_do_global_parameter(lp_ctx, "share backend", "classic");
- lp_do_global_parameter(lp_ctx, "server role", "standalone");
+ lpcfg_do_global_parameter(lp_ctx, "server role", "standalone");
/* options that can be set on the command line must be initialised via
- the slower lp_do_global_parameter() to ensure that FLAG_CMDLINE is obeyed */
+ the slower lpcfg_do_global_parameter() to ensure that FLAG_CMDLINE is obeyed */
#ifdef TCP_NODELAY
- lp_do_global_parameter(lp_ctx, "socket options", "TCP_NODELAY");
+ lpcfg_do_global_parameter(lp_ctx, "socket options", "TCP_NODELAY");
#endif
- lp_do_global_parameter(lp_ctx, "workgroup", DEFAULT_WORKGROUP);
+ lpcfg_do_global_parameter(lp_ctx, "workgroup", DEFAULT_WORKGROUP);
myname = get_myname(lp_ctx);
- lp_do_global_parameter(lp_ctx, "netbios name", myname);
+ lpcfg_do_global_parameter(lp_ctx, "netbios name", myname);
talloc_free(myname);
- lp_do_global_parameter(lp_ctx, "name resolve order", "wins host bcast");
-
- lp_do_global_parameter(lp_ctx, "fstype", "NTFS");
-
- lp_do_global_parameter(lp_ctx, "ntvfs handler", "unixuid default");
- lp_do_global_parameter(lp_ctx, "max connections", "-1");
-
- lp_do_global_parameter(lp_ctx, "dcerpc endpoint servers", "epmapper srvsvc wkssvc rpcecho samr netlogon lsarpc spoolss drsuapi winreg dssetup unixinfo browser");
- lp_do_global_parameter(lp_ctx, "server services", "smb rpc nbt wrepl ldap cldap kdc drepl winbind ntp_signd kcc dnsupdate");
- lp_do_global_parameter(lp_ctx, "ntptr providor", "simple_ldb");
- lp_do_global_parameter(lp_ctx, "auth methods:domain controller", "anonymous sam_ignoredomain");
- lp_do_global_parameter(lp_ctx, "auth methods:member server", "anonymous sam winbind");
- lp_do_global_parameter(lp_ctx, "auth methods:standalone", "anonymous sam_ignoredomain");
- lp_do_global_parameter(lp_ctx, "private dir", dyn_PRIVATE_DIR);
- lp_do_global_parameter(lp_ctx, "sam database", "sam.ldb");
- lp_do_global_parameter(lp_ctx, "idmap database", "idmap.ldb");
- lp_do_global_parameter(lp_ctx, "secrets database", "secrets.ldb");
- lp_do_global_parameter(lp_ctx, "spoolss database", "spoolss.ldb");
- lp_do_global_parameter(lp_ctx, "wins config database", "wins_config.ldb");
- lp_do_global_parameter(lp_ctx, "wins database", "wins.ldb");
- lp_do_global_parameter(lp_ctx, "registry:HKEY_LOCAL_MACHINE", "hklm.ldb");
+ lpcfg_do_global_parameter(lp_ctx, "name resolve order", "wins host bcast");
+
+ lpcfg_do_global_parameter(lp_ctx, "fstype", "NTFS");
+
+ lpcfg_do_global_parameter(lp_ctx, "ntvfs handler", "unixuid default");
+ lpcfg_do_global_parameter(lp_ctx, "max connections", "-1");
+
+ lpcfg_do_global_parameter(lp_ctx, "dcerpc endpoint servers", "epmapper srvsvc wkssvc rpcecho samr netlogon lsarpc spoolss drsuapi winreg dssetup unixinfo browser");
+ lpcfg_do_global_parameter(lp_ctx, "server services", "smb rpc nbt wrepl ldap cldap kdc drepl winbind ntp_signd kcc dnsupdate");
+ lpcfg_do_global_parameter(lp_ctx, "ntptr providor", "simple_ldb");
+ lpcfg_do_global_parameter(lp_ctx, "auth methods:domain controller", "anonymous sam_ignoredomain");
+ lpcfg_do_global_parameter(lp_ctx, "auth methods:member server", "anonymous sam winbind");
+ lpcfg_do_global_parameter(lp_ctx, "auth methods:standalone", "anonymous sam_ignoredomain");
+ lpcfg_do_global_parameter(lp_ctx, "private dir", dyn_PRIVATE_DIR);
+ lpcfg_do_global_parameter(lp_ctx, "sam database", "sam.ldb");
+ lpcfg_do_global_parameter(lp_ctx, "idmap database", "idmap.ldb");
+ lpcfg_do_global_parameter(lp_ctx, "secrets database", "secrets.ldb");
+ lpcfg_do_global_parameter(lp_ctx, "spoolss database", "spoolss.ldb");
+ lpcfg_do_global_parameter(lp_ctx, "wins config database", "wins_config.ldb");
+ lpcfg_do_global_parameter(lp_ctx, "wins database", "wins.ldb");
+ lpcfg_do_global_parameter(lp_ctx, "registry:HKEY_LOCAL_MACHINE", "hklm.ldb");
/* This hive should be dynamically generated by Samba using
data from the sam, but for the moment leave it in a tdb to
keep regedt32 from popping up an annoying dialog. */
- lp_do_global_parameter(lp_ctx, "registry:HKEY_USERS", "hku.ldb");
+ lpcfg_do_global_parameter(lp_ctx, "registry:HKEY_USERS", "hku.ldb");
/* using UTF8 by default allows us to support all chars */
- lp_do_global_parameter(lp_ctx, "unix charset", "UTF8");
+ lpcfg_do_global_parameter(lp_ctx, "unix charset", "UTF8");
/* Use codepage 850 as a default for the dos character set */
- lp_do_global_parameter(lp_ctx, "dos charset", "CP850");
+ lpcfg_do_global_parameter(lp_ctx, "dos charset", "CP850");
/*
* Allow the default PASSWD_CHAT to be overridden in local.h.
*/
- lp_do_global_parameter(lp_ctx, "passwd chat", DEFAULT_PASSWD_CHAT);
+ lpcfg_do_global_parameter(lp_ctx, "passwd chat", DEFAULT_PASSWD_CHAT);
- lp_do_global_parameter(lp_ctx, "pid directory", dyn_PIDDIR);
- lp_do_global_parameter(lp_ctx, "lock dir", dyn_LOCKDIR);
- lp_do_global_parameter(lp_ctx, "modules dir", dyn_MODULESDIR);
- lp_do_global_parameter(lp_ctx, "ncalrpc dir", dyn_NCALRPCDIR);
+ lpcfg_do_global_parameter(lp_ctx, "pid directory", dyn_PIDDIR);
+ lpcfg_do_global_parameter(lp_ctx, "lock dir", dyn_LOCKDIR);
+ lpcfg_do_global_parameter(lp_ctx, "modules dir", dyn_MODULESDIR);
+ lpcfg_do_global_parameter(lp_ctx, "ncalrpc dir", dyn_NCALRPCDIR);
- lp_do_global_parameter(lp_ctx, "socket address", "0.0.0.0");
- lp_do_global_parameter_var(lp_ctx, "server string",
+ lpcfg_do_global_parameter(lp_ctx, "socket address", "0.0.0.0");
+ lpcfg_do_global_parameter_var(lp_ctx, "server string",
"Samba %s", SAMBA_VERSION_STRING);
- lp_do_global_parameter_var(lp_ctx, "announce version", "%d.%d",
+ lpcfg_do_global_parameter_var(lp_ctx, "announce version", "%d.%d",
DEFAULT_MAJOR_VERSION,
DEFAULT_MINOR_VERSION);
- lp_do_global_parameter(lp_ctx, "password server", "*");
-
- lp_do_global_parameter(lp_ctx, "max mux", "50");
- lp_do_global_parameter(lp_ctx, "max xmit", "12288");
- lp_do_global_parameter(lp_ctx, "password level", "0");
- lp_do_global_parameter(lp_ctx, "LargeReadwrite", "True");
- lp_do_global_parameter(lp_ctx, "server min protocol", "CORE");
- lp_do_global_parameter(lp_ctx, "server max protocol", "NT1");
- lp_do_global_parameter(lp_ctx, "client min protocol", "CORE");
- lp_do_global_parameter(lp_ctx, "client max protocol", "NT1");
- lp_do_global_parameter(lp_ctx, "security", "USER");
- lp_do_global_parameter(lp_ctx, "paranoid server security", "True");
- lp_do_global_parameter(lp_ctx, "EncryptPasswords", "True");
- lp_do_global_parameter(lp_ctx, "ReadRaw", "True");
- lp_do_global_parameter(lp_ctx, "WriteRaw", "True");
- lp_do_global_parameter(lp_ctx, "NullPasswords", "False");
- lp_do_global_parameter(lp_ctx, "ObeyPamRestrictions", "False");
- lp_do_global_parameter(lp_ctx, "announce as", "NT SERVER");
-
- lp_do_global_parameter(lp_ctx, "TimeServer", "False");
- lp_do_global_parameter(lp_ctx, "BindInterfacesOnly", "False");
- lp_do_global_parameter(lp_ctx, "Unicode", "True");
- lp_do_global_parameter(lp_ctx, "ClientLanManAuth", "False");
- lp_do_global_parameter(lp_ctx, "LanmanAuth", "False");
- lp_do_global_parameter(lp_ctx, "NTLMAuth", "True");
- lp_do_global_parameter(lp_ctx, "client use spnego principal", "False");
-
- lp_do_global_parameter(lp_ctx, "UnixExtensions", "False");
-
- lp_do_global_parameter(lp_ctx, "PreferredMaster", "Auto");
- lp_do_global_parameter(lp_ctx, "LocalMaster", "True");
-
- lp_do_global_parameter(lp_ctx, "wins support", "False");
- lp_do_global_parameter(lp_ctx, "dns proxy", "True");
-
- lp_do_global_parameter(lp_ctx, "winbind separator", "\\");
- lp_do_global_parameter(lp_ctx, "winbind sealed pipes", "True");
- lp_do_global_parameter(lp_ctx, "winbindd socket directory", dyn_WINBINDD_SOCKET_DIR);
- lp_do_global_parameter(lp_ctx, "winbindd privileged socket directory", dyn_WINBINDD_PRIVILEGED_SOCKET_DIR);
- lp_do_global_parameter(lp_ctx, "template shell", "/bin/false");
- lp_do_global_parameter(lp_ctx, "template homedir", "/home/%WORKGROUP%/%ACCOUNTNAME%");
- lp_do_global_parameter(lp_ctx, "idmap trusted only", "False");
-
- lp_do_global_parameter(lp_ctx, "client signing", "Yes");
- lp_do_global_parameter(lp_ctx, "server signing", "auto");
-
- lp_do_global_parameter(lp_ctx, "use spnego", "True");
-
- lp_do_global_parameter(lp_ctx, "smb ports", "445 139");
- lp_do_global_parameter(lp_ctx, "nbt port", "137");
- lp_do_global_parameter(lp_ctx, "dgram port", "138");
- lp_do_global_parameter(lp_ctx, "cldap port", "389");
- lp_do_global_parameter(lp_ctx, "krb5 port", "88");
- lp_do_global_parameter(lp_ctx, "kpasswd port", "464");
- lp_do_global_parameter(lp_ctx, "web port", "901");
-
- lp_do_global_parameter(lp_ctx, "nt status support", "True");
-
- lp_do_global_parameter(lp_ctx, "max wins ttl", "518400"); /* 6 days */
- lp_do_global_parameter(lp_ctx, "min wins ttl", "10");
-
- lp_do_global_parameter(lp_ctx, "tls enabled", "True");
- lp_do_global_parameter(lp_ctx, "tls keyfile", "tls/key.pem");
- lp_do_global_parameter(lp_ctx, "tls certfile", "tls/cert.pem");
- lp_do_global_parameter(lp_ctx, "tls cafile", "tls/ca.pem");
- lp_do_global_parameter_var(lp_ctx, "setup directory", "%s",
+ lpcfg_do_global_parameter(lp_ctx, "password server", "*");
+
+ lpcfg_do_global_parameter(lp_ctx, "max mux", "50");
+ lpcfg_do_global_parameter(lp_ctx, "max xmit", "12288");
+ lpcfg_do_global_parameter(lp_ctx, "password level", "0");
+ lpcfg_do_global_parameter(lp_ctx, "LargeReadwrite", "True");
+ lpcfg_do_global_parameter(lp_ctx, "server min protocol", "CORE");
+ lpcfg_do_global_parameter(lp_ctx, "server max protocol", "NT1");
+ lpcfg_do_global_parameter(lp_ctx, "client min protocol", "CORE");
+ lpcfg_do_global_parameter(lp_ctx, "client max protocol", "NT1");
+ lpcfg_do_global_parameter(lp_ctx, "security", "USER");
+ lpcfg_do_global_parameter(lp_ctx, "paranoid server security", "True");
+ lpcfg_do_global_parameter(lp_ctx, "EncryptPasswords", "True");
+ lpcfg_do_global_parameter(lp_ctx, "ReadRaw", "True");
+ lpcfg_do_global_parameter(lp_ctx, "WriteRaw", "True");
+ lpcfg_do_global_parameter(lp_ctx, "NullPasswords", "False");
+ lpcfg_do_global_parameter(lp_ctx, "ObeyPamRestrictions", "False");
+ lpcfg_do_global_parameter(lp_ctx, "announce as", "NT SERVER");
+
+ lpcfg_do_global_parameter(lp_ctx, "TimeServer", "False");
+ lpcfg_do_global_parameter(lp_ctx, "BindInterfacesOnly", "False");
+ lpcfg_do_global_parameter(lp_ctx, "Unicode", "True");
+ lpcfg_do_global_parameter(lp_ctx, "ClientLanManAuth", "False");
+ lpcfg_do_global_parameter(lp_ctx, "LanmanAuth", "False");
+ lpcfg_do_global_parameter(lp_ctx, "NTLMAuth", "True");
+ lpcfg_do_global_parameter(lp_ctx, "client use spnego principal", "False");
+
+ lpcfg_do_global_parameter(lp_ctx, "UnixExtensions", "False");
+
+ lpcfg_do_global_parameter(lp_ctx, "PreferredMaster", "Auto");
+ lpcfg_do_global_parameter(lp_ctx, "LocalMaster", "True");
+
+ lpcfg_do_global_parameter(lp_ctx, "wins support", "False");
+ lpcfg_do_global_parameter(lp_ctx, "dns proxy", "True");
+
+ lpcfg_do_global_parameter(lp_ctx, "winbind separator", "\\");
+ lpcfg_do_global_parameter(lp_ctx, "winbind sealed pipes", "True");
+ lpcfg_do_global_parameter(lp_ctx, "winbindd socket directory", dyn_WINBINDD_SOCKET_DIR);
+ lpcfg_do_global_parameter(lp_ctx, "winbindd privileged socket directory", dyn_WINBINDD_PRIVILEGED_SOCKET_DIR);
+ lpcfg_do_global_parameter(lp_ctx, "template shell", "/bin/false");
+ lpcfg_do_global_parameter(lp_ctx, "template homedir", "/home/%WORKGROUP%/%ACCOUNTNAME%");
+ lpcfg_do_global_parameter(lp_ctx, "idmap trusted only", "False");
+
+ lpcfg_do_global_parameter(lp_ctx, "client signing", "Yes");
+ lpcfg_do_global_parameter(lp_ctx, "server signing", "auto");
+
+ lpcfg_do_global_parameter(lp_ctx, "use spnego", "True");
+
+ lpcfg_do_global_parameter(lp_ctx, "smb ports", "445 139");
+ lpcfg_do_global_parameter(lp_ctx, "nbt port", "137");
+ lpcfg_do_global_parameter(lp_ctx, "dgram port", "138");
+ lpcfg_do_global_parameter(lp_ctx, "cldap port", "389");
+ lpcfg_do_global_parameter(lp_ctx, "krb5 port", "88");
+ lpcfg_do_global_parameter(lp_ctx, "kpasswd port", "464");
+ lpcfg_do_global_parameter(lp_ctx, "web port", "901");
+
+ lpcfg_do_global_parameter(lp_ctx, "nt status support", "True");
+
+ lpcfg_do_global_parameter(lp_ctx, "max wins ttl", "518400"); /* 6 days */
+ lpcfg_do_global_parameter(lp_ctx, "min wins ttl", "10");
+
+ lpcfg_do_global_parameter(lp_ctx, "tls enabled", "True");
+ lpcfg_do_global_parameter(lp_ctx, "tls keyfile", "tls/key.pem");
+ lpcfg_do_global_parameter(lp_ctx, "tls certfile", "tls/cert.pem");
+ lpcfg_do_global_parameter(lp_ctx, "tls cafile", "tls/ca.pem");
+ lpcfg_do_global_parameter_var(lp_ctx, "setup directory", "%s",
dyn_SETUPDIR);
- lp_do_global_parameter(lp_ctx, "prefork children:smb", "4");
+ lpcfg_do_global_parameter(lp_ctx, "prefork children:smb", "4");
- lp_do_global_parameter(lp_ctx, "ntp signd socket directory", dyn_NTP_SIGND_SOCKET_DIR);
- lp_do_global_parameter(lp_ctx, "rndc command", "/usr/sbin/rndc");
- lp_do_global_parameter_var(lp_ctx, "dns update command", "%s/samba_dnsupdate", dyn_SBINDIR);
- lp_do_global_parameter_var(lp_ctx, "spn update command", "%s/samba_spnupdate", dyn_SBINDIR);
- lp_do_global_parameter(lp_ctx, "nsupdate command", "/usr/bin/nsupdate -g");
+ lpcfg_do_global_parameter(lp_ctx, "ntp signd socket directory", dyn_NTP_SIGND_SOCKET_DIR);
+ lpcfg_do_global_parameter(lp_ctx, "rndc command", "/usr/sbin/rndc");
+ lpcfg_do_global_parameter_var(lp_ctx, "dns update command", "%s/samba_dnsupdate", dyn_SBINDIR);
+ lpcfg_do_global_parameter_var(lp_ctx, "spn update command", "%s/samba_spnupdate", dyn_SBINDIR);
+ lpcfg_do_global_parameter(lp_ctx, "nsupdate command", "/usr/bin/nsupdate -g");
for (i = 0; parm_table[i].label; i++) {
if (!(lp_ctx->flags[i] & FLAG_CMDLINE)) {
@@ -2470,7 +2487,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
return lp_ctx;
}
-const char *lp_configfile(struct loadparm_context *lp_ctx)
+const char *lpcfg_configfile(struct loadparm_context *lp_ctx)
{
return lp_ctx->szConfigFile;
}
@@ -2487,41 +2504,41 @@ const char *lp_default_path(void)
* Update the internal state of a loadparm context after settings
* have changed.
*/
-static bool lp_update(struct loadparm_context *lp_ctx)
+static bool lpcfg_update(struct loadparm_context *lp_ctx)
{
- lp_add_auto_services(lp_ctx, lp_auto_services(lp_ctx));
+ lpcfg_add_auto_services(lp_ctx, lpcfg_auto_services(lp_ctx));
- lp_add_hidden(lp_ctx, "IPC$", "IPC");
- lp_add_hidden(lp_ctx, "ADMIN$", "DISK");
+ lpcfg_add_hidden(lp_ctx, "IPC$", "IPC");
+ lpcfg_add_hidden(lp_ctx, "ADMIN$", "DISK");
if (!lp_ctx->globals->szWINSservers && lp_ctx->globals->bWINSsupport) {
- lp_do_global_parameter(lp_ctx, "wins server", "127.0.0.1");
+ lpcfg_do_global_parameter(lp_ctx, "wins server", "127.0.0.1");
}
panic_action = lp_ctx->globals->panic_action;
reload_charcnv(lp_ctx);
- /* FIXME: ntstatus_check_dos_mapping = lp_nt_status_support(lp_ctx); */
+ /* FIXME: ntstatus_check_dos_mapping = lpcfg_nt_status_support(lp_ctx); */
/* FIXME: This is a bit of a hack, but we can't use a global, since
* not everything that uses lp also uses the socket library */
- if (lp_parm_bool(lp_ctx, NULL, "socket", "testnonblock", false)) {
+ if (lpcfg_parm_bool(lp_ctx, NULL, "socket", "testnonblock", false)) {
setenv("SOCKET_TESTNONBLOCK", "1", 1);
} else {
unsetenv("SOCKET_TESTNONBLOCK");
}
/* FIXME: Check locale in environment for this: */
- if (strcmp(lp_display_charset(lp_ctx), lp_unix_charset(lp_ctx)) != 0)
- d_set_iconv(smb_iconv_open(lp_display_charset(lp_ctx), lp_unix_charset(lp_ctx)));
+ if (strcmp(lpcfg_display_charset(lp_ctx), lpcfg_unix_charset(lp_ctx)) != 0)
+ d_set_iconv(smb_iconv_open(lpcfg_display_charset(lp_ctx), lpcfg_unix_charset(lp_ctx)));
else
d_set_iconv((smb_iconv_t)-1);
return true;
}
-bool lp_load_default(struct loadparm_context *lp_ctx)
+bool lpcfg_load_default(struct loadparm_context *lp_ctx)
{
const char *path;
@@ -2530,10 +2547,10 @@ bool lp_load_default(struct loadparm_context *lp_ctx)
if (!file_exist(path)) {
/* We allow the default smb.conf file to not exist,
* basically the equivalent of an empty file. */
- return lp_update(lp_ctx);
+ return lpcfg_update(lp_ctx);
}
- return lp_load(lp_ctx, path);
+ return lpcfg_load(lp_ctx, path);
}
/**
@@ -2541,7 +2558,7 @@ bool lp_load_default(struct loadparm_context *lp_ctx)
*
* Return True on success, False on failure.
*/
-bool lp_load(struct loadparm_context *lp_ctx, const char *filename)
+bool lpcfg_load(struct loadparm_context *lp_ctx, const char *filename)
{
char *n2;
bool bRetval;
@@ -2552,7 +2569,7 @@ bool lp_load(struct loadparm_context *lp_ctx, const char *filename)
lp_ctx->bInGlobalSection = true;
n2 = standard_sub_basic(lp_ctx, lp_ctx->szConfigFile);
- DEBUG(2, ("lp_load: refreshing parameters from %s\n", n2));
+ DEBUG(2, ("lpcfg_load: refreshing parameters from %s\n", n2));
add_to_file_list(lp_ctx, lp_ctx->szConfigFile, n2);
@@ -2566,7 +2583,7 @@ bool lp_load(struct loadparm_context *lp_ctx, const char *filename)
if (lp_ctx->currentService != NULL)
bRetval = service_ok(lp_ctx->currentService);
- bRetval = bRetval && lp_update(lp_ctx);
+ bRetval = bRetval && lpcfg_update(lp_ctx);
/* we do this unconditionally, so that it happens even
for a missing smb.conf */
@@ -2576,6 +2593,10 @@ bool lp_load(struct loadparm_context *lp_ctx, const char *filename)
/* set this up so that any child python tasks will
find the right smb.conf */
setenv("SMB_CONF_PATH", filename, 1);
+
+ /* set the context used by the lp_*() function
+ varients */
+ global_loadparm_context = lp_ctx;
}
return bRetval;
@@ -2585,7 +2606,7 @@ bool lp_load(struct loadparm_context *lp_ctx, const char *filename)
* Return the max number of services.
*/
-int lp_numservices(struct loadparm_context *lp_ctx)
+int lpcfg_numservices(struct loadparm_context *lp_ctx)
{
return lp_ctx->iNumServices;
}
@@ -2594,7 +2615,7 @@ int lp_numservices(struct loadparm_context *lp_ctx)
* Display the contents of the services array in human-readable form.
*/
-void lp_dump(struct loadparm_context *lp_ctx, FILE *f, bool show_defaults,
+void lpcfg_dump(struct loadparm_context *lp_ctx, FILE *f, bool show_defaults,
int maxtoprint)
{
int iService;
@@ -2607,13 +2628,13 @@ void lp_dump(struct loadparm_context *lp_ctx, FILE *f, bool show_defaults,
dump_a_service(lp_ctx->sDefault, lp_ctx->sDefault, f);
for (iService = 0; iService < maxtoprint; iService++)
- lp_dump_one(f, show_defaults, lp_ctx->services[iService], lp_ctx->sDefault);
+ lpcfg_dump_one(f, show_defaults, lp_ctx->services[iService], lp_ctx->sDefault);
}
/**
* Display the contents of one service in human-readable form.
*/
-void lp_dump_one(FILE *f, bool show_defaults, struct loadparm_service *service, struct loadparm_service *sDefault)
+void lpcfg_dump_one(FILE *f, bool show_defaults, struct loadparm_service *service, struct loadparm_service *sDefault)
{
if (service != NULL) {
if (service->szService[0] == '\0')
@@ -2622,13 +2643,13 @@ void lp_dump_one(FILE *f, bool show_defaults, struct loadparm_service *service,
}
}
-struct loadparm_service *lp_servicebynum(struct loadparm_context *lp_ctx,
+struct loadparm_service *lpcfg_servicebynum(struct loadparm_context *lp_ctx,
int snum)
{
return lp_ctx->services[snum];
}
-struct loadparm_service *lp_service(struct loadparm_context *lp_ctx,
+struct loadparm_service *lpcfg_service(struct loadparm_context *lp_ctx,
const char *service_name)
{
int iService;
@@ -2652,31 +2673,38 @@ struct loadparm_service *lp_service(struct loadparm_context *lp_ctx,
}
}
- DEBUG(7,("lp_servicenumber: couldn't find %s\n", service_name));
+ DEBUG(7,("lpcfg_servicenumber: couldn't find %s\n", service_name));
return NULL;
}
+const char *lpcfg_servicename(const struct loadparm_service *service)
+{
+ return lp_string((const char *)service->szService);
+}
/**
* A useful volume label function.
*/
const char *volume_label(struct loadparm_service *service, struct loadparm_service *sDefault)
{
- const char *ret = lp_volume(service, sDefault);
+ const char *ret;
+ ret = lp_string((const char *)((service != NULL && service->volume != NULL) ?
+ service->volume : sDefault->volume));
if (!*ret)
- return lp_servicename(service);
+ return lpcfg_servicename(service);
return ret;
}
-
/**
* If we are PDC then prefer us as DMB
*/
-const char *lp_printername(struct loadparm_service *service, struct loadparm_service *sDefault)
+const char *lpcfg_printername(struct loadparm_service *service, struct loadparm_service *sDefault)
{
- const char *ret = _lp_printername(service, sDefault);
+ const char *ret;
+ ret = lp_string((const char *)((service != NULL && service->szPrintername != NULL) ?
+ service->szPrintername : sDefault->szPrintername));
if (ret == NULL || (ret != NULL && *ret == '\0'))
- ret = lp_servicename(service);
+ ret = lpcfg_servicename(service);
return ret;
}
@@ -2685,7 +2713,7 @@ const char *lp_printername(struct loadparm_service *service, struct loadparm_ser
/**
* Return the max print jobs per queue.
*/
-int lp_maxprintjobs(struct loadparm_service *service, struct loadparm_service *sDefault)
+int lpcfg_maxprintjobs(struct loadparm_service *service, struct loadparm_service *sDefault)
{
int maxjobs = (service != NULL) ? service->iMaxPrintJobs : sDefault->iMaxPrintJobs;
if (maxjobs <= 0 || maxjobs >= PRINT_MAX_JOBID)
@@ -2694,7 +2722,7 @@ int lp_maxprintjobs(struct loadparm_service *service, struct loadparm_service *s
return maxjobs;
}
-struct smb_iconv_convenience *lp_iconv_convenience(struct loadparm_context *lp_ctx)
+struct smb_iconv_convenience *lpcfg_iconv_convenience(struct loadparm_context *lp_ctx)
{
if (lp_ctx == NULL) {
static struct smb_iconv_convenience *fallback_ic = NULL;
@@ -2716,74 +2744,74 @@ _PUBLIC_ void reload_charcnv(struct loadparm_context *lp_ctx)
global_iconv_convenience = lp_ctx->iconv_convenience;
}
-void lp_smbcli_options(struct loadparm_context *lp_ctx,
+void lpcfg_smbcli_options(struct loadparm_context *lp_ctx,
struct smbcli_options *options)
{
- options->max_xmit = lp_max_xmit(lp_ctx);
- options->max_mux = lp_maxmux(lp_ctx);
- options->use_spnego = lp_nt_status_support(lp_ctx) && lp_use_spnego(lp_ctx);
- options->signing = lp_client_signing(lp_ctx);
+ options->max_xmit = lpcfg_max_xmit(lp_ctx);
+ options->max_mux = lpcfg_maxmux(lp_ctx);
+ options->use_spnego = lpcfg_nt_status_support(lp_ctx) && lpcfg_use_spnego(lp_ctx);
+ options->signing = lpcfg_client_signing(lp_ctx);
options->request_timeout = SMB_REQUEST_TIMEOUT;
- options->ntstatus_support = lp_nt_status_support(lp_ctx);
- options->max_protocol = lp_cli_maxprotocol(lp_ctx);
- options->unicode = lp_unicode(lp_ctx);
+ options->ntstatus_support = lpcfg_nt_status_support(lp_ctx);
+ options->max_protocol = lpcfg_cli_maxprotocol(lp_ctx);
+ options->unicode = lpcfg_unicode(lp_ctx);
options->use_oplocks = true;
options->use_level2_oplocks = true;
}
-void lp_smbcli_session_options(struct loadparm_context *lp_ctx,
+void lpcfg_smbcli_session_options(struct loadparm_context *lp_ctx,
struct smbcli_session_options *options)
{
- options->lanman_auth = lp_client_lanman_auth(lp_ctx);
- options->ntlmv2_auth = lp_client_ntlmv2_auth(lp_ctx);
- options->plaintext_auth = lp_client_plaintext_auth(lp_ctx);
+ options->lanman_auth = lpcfg_client_lanman_auth(lp_ctx);
+ options->ntlmv2_auth = lpcfg_client_ntlmv2_auth(lp_ctx);
+ options->plaintext_auth = lpcfg_client_plaintext_auth(lp_ctx);
}
-_PUBLIC_ char *lp_tls_keyfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
+_PUBLIC_ char *lpcfg_tls_keyfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
return private_path(mem_ctx, lp_ctx, lp_ctx->globals->tls_keyfile);
}
-_PUBLIC_ char *lp_tls_certfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
+_PUBLIC_ char *lpcfg_tls_certfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
return private_path(mem_ctx, lp_ctx, lp_ctx->globals->tls_certfile);
}
-_PUBLIC_ char *lp_tls_cafile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
+_PUBLIC_ char *lpcfg_tls_cafile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
return private_path(mem_ctx, lp_ctx, lp_ctx->globals->tls_cafile);
}
-_PUBLIC_ char *lp_tls_crlfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
+_PUBLIC_ char *lpcfg_tls_crlfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
return private_path(mem_ctx, lp_ctx, lp_ctx->globals->tls_crlfile);
}
-_PUBLIC_ char *lp_tls_dhpfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
+_PUBLIC_ char *lpcfg_tls_dhpfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
return private_path(mem_ctx, lp_ctx, lp_ctx->globals->tls_dhpfile);
}
-_PUBLIC_ struct dcerpc_server_info *lp_dcerpc_server_info(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
+_PUBLIC_ struct dcerpc_server_info *lpcfg_dcerpc_server_info(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
struct dcerpc_server_info *ret = talloc_zero(mem_ctx, struct dcerpc_server_info);
- ret->domain_name = talloc_reference(mem_ctx, lp_workgroup(lp_ctx));
- ret->version_major = lp_parm_int(lp_ctx, NULL, "server_info", "version_major", 5);
- ret->version_minor = lp_parm_int(lp_ctx, NULL, "server_info", "version_minor", 2);
- ret->version_build = lp_parm_int(lp_ctx, NULL, "server_info", "version_build", 3790);
+ ret->domain_name = talloc_reference(mem_ctx, lpcfg_workgroup(lp_ctx));
+ ret->version_major = lpcfg_parm_int(lp_ctx, NULL, "server_info", "version_major", 5);
+ ret->version_minor = lpcfg_parm_int(lp_ctx, NULL, "server_info", "version_minor", 2);
+ ret->version_build = lpcfg_parm_int(lp_ctx, NULL, "server_info", "version_build", 3790);
return ret;
}
-struct gensec_settings *lp_gensec_settings(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
+struct gensec_settings *lpcfg_gensec_settings(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
struct gensec_settings *settings = talloc(mem_ctx, struct gensec_settings);
if (settings == NULL)
return NULL;
SMB_ASSERT(lp_ctx != NULL);
settings->lp_ctx = talloc_reference(settings, lp_ctx);
- settings->target_hostname = lp_parm_string(lp_ctx, NULL, "gensec", "target_hostname");
+ settings->target_hostname = lpcfg_parm_string(lp_ctx, NULL, "gensec", "target_hostname");
return settings;
}
diff --git a/source4/param/param.h b/source4/param/param.h
index 6253f43f08..15ea564c40 100644
--- a/source4/param/param.h
+++ b/source4/param/param.h
@@ -71,195 +71,237 @@ struct gensec_settings;
void reload_charcnv(struct loadparm_context *lp_ctx);
-struct loadparm_service *lp_default_service(struct loadparm_context *lp_ctx);
-struct parm_struct *lp_parm_table(void);
-int lp_server_role(struct loadparm_context *);
-int lp_sid_generator(struct loadparm_context *);
-const char **lp_smb_ports(struct loadparm_context *);
-int lp_nbt_port(struct loadparm_context *);
-int lp_dgram_port(struct loadparm_context *);
-int lp_cldap_port(struct loadparm_context *);
-int lp_krb5_port(struct loadparm_context *);
-int lp_kpasswd_port(struct loadparm_context *);
-int lp_web_port(struct loadparm_context *);
-bool lp_tls_enabled(struct loadparm_context *);
-char *lp_tls_keyfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
-char *lp_tls_certfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
-char *lp_tls_cafile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
-char *lp_tls_crlfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
-char *lp_tls_dhpfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
-const char *lp_share_backend(struct loadparm_context *);
-const char *lp_sam_url(struct loadparm_context *);
-const char *lp_idmap_url(struct loadparm_context *);
-const char *lp_secrets_url(struct loadparm_context *);
-const char *lp_spoolss_url(struct loadparm_context *);
-const char *lp_wins_config_url(struct loadparm_context *);
-const char *lp_wins_url(struct loadparm_context *);
-const char *lp_winbind_separator(struct loadparm_context *);
-const char *lp_winbindd_socket_directory(struct loadparm_context *);
-const char *lp_winbindd_privileged_socket_directory(struct loadparm_context *);
-const char *lp_template_shell(struct loadparm_context *);
-const char *lp_template_homedir(struct loadparm_context *);
-bool lp_winbind_sealed_pipes(struct loadparm_context *);
-bool lp_idmap_trusted_only(struct loadparm_context *);
-const char *lp_private_dir(struct loadparm_context *);
-const char *lp_serverstring(struct loadparm_context *);
-const char *lp_lockdir(struct loadparm_context *);
-const char *lp_modulesdir(struct loadparm_context *);
-const char *lp_setupdir(struct loadparm_context *);
-const char *lp_ncalrpc_dir(struct loadparm_context *);
-const char *lp_dos_charset(struct loadparm_context *);
-const char *lp_unix_charset(struct loadparm_context *);
-const char *lp_display_charset(struct loadparm_context *);
-const char *lp_piddir(struct loadparm_context *);
-const char **lp_dcerpc_endpoint_servers(struct loadparm_context *);
-const char **lp_server_services(struct loadparm_context *);
-const char *lp_ntptr_providor(struct loadparm_context *);
-const char *lp_auto_services(struct loadparm_context *);
-const char *lp_passwd_chat(struct loadparm_context *);
-const char **lp_passwordserver(struct loadparm_context *);
-const char **lp_name_resolve_order(struct loadparm_context *);
-const char *lp_realm(struct loadparm_context *);
-const char *lp_dnsdomain(struct loadparm_context *);
-const char *lp_socket_options(struct loadparm_context *);
-const char *lp_workgroup(struct loadparm_context *);
-const char *lp_netbios_name(struct loadparm_context *);
-const char *lp_netbios_scope(struct loadparm_context *);
-const char **lp_wins_server_list(struct loadparm_context *);
-const char **lp_interfaces(struct loadparm_context *);
-const char *lp_socket_address(struct loadparm_context *);
-const char **lp_netbios_aliases(struct loadparm_context *);
-const char **lp_rndc_command(struct loadparm_context *);
-const char **lp_dns_update_command(struct loadparm_context *);
-const char **lp_spn_update_command(struct loadparm_context *);
-bool lp_disable_netbios(struct loadparm_context *);
-bool lp_wins_support(struct loadparm_context *);
-bool lp_wins_dns_proxy(struct loadparm_context *);
-const char *lp_wins_hook(struct loadparm_context *);
-bool lp_local_master(struct loadparm_context *);
-bool lp_readraw(struct loadparm_context *);
-bool lp_large_readwrite(struct loadparm_context *);
-bool lp_writeraw(struct loadparm_context *);
-bool lp_null_passwords(struct loadparm_context *);
-bool lp_obey_pam_restrictions(struct loadparm_context *);
-bool lp_encrypted_passwords(struct loadparm_context *);
-bool lp_time_server(struct loadparm_context *);
-bool lp_bind_interfaces_only(struct loadparm_context *);
-bool lp_unicode(struct loadparm_context *);
-bool lp_nt_status_support(struct loadparm_context *);
-bool lp_lanman_auth(struct loadparm_context *);
-bool lp_ntlm_auth(struct loadparm_context *);
-bool lp_client_plaintext_auth(struct loadparm_context *);
-bool lp_client_lanman_auth(struct loadparm_context *);
-bool lp_client_ntlmv2_auth(struct loadparm_context *);
-bool lp_client_use_spnego_principal(struct loadparm_context *);
-bool lp_host_msdfs(struct loadparm_context *);
-bool lp_unix_extensions(struct loadparm_context *);
-bool lp_use_spnego(struct loadparm_context *);
-bool lp_rpc_big_endian(struct loadparm_context *);
-int lp_max_wins_ttl(struct loadparm_context *);
-int lp_min_wins_ttl(struct loadparm_context *);
-int lp_maxmux(struct loadparm_context *);
-int lp_max_xmit(struct loadparm_context *);
-int lp_passwordlevel(struct loadparm_context *);
-int lp_srv_maxprotocol(struct loadparm_context *);
-int lp_srv_minprotocol(struct loadparm_context *);
-int lp_cli_maxprotocol(struct loadparm_context *);
-int lp_cli_minprotocol(struct loadparm_context *);
-int lp_security(struct loadparm_context *);
-bool lp_paranoid_server_security(struct loadparm_context *);
-int lp_announce_as(struct loadparm_context *);
-
-const char *lp_servicename(const struct loadparm_service *service);
-const char *lp_pathname(struct loadparm_service *, struct loadparm_service *);
-const char **lp_hostsallow(struct loadparm_service *, struct loadparm_service *);
-const char **lp_hostsdeny(struct loadparm_service *, struct loadparm_service *);
-const char *lp_comment(struct loadparm_service *, struct loadparm_service *);
-const char *lp_fstype(struct loadparm_service *, struct loadparm_service *);
-const char **lp_ntvfs_handler(struct loadparm_service *, struct loadparm_service *);
-bool lp_msdfs_root(struct loadparm_service *, struct loadparm_service *);
-bool lp_browseable(struct loadparm_service *, struct loadparm_service *);
-bool lp_readonly(struct loadparm_service *, struct loadparm_service *);
-bool lp_print_ok(struct loadparm_service *, struct loadparm_service *);
-bool lp_map_hidden(struct loadparm_service *, struct loadparm_service *);
-bool lp_map_archive(struct loadparm_service *, struct loadparm_service *);
-bool lp_strict_locking(struct loadparm_service *, struct loadparm_service *);
-bool lp_oplocks(struct loadparm_service *, struct loadparm_service *);
-bool lp_strict_sync(struct loadparm_service *, struct loadparm_service *);
-bool lp_ci_filesystem(struct loadparm_service *, struct loadparm_service *);
-bool lp_map_system(struct loadparm_service *, struct loadparm_service *);
-int lp_max_connections(struct loadparm_service *, struct loadparm_service *);
-int lp_csc_policy(struct loadparm_service *, struct loadparm_service *);
-int lp_create_mask(struct loadparm_service *, struct loadparm_service *);
-int lp_force_create_mode(struct loadparm_service *, struct loadparm_service *);
-int lp_dir_mask(struct loadparm_service *, struct loadparm_service *);
-int lp_force_dir_mode(struct loadparm_service *, struct loadparm_service *);
-int lp_server_signing(struct loadparm_context *);
-int lp_client_signing(struct loadparm_context *);
-const char *lp_ntp_signd_socket_directory(struct loadparm_context *);
-
-
-const char *lp_get_parametric(struct loadparm_context *lp_ctx,
+struct loadparm_service *lpcfg_default_service(struct loadparm_context *lp_ctx);
+struct parm_struct *lpcfg_parm_table(void);
+
+
+#define DECL_GLOBAL_STRING(fn_name) \
+ const char *lpcfg_ ## fn_name(struct loadparm_context *lp_ctx); \
+ const char *lp_ ## fn_name(void)
+
+#define DECL_GLOBAL_CONST_STRING(fn_name) \
+ const char *lpcfg_ ## fn_name(struct loadparm_context *lp_ctx); \
+ const char *lp_ ## fn_name(void)
+
+#define DECL_GLOBAL_LIST(fn_name) \
+ const char **lpcfg_ ## fn_name(struct loadparm_context *lp_ctx); \
+ const char **lp_ ## fn_name(void)
+
+#define DECL_GLOBAL_BOOL(fn_name) \
+ bool lpcfg_ ## fn_name(struct loadparm_context *lp_ctx); \
+ bool lp_ ## fn_name(void)
+
+#define DECL_GLOBAL_INTEGER(fn_name) \
+ int lpcfg_ ## fn_name(struct loadparm_context *lp_ctx); \
+ int lp_ ## fn_name(void)
+
+#define DECL_LOCAL_STRING(fn_name) \
+ const char *lpcfg_ ## fn_name(struct loadparm_service *service, struct loadparm_service *sDefault); \
+ const char *lp_ ## fn_name(int i)
+
+#define DECL_LOCAL_LIST(fn_name) \
+ const char **lpcfg_ ## fn_name(struct loadparm_service *service, struct loadparm_service *sDefault); \
+ const char **lp_ ## fn_name(int i)
+
+#define DECL_LOCAL_BOOL(fn_name) \
+ bool lpcfg_ ## fn_name(struct loadparm_service *service, struct loadparm_service *sDefault); \
+ bool lp_ ## fn_name(int i)
+
+#define DECL_LOCAL_INTEGER(fn_name) \
+ int lpcfg_ ## fn_name(struct loadparm_service *service, struct loadparm_service *sDefault); \
+ int lp_ ## fn_name(int i)
+
+
+DECL_GLOBAL_INTEGER(server_role);
+DECL_GLOBAL_INTEGER(sid_generator);
+DECL_GLOBAL_LIST(smb_ports);
+DECL_GLOBAL_INTEGER(nbt_port);
+DECL_GLOBAL_INTEGER(dgram_port);
+DECL_GLOBAL_INTEGER(cldap_port);
+DECL_GLOBAL_INTEGER(krb5_port);
+DECL_GLOBAL_INTEGER(kpasswd_port);
+DECL_GLOBAL_INTEGER(web_port);
+DECL_GLOBAL_BOOL(tls_enabled);
+DECL_GLOBAL_STRING(share_backend);
+DECL_GLOBAL_STRING(sam_url);
+DECL_GLOBAL_STRING(idmap_url);
+DECL_GLOBAL_STRING(secrets_url);
+DECL_GLOBAL_STRING(spoolss_url);
+DECL_GLOBAL_STRING(wins_config_url);
+DECL_GLOBAL_STRING(wins_url);
+DECL_GLOBAL_CONST_STRING(winbind_separator);
+DECL_GLOBAL_CONST_STRING(winbindd_socket_directory);
+DECL_GLOBAL_CONST_STRING(winbindd_privileged_socket_directory);
+DECL_GLOBAL_CONST_STRING(template_shell);
+DECL_GLOBAL_CONST_STRING(template_homedir);
+DECL_GLOBAL_BOOL(winbind_sealed_pipes);
+DECL_GLOBAL_BOOL(idmap_trusted_only);
+DECL_GLOBAL_STRING(private_dir);
+DECL_GLOBAL_STRING(serverstring);
+DECL_GLOBAL_STRING(lockdir);
+DECL_GLOBAL_STRING(modulesdir);
+DECL_GLOBAL_STRING(setupdir);
+DECL_GLOBAL_STRING(ncalrpc_dir);
+DECL_GLOBAL_STRING(dos_charset);
+DECL_GLOBAL_STRING(unix_charset);
+DECL_GLOBAL_STRING(display_charset);
+DECL_GLOBAL_STRING(piddir);
+DECL_GLOBAL_LIST(rndc_command);
+DECL_GLOBAL_LIST(dns_update_command);
+DECL_GLOBAL_LIST(spn_update_command);
+DECL_GLOBAL_STRING(nsupdate_command);
+DECL_GLOBAL_LIST(dcerpc_endpoint_servers);
+DECL_GLOBAL_LIST(server_services);
+DECL_GLOBAL_STRING(ntptr_providor);
+DECL_GLOBAL_STRING(auto_services);
+DECL_GLOBAL_STRING(passwd_chat);
+DECL_GLOBAL_LIST(passwordserver);
+DECL_GLOBAL_LIST(name_resolve_order);
+DECL_GLOBAL_STRING(realm);
+DECL_GLOBAL_STRING(dnsdomain);
+DECL_GLOBAL_STRING(socket_options);
+DECL_GLOBAL_STRING(workgroup);
+DECL_GLOBAL_STRING(netbios_name);
+DECL_GLOBAL_STRING(netbios_scope);
+DECL_GLOBAL_LIST(wins_server_list);
+DECL_GLOBAL_LIST(interfaces);
+DECL_GLOBAL_STRING(socket_address);
+DECL_GLOBAL_LIST(netbios_aliases);
+DECL_GLOBAL_BOOL(disable_netbios);
+DECL_GLOBAL_BOOL(wins_support);
+DECL_GLOBAL_BOOL(wins_dns_proxy);
+DECL_GLOBAL_STRING(wins_hook);
+DECL_GLOBAL_BOOL(local_master);
+DECL_GLOBAL_BOOL(readraw);
+DECL_GLOBAL_BOOL(large_readwrite);
+DECL_GLOBAL_BOOL(writeraw);
+DECL_GLOBAL_BOOL(null_passwords);
+DECL_GLOBAL_BOOL(obey_pam_restrictions);
+DECL_GLOBAL_BOOL(encrypted_passwords);
+DECL_GLOBAL_BOOL(time_server);
+DECL_GLOBAL_BOOL(bind_interfaces_only);
+DECL_GLOBAL_BOOL(unicode);
+DECL_GLOBAL_BOOL(nt_status_support);
+DECL_GLOBAL_BOOL(lanman_auth);
+DECL_GLOBAL_BOOL(ntlm_auth);
+DECL_GLOBAL_BOOL(client_plaintext_auth);
+DECL_GLOBAL_BOOL(client_lanman_auth);
+DECL_GLOBAL_BOOL(client_ntlmv2_auth);
+DECL_GLOBAL_BOOL(client_use_spnego_principal);
+DECL_GLOBAL_BOOL(host_msdfs);
+DECL_GLOBAL_BOOL(unix_extensions);
+DECL_GLOBAL_BOOL(use_spnego);
+DECL_GLOBAL_BOOL(rpc_big_endian);
+DECL_GLOBAL_INTEGER(max_wins_ttl);
+DECL_GLOBAL_INTEGER(min_wins_ttl);
+DECL_GLOBAL_INTEGER(maxmux);
+DECL_GLOBAL_INTEGER(max_xmit);
+DECL_GLOBAL_INTEGER(passwordlevel);
+DECL_GLOBAL_INTEGER(srv_maxprotocol);
+DECL_GLOBAL_INTEGER(srv_minprotocol);
+DECL_GLOBAL_INTEGER(cli_maxprotocol);
+DECL_GLOBAL_INTEGER(cli_minprotocol);
+DECL_GLOBAL_INTEGER(security);
+DECL_GLOBAL_BOOL(paranoid_server_security);
+DECL_GLOBAL_INTEGER(announce_as);
+DECL_LOCAL_STRING(pathname);
+DECL_LOCAL_LIST(hostsallow);
+DECL_LOCAL_LIST(hostsdeny);
+DECL_LOCAL_STRING(comment);
+DECL_LOCAL_STRING(fstype);
+DECL_LOCAL_LIST(ntvfs_handler);
+DECL_LOCAL_BOOL(msdfs_root);
+DECL_LOCAL_BOOL(browseable);
+DECL_LOCAL_BOOL(readonly);
+DECL_LOCAL_BOOL(print_ok);
+DECL_LOCAL_BOOL(map_hidden);
+DECL_LOCAL_BOOL(map_archive);
+DECL_LOCAL_BOOL(strict_locking);
+DECL_LOCAL_BOOL(oplocks);
+DECL_LOCAL_BOOL(strict_sync);
+DECL_LOCAL_BOOL(ci_filesystem);
+DECL_LOCAL_BOOL(map_system);
+DECL_LOCAL_INTEGER(max_connections);
+DECL_LOCAL_INTEGER(csc_policy);
+DECL_LOCAL_INTEGER(create_mask);
+DECL_LOCAL_INTEGER(force_create_mode);
+DECL_LOCAL_INTEGER(dir_mask);
+DECL_LOCAL_INTEGER(force_dir_mode);
+DECL_GLOBAL_INTEGER(server_signing);
+DECL_GLOBAL_INTEGER(client_signing);
+DECL_GLOBAL_CONST_STRING(ntp_signd_socket_directory);
+
+
+char *lpcfg_tls_keyfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
+char *lpcfg_tls_certfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
+char *lpcfg_tls_cafile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
+char *lpcfg_tls_dhpfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
+char *lpcfg_tls_crlfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
+
+const char *lpcfg_servicename(const struct loadparm_service *service);
+
+
+const char *lpcfg_get_parametric(struct loadparm_context *lp_ctx,
struct loadparm_service *service,
const char *type, const char *option);
-const char *lp_parm_string(struct loadparm_context *lp_ctx,
+const char *lpcfg_parm_string(struct loadparm_context *lp_ctx,
struct loadparm_service *service, const char *type,
const char *option);
-const char **lp_parm_string_list(TALLOC_CTX *mem_ctx,
+const char **lpcfg_parm_string_list(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx,
struct loadparm_service *service,
const char *type,
const char *option, const char *separator);
-int lp_parm_int(struct loadparm_context *lp_ctx,
+int lpcfg_parm_int(struct loadparm_context *lp_ctx,
struct loadparm_service *service, const char *type,
const char *option, int default_v);
-int lp_parm_bytes(struct loadparm_context *lp_ctx,
+int lpcfg_parm_bytes(struct loadparm_context *lp_ctx,
struct loadparm_service *service, const char *type,
const char *option, int default_v);
-unsigned long lp_parm_ulong(struct loadparm_context *lp_ctx,
+unsigned long lpcfg_parm_ulong(struct loadparm_context *lp_ctx,
struct loadparm_service *service, const char *type,
const char *option, unsigned long default_v);
-double lp_parm_double(struct loadparm_context *lp_ctx,
+double lpcfg_parm_double(struct loadparm_context *lp_ctx,
struct loadparm_service *service, const char *type,
const char *option, double default_v);
-bool lp_parm_bool(struct loadparm_context *lp_ctx,
- struct loadparm_service *service, const char *type,
- const char *option, bool default_v);
-struct loadparm_service *lp_add_service(struct loadparm_context *lp_ctx,
+bool lpcfg_parm_bool(struct loadparm_context *lp_ctx,
+ struct loadparm_service *service, const char *type,
+ const char *option, bool default_v);
+struct loadparm_service *lpcfg_add_service(struct loadparm_context *lp_ctx,
const struct loadparm_service *pservice,
const char *name);
-bool lp_add_home(struct loadparm_context *lp_ctx,
+bool lpcfg_add_home(struct loadparm_context *lp_ctx,
const char *pszHomename,
struct loadparm_service *default_service,
const char *user, const char *pszHomedir);
-bool lp_add_printer(struct loadparm_context *lp_ctx,
+bool lpcfg_add_printer(struct loadparm_context *lp_ctx,
const char *pszPrintername,
struct loadparm_service *default_service);
-struct parm_struct *lp_parm_struct(const char *name);
-void *lp_parm_ptr(struct loadparm_context *lp_ctx,
+struct parm_struct *lpcfg_parm_struct(const char *name);
+void *lpcfg_parm_ptr(struct loadparm_context *lp_ctx,
struct loadparm_service *service, struct parm_struct *parm);
-bool lp_file_list_changed(struct loadparm_context *lp_ctx);
+bool lpcfg_file_list_changed(struct loadparm_context *lp_ctx);
-bool lp_do_global_parameter(struct loadparm_context *lp_ctx,
+bool lpcfg_do_global_parameter(struct loadparm_context *lp_ctx,
const char *pszParmName, const char *pszParmValue);
-bool lp_do_service_parameter(struct loadparm_context *lp_ctx,
+bool lpcfg_do_service_parameter(struct loadparm_context *lp_ctx,
struct loadparm_service *service,
const char *pszParmName, const char *pszParmValue);
/**
* Process a parameter.
*/
-bool lp_do_global_parameter_var(struct loadparm_context *lp_ctx,
+bool lpcfg_do_global_parameter_var(struct loadparm_context *lp_ctx,
const char *pszParmName, const char *fmt, ...);
-bool lp_set_cmdline(struct loadparm_context *lp_ctx, const char *pszParmName,
+bool lpcfg_set_cmdline(struct loadparm_context *lp_ctx, const char *pszParmName,
const char *pszParmValue);
-bool lp_set_option(struct loadparm_context *lp_ctx, const char *option);
+bool lpcfg_set_option(struct loadparm_context *lp_ctx, const char *option);
/**
* Display the contents of a single services record.
*/
-bool lp_dump_a_parameter(struct loadparm_context *lp_ctx,
+bool lpcfg_dump_a_parameter(struct loadparm_context *lp_ctx,
struct loadparm_service *service,
const char *parm_name, FILE * f);
@@ -267,13 +309,13 @@ bool lp_dump_a_parameter(struct loadparm_context *lp_ctx,
* Return info about the next service in a service. snum==-1 gives the globals.
* Return NULL when out of parameters.
*/
-struct parm_struct *lp_next_parameter(struct loadparm_context *lp_ctx, int snum, int *i,
+struct parm_struct *lpcfg_next_parameter(struct loadparm_context *lp_ctx, int snum, int *i,
int allparameters);
/**
* Unload unused services.
*/
-void lp_killunused(struct loadparm_context *lp_ctx,
+void lpcfg_killunused(struct loadparm_context *lp_ctx,
struct smbsrv_connection *smb,
bool (*snumused) (struct smbsrv_connection *, int));
@@ -281,8 +323,8 @@ void lp_killunused(struct loadparm_context *lp_ctx,
* Initialise the global parameter structure.
*/
struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx);
-const char *lp_configfile(struct loadparm_context *lp_ctx);
-bool lp_load_default(struct loadparm_context *lp_ctx);
+const char *lpcfg_configfile(struct loadparm_context *lp_ctx);
+bool lpcfg_load_default(struct loadparm_context *lp_ctx);
const char *lp_default_path(void);
/**
@@ -290,26 +332,26 @@ const char *lp_default_path(void);
*
* Return True on success, False on failure.
*/
-bool lp_load(struct loadparm_context *lp_ctx, const char *filename);
+bool lpcfg_load(struct loadparm_context *lp_ctx, const char *filename);
/**
* Return the max number of services.
*/
-int lp_numservices(struct loadparm_context *lp_ctx);
+int lpcfg_numservices(struct loadparm_context *lp_ctx);
/**
* Display the contents of the services array in human-readable form.
*/
-void lp_dump(struct loadparm_context *lp_ctx, FILE *f, bool show_defaults,
+void lpcfg_dump(struct loadparm_context *lp_ctx, FILE *f, bool show_defaults,
int maxtoprint);
/**
* Display the contents of one service in human-readable form.
*/
-void lp_dump_one(FILE *f, bool show_defaults, struct loadparm_service *service, struct loadparm_service *sDefault);
-struct loadparm_service *lp_servicebynum(struct loadparm_context *lp_ctx,
+void lpcfg_dump_one(FILE *f, bool show_defaults, struct loadparm_service *service, struct loadparm_service *sDefault);
+struct loadparm_service *lpcfg_servicebynum(struct loadparm_context *lp_ctx,
int snum);
-struct loadparm_service *lp_service(struct loadparm_context *lp_ctx,
+struct loadparm_service *lpcfg_service(struct loadparm_context *lp_ctx,
const char *service_name);
/**
@@ -320,19 +362,19 @@ const char *volume_label(struct loadparm_service *service, struct loadparm_servi
/**
* If we are PDC then prefer us as DMB
*/
-const char *lp_printername(struct loadparm_service *service, struct loadparm_service *sDefault);
+const char *lpcfg_printername(struct loadparm_service *service, struct loadparm_service *sDefault);
/**
* Return the max print jobs per queue.
*/
-int lp_maxprintjobs(struct loadparm_service *service, struct loadparm_service *sDefault);
-struct smb_iconv_convenience *lp_iconv_convenience(struct loadparm_context *lp_ctx);
-void lp_smbcli_options(struct loadparm_context *lp_ctx,
+int lpcfg_maxprintjobs(struct loadparm_service *service, struct loadparm_service *sDefault);
+struct smb_iconv_convenience *lpcfg_iconv_convenience(struct loadparm_context *lp_ctx);
+void lpcfg_smbcli_options(struct loadparm_context *lp_ctx,
struct smbcli_options *options);
-void lp_smbcli_session_options(struct loadparm_context *lp_ctx,
+void lpcfg_smbcli_session_options(struct loadparm_context *lp_ctx,
struct smbcli_session_options *options);
-struct dcerpc_server_info *lp_dcerpc_server_info(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx);
-struct gensec_settings *lp_gensec_settings(TALLOC_CTX *, struct loadparm_context *);
+struct dcerpc_server_info *lpcfg_dcerpc_server_info(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx);
+struct gensec_settings *lpcfg_gensec_settings(TALLOC_CTX *, struct loadparm_context *);
/* The following definitions come from param/generic.c */
@@ -363,17 +405,17 @@ int param_write(struct param_context *ctx, const char *fn);
* @file
* @brief Misc utility functions
*/
-bool lp_is_mydomain(struct loadparm_context *lp_ctx,
+bool lpcfg_is_mydomain(struct loadparm_context *lp_ctx,
const char *domain);
-bool lp_is_my_domain_or_realm(struct loadparm_context *lp_ctx,
+bool lpcfg_is_my_domain_or_realm(struct loadparm_context *lp_ctx,
const char *domain);
/**
see if a string matches either our primary or one of our secondary
netbios aliases. do a case insensitive match
*/
-bool lp_is_myname(struct loadparm_context *lp_ctx, const char *name);
+bool lpcfg_is_myname(struct loadparm_context *lp_ctx, const char *name);
/**
A useful function for returning a path in the Samba lock directory.
@@ -409,7 +451,7 @@ char *private_path(TALLOC_CTX* mem_ctx,
path itself
*/
char *smbd_tmp_path(TALLOC_CTX *mem_ctx,
- struct loadparm_context *lp_ctx,
+ struct loadparm_context *lp_ctx,
const char *name);
/**
@@ -436,13 +478,13 @@ bool run_init_functions(init_module_fn *fns);
* Will return an array of function pointers to initialization functions
*/
init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *subsystem);
-const char *lp_messaging_path(TALLOC_CTX *mem_ctx,
+const char *lpcfg_messaging_path(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx);
struct smb_iconv_convenience *smb_iconv_convenience_reinit_lp(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx,
struct smb_iconv_convenience *old_ic);
-const char *lp_sam_name(struct loadparm_context *lp_ctx);
+const char *lpcfg_sam_name(struct loadparm_context *lp_ctx);
/* The following definitions come from lib/version.c */
diff --git a/source4/param/provision.c b/source4/param/provision.c
index 0df370b4c2..b0387869b5 100644
--- a/source4/param/provision.c
+++ b/source4/param/provision.c
@@ -126,7 +126,7 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
settings->targetdir));
parameters = PyDict_New();
- configfile = lp_configfile(lp_ctx);
+ configfile = lpcfg_configfile(lp_ctx);
if (configfile != NULL) {
PyDict_SetItemString(parameters, "smbconf",
PyString_FromString(configfile));
@@ -193,7 +193,7 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
result->domaindn = talloc_strdup(mem_ctx, PyString_AsString(PyObject_GetAttrString(py_result, "domaindn")));
/* FIXME paths */
- result->lp_ctx = lp_from_py_object(result, PyObject_GetAttrString(py_result, "lp"));
+ result->lp_ctx = lpcfg_from_py_object(result, PyObject_GetAttrString(py_result, "lp"));
result->samdb = PyLdb_AsLdbContext(PyObject_GetAttrString(py_result, "samdb"));
return NT_STATUS_OK;
@@ -373,7 +373,7 @@ struct ldb_context *provision_get_schema(TALLOC_CTX *mem_ctx, struct loadparm_co
parameters = PyDict_New();
- setupdir = lp_setupdir(lp_ctx);
+ setupdir = lpcfg_setupdir(lp_ctx);
PyDict_SetItemString(parameters, "setup_dir",
PyString_FromString(setupdir));
if (override_prefixmap) {
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c
index a648f65d4e..b1e0d7df0e 100644
--- a/source4/param/pyparam.c
+++ b/source4/param/pyparam.c
@@ -50,51 +50,51 @@ static PyObject *py_lp_ctx_get_helper(struct loadparm_context *lp_ctx, const cha
strwicmp(service_name, GLOBAL_NAME2)) {
struct loadparm_service *service;
/* its a share parameter */
- service = lp_service(lp_ctx, service_name);
+ service = lpcfg_service(lp_ctx, service_name);
if (service == NULL) {
return NULL;
}
if (strchr(param_name, ':')) {
/* its a parametric option on a share */
- const char *type = talloc_strndup(lp_ctx, param_name,
+ const char *type = talloc_strndup(lp_ctx, param_name,
strcspn(param_name, ":"));
const char *option = strchr(param_name, ':') + 1;
const char *value;
if (type == NULL || option == NULL) {
return NULL;
}
- value = lp_get_parametric(lp_ctx, service, type, option);
+ value = lpcfg_get_parametric(lp_ctx, service, type, option);
if (value == NULL) {
return NULL;
}
return PyString_FromString(value);
}
- parm = lp_parm_struct(param_name);
+ parm = lpcfg_parm_struct(param_name);
if (parm == NULL || parm->pclass == P_GLOBAL) {
return NULL;
}
- parm_ptr = lp_parm_ptr(lp_ctx, service, parm);
+ parm_ptr = lpcfg_parm_ptr(lp_ctx, service, parm);
} else if (strchr(param_name, ':')) {
/* its a global parametric option */
- const char *type = talloc_strndup(lp_ctx,
+ const char *type = talloc_strndup(lp_ctx,
param_name, strcspn(param_name, ":"));
const char *option = strchr(param_name, ':') + 1;
const char *value;
if (type == NULL || option == NULL) {
return NULL;
}
- value = lp_get_parametric(lp_ctx, NULL, type, option);
+ value = lpcfg_get_parametric(lp_ctx, NULL, type, option);
if (value == NULL)
return NULL;
return PyString_FromString(value);
} else {
/* its a global parameter */
- parm = lp_parm_struct(param_name);
+ parm = lpcfg_parm_struct(param_name);
if (parm == NULL) {
return NULL;
}
- parm_ptr = lp_parm_ptr(lp_ctx, NULL, parm);
+ parm_ptr = lpcfg_parm_ptr(lp_ctx, NULL, parm);
}
if (parm == NULL || parm_ptr == NULL) {
@@ -149,7 +149,7 @@ static PyObject *py_lp_ctx_load(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &filename))
return NULL;
- ret = lp_load(PyLoadparmContext_AsLoadparmContext(self), filename);
+ ret = lpcfg_load(PyLoadparmContext_AsLoadparmContext(self), filename);
if (!ret) {
PyErr_Format(PyExc_RuntimeError, "Unable to load file %s", filename);
@@ -161,7 +161,7 @@ static PyObject *py_lp_ctx_load(py_talloc_Object *self, PyObject *args)
static PyObject *py_lp_ctx_load_default(py_talloc_Object *self)
{
bool ret;
- ret = lp_load_default(PyLoadparmContext_AsLoadparmContext(self));
+ ret = lpcfg_load_default(PyLoadparmContext_AsLoadparmContext(self));
if (!ret) {
PyErr_SetString(PyExc_RuntimeError, "Unable to load default file");
@@ -190,7 +190,7 @@ static PyObject *py_lp_ctx_is_myname(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
- return PyBool_FromLong(lp_is_myname(PyLoadparmContext_AsLoadparmContext(self), name));
+ return PyBool_FromLong(lpcfg_is_myname(PyLoadparmContext_AsLoadparmContext(self), name));
}
static PyObject *py_lp_ctx_is_mydomain(py_talloc_Object *self, PyObject *args)
@@ -199,7 +199,7 @@ static PyObject *py_lp_ctx_is_mydomain(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
- return PyBool_FromLong(lp_is_mydomain(PyLoadparmContext_AsLoadparmContext(self), name));
+ return PyBool_FromLong(lpcfg_is_mydomain(PyLoadparmContext_AsLoadparmContext(self), name));
}
static PyObject *py_lp_ctx_set(py_talloc_Object *self, PyObject *args)
@@ -209,7 +209,7 @@ static PyObject *py_lp_ctx_set(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "ss", &name, &value))
return NULL;
- ret = lp_set_cmdline(PyLoadparmContext_AsLoadparmContext(self), name, value);
+ ret = lpcfg_set_cmdline(PyLoadparmContext_AsLoadparmContext(self), name, value);
if (!ret) {
PyErr_SetString(PyExc_RuntimeError, "Unable to set parameter");
return NULL;
@@ -237,11 +237,11 @@ static PyObject *py_lp_ctx_services(py_talloc_Object *self)
struct loadparm_context *lp_ctx = PyLoadparmContext_AsLoadparmContext(self);
PyObject *ret;
int i;
- ret = PyList_New(lp_numservices(lp_ctx));
- for (i = 0; i < lp_numservices(lp_ctx); i++) {
- struct loadparm_service *service = lp_servicebynum(lp_ctx, i);
+ ret = PyList_New(lpcfg_numservices(lp_ctx));
+ for (i = 0; i < lpcfg_numservices(lp_ctx); i++) {
+ struct loadparm_service *service = lpcfg_servicebynum(lp_ctx, i);
if (service != NULL) {
- PyList_SetItem(ret, i, PyString_FromString(lp_servicename(service)));
+ PyList_SetItem(ret, i, PyString_FromString(lpcfg_servicename(service)));
}
}
return ret;
@@ -263,7 +263,7 @@ static PyObject *py_lp_dump(PyObject *self, PyObject *args)
return NULL;
}
- lp_dump(lp_ctx, f, show_defaults, lp_numservices(lp_ctx));
+ lpcfg_dump(lp_ctx, f, show_defaults, lpcfg_numservices(lp_ctx));
Py_RETURN_NONE;
}
@@ -299,12 +299,12 @@ static PyMethodDef py_lp_ctx_methods[] = {
static PyObject *py_lp_ctx_default_service(py_talloc_Object *self, void *closure)
{
- return PyLoadparmService_FromService(lp_default_service(PyLoadparmContext_AsLoadparmContext(self)));
+ return PyLoadparmService_FromService(lpcfg_default_service(PyLoadparmContext_AsLoadparmContext(self)));
}
static PyObject *py_lp_ctx_config_file(py_talloc_Object *self, void *closure)
{
- const char *configfile = lp_configfile(PyLoadparmContext_AsLoadparmContext(self));
+ const char *configfile = lpcfg_configfile(PyLoadparmContext_AsLoadparmContext(self));
if (configfile == NULL)
Py_RETURN_NONE;
else
@@ -336,7 +336,7 @@ static PyObject *py_lp_ctx_new(PyTypeObject *type, PyObject *args, PyObject *kwa
static Py_ssize_t py_lp_ctx_len(py_talloc_Object *self)
{
- return lp_numservices(PyLoadparmContext_AsLoadparmContext(self));
+ return lpcfg_numservices(PyLoadparmContext_AsLoadparmContext(self));
}
static PyObject *py_lp_ctx_getitem(py_talloc_Object *self, PyObject *name)
@@ -346,7 +346,7 @@ static PyObject *py_lp_ctx_getitem(py_talloc_Object *self, PyObject *name)
PyErr_SetString(PyExc_TypeError, "Only string subscripts are supported");
return NULL;
}
- service = lp_service(PyLoadparmContext_AsLoadparmContext(self), PyString_AsString(name));
+ service = lpcfg_service(PyLoadparmContext_AsLoadparmContext(self), PyString_AsString(name));
if (service == NULL) {
PyErr_SetString(PyExc_KeyError, "No such section");
return NULL;
@@ -396,7 +396,7 @@ static PyObject *py_lp_service_dump(PyObject *self, PyObject *args)
default_service = PyLoadparmService_AsLoadparmService(py_default_service);
- lp_dump_one(f, show_defaults, service, default_service);
+ lpcfg_dump_one(f, show_defaults, service, default_service);
Py_RETURN_NONE;
}
diff --git a/source4/param/pyparam.h b/source4/param/pyparam.h
index 4657dbafdf..e8944f5fa1 100644
--- a/source4/param/pyparam.h
+++ b/source4/param/pyparam.h
@@ -22,7 +22,7 @@
#include "param/param.h"
-_PUBLIC_ struct loadparm_context *lp_from_py_object(TALLOC_CTX *mem_ctx, PyObject *py_obj);
+_PUBLIC_ struct loadparm_context *lpcfg_from_py_object(TALLOC_CTX *mem_ctx, PyObject *py_obj);
_PUBLIC_ struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx);
#endif /* _PYPARAM_H_ */
diff --git a/source4/param/pyparam_util.c b/source4/param/pyparam_util.c
index 8136746f52..8c98cbcbfe 100644
--- a/source4/param/pyparam_util.c
+++ b/source4/param/pyparam_util.c
@@ -25,13 +25,13 @@
#define PyLoadparmContext_AsLoadparmContext(obj) py_talloc_get_type(obj, struct loadparm_context)
-_PUBLIC_ struct loadparm_context *lp_from_py_object(TALLOC_CTX *mem_ctx, PyObject *py_obj)
+_PUBLIC_ struct loadparm_context *lpcfg_from_py_object(TALLOC_CTX *mem_ctx, PyObject *py_obj)
{
struct loadparm_context *lp_ctx;
if (PyString_Check(py_obj)) {
lp_ctx = loadparm_init(mem_ctx);
- if (!lp_load(lp_ctx, PyString_AsString(py_obj))) {
+ if (!lpcfg_load(lp_ctx, PyString_AsString(py_obj))) {
talloc_free(lp_ctx);
PyErr_Format(PyExc_RuntimeError, "Unable to load %s",
PyString_AsString(py_obj));
@@ -43,7 +43,7 @@ _PUBLIC_ struct loadparm_context *lp_from_py_object(TALLOC_CTX *mem_ctx, PyObjec
if (py_obj == Py_None) {
lp_ctx = loadparm_init(mem_ctx);
/* We're not checking that loading the file succeeded *on purpose */
- lp_load_default(lp_ctx);
+ lpcfg_load_default(lp_ctx);
return lp_ctx;
}
@@ -54,7 +54,7 @@ struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx)
{
struct loadparm_context *ret;
ret = loadparm_init(mem_ctx);
- if (!lp_load_default(ret))
+ if (!lpcfg_load_default(ret))
return NULL;
return ret;
}
diff --git a/source4/param/secrets.c b/source4/param/secrets.c
index 8c135dc2c6..d17c5f71ce 100644
--- a/source4/param/secrets.c
+++ b/source4/param/secrets.c
@@ -93,7 +93,7 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx,
struct tevent_context *ev_ctx,
struct loadparm_context *lp_ctx)
{
- return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, lp_secrets_url(lp_ctx),
+ return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, lpcfg_secrets_url(lp_ctx),
NULL, NULL, 0);
}
diff --git a/source4/param/share_classic.c b/source4/param/share_classic.c
index d732372f45..fcfe548649 100644
--- a/source4/param/share_classic.c
+++ b/source4/param/share_classic.c
@@ -47,7 +47,7 @@ static const char *sclassic_string_option(struct share_config *scfg,
{
struct loadparm_service *s = talloc_get_type(scfg->opaque,
struct loadparm_service);
- struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
+ struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
struct loadparm_context);
char *parm, *val;
const char *ret;
@@ -61,7 +61,7 @@ static const char *sclassic_string_option(struct share_config *scfg,
*val = '\0';
val++;
- ret = lp_parm_string(lp_ctx, s, parm, val);
+ ret = lpcfg_parm_string(lp_ctx, s, parm, val);
if (!ret) {
ret = defval;
}
@@ -74,25 +74,25 @@ static const char *sclassic_string_option(struct share_config *scfg,
}
if (strcmp(opt_name, SHARE_PATH) == 0) {
- return lp_pathname(s, lp_default_service(lp_ctx));
+ return lpcfg_pathname(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_COMMENT) == 0) {
- return lp_comment(s, lp_default_service(lp_ctx));
+ return lpcfg_comment(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_VOLUME) == 0) {
- return volume_label(s, lp_default_service(lp_ctx));
+ return volume_label(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_TYPE) == 0) {
- if (lp_print_ok(s, lp_default_service(lp_ctx))) {
+ if (lpcfg_print_ok(s, lpcfg_default_service(lp_ctx))) {
return "PRINTER";
}
- if (strcmp("NTFS", lp_fstype(s, lp_default_service(lp_ctx))) == 0) {
+ if (strcmp("NTFS", lpcfg_fstype(s, lpcfg_default_service(lp_ctx))) == 0) {
return "DISK";
}
- return lp_fstype(s, lp_default_service(lp_ctx));
+ return lpcfg_fstype(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_PASSWORD) == 0) {
@@ -109,7 +109,7 @@ static int sclassic_int_option(struct share_config *scfg, const char *opt_name,
{
struct loadparm_service *s = talloc_get_type(scfg->opaque,
struct loadparm_service);
- struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
+ struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
struct loadparm_context);
char *parm, *val;
int ret;
@@ -123,7 +123,7 @@ static int sclassic_int_option(struct share_config *scfg, const char *opt_name,
*val = '\0';
val++;
- ret = lp_parm_int(lp_ctx, s, parm, val, defval);
+ ret = lpcfg_parm_int(lp_ctx, s, parm, val, defval);
if (!ret) {
ret = defval;
}
@@ -132,27 +132,27 @@ static int sclassic_int_option(struct share_config *scfg, const char *opt_name,
}
if (strcmp(opt_name, SHARE_CSC_POLICY) == 0) {
- return lp_csc_policy(s, lp_default_service(lp_ctx));
+ return lpcfg_csc_policy(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_MAX_CONNECTIONS) == 0) {
- return lp_max_connections(s, lp_default_service(lp_ctx));
+ return lpcfg_max_connections(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_CREATE_MASK) == 0) {
- return lp_create_mask(s, lp_default_service(lp_ctx));
+ return lpcfg_create_mask(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_DIR_MASK) == 0) {
- return lp_dir_mask(s, lp_default_service(lp_ctx));
+ return lpcfg_dir_mask(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_FORCE_DIR_MODE) == 0) {
- return lp_force_dir_mode(s, lp_default_service(lp_ctx));
+ return lpcfg_force_dir_mode(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_FORCE_CREATE_MODE) == 0) {
- return lp_force_create_mode(s, lp_default_service(lp_ctx));
+ return lpcfg_force_create_mode(s, lpcfg_default_service(lp_ctx));
}
@@ -167,7 +167,7 @@ static bool sclassic_bool_option(struct share_config *scfg, const char *opt_name
{
struct loadparm_service *s = talloc_get_type(scfg->opaque,
struct loadparm_service);
- struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
+ struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
struct loadparm_context);
char *parm, *val;
bool ret;
@@ -181,7 +181,7 @@ static bool sclassic_bool_option(struct share_config *scfg, const char *opt_name
*val = '\0';
val++;
- ret = lp_parm_bool(lp_ctx, s, parm, val, defval);
+ ret = lpcfg_parm_bool(lp_ctx, s, parm, val, defval);
talloc_free(parm);
return ret;
}
@@ -191,43 +191,43 @@ static bool sclassic_bool_option(struct share_config *scfg, const char *opt_name
}
if (strcmp(opt_name, SHARE_BROWSEABLE) == 0) {
- return lp_browseable(s, lp_default_service(lp_ctx));
+ return lpcfg_browseable(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_READONLY) == 0) {
- return lp_readonly(s, lp_default_service(lp_ctx));
+ return lpcfg_readonly(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_MAP_SYSTEM) == 0) {
- return lp_map_system(s, lp_default_service(lp_ctx));
+ return lpcfg_map_system(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_MAP_HIDDEN) == 0) {
- return lp_map_hidden(s, lp_default_service(lp_ctx));
+ return lpcfg_map_hidden(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_MAP_ARCHIVE) == 0) {
- return lp_map_archive(s, lp_default_service(lp_ctx));
+ return lpcfg_map_archive(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_STRICT_LOCKING) == 0) {
- return lp_strict_locking(s, lp_default_service(lp_ctx));
+ return lpcfg_strict_locking(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_OPLOCKS) == 0) {
- return lp_oplocks(s, lp_default_service(lp_ctx));
+ return lpcfg_oplocks(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_STRICT_SYNC) == 0) {
- return lp_strict_sync(s, lp_default_service(lp_ctx));
+ return lpcfg_strict_sync(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_MSDFS_ROOT) == 0) {
- return lp_msdfs_root(s, lp_default_service(lp_ctx));
+ return lpcfg_msdfs_root(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_CI_FILESYSTEM) == 0) {
- return lp_ci_filesystem(s, lp_default_service(lp_ctx));
+ return lpcfg_ci_filesystem(s, lpcfg_default_service(lp_ctx));
}
DEBUG(0,("request for unknown share bool option '%s'\n",
@@ -240,7 +240,7 @@ static const char **sclassic_string_list_option(TALLOC_CTX *mem_ctx, struct shar
{
struct loadparm_service *s = talloc_get_type(scfg->opaque,
struct loadparm_service);
- struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
+ struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
struct loadparm_context);
char *parm, *val;
const char **ret;
@@ -254,21 +254,21 @@ static const char **sclassic_string_list_option(TALLOC_CTX *mem_ctx, struct shar
*val = '\0';
val++;
- ret = lp_parm_string_list(mem_ctx, lp_ctx, s, parm, val, ",;");
+ ret = lpcfg_parm_string_list(mem_ctx, lp_ctx, s, parm, val, ",;");
talloc_free(parm);
return ret;
}
if (strcmp(opt_name, SHARE_HOSTS_ALLOW) == 0) {
- return lp_hostsallow(s, lp_default_service(lp_ctx));
+ return lpcfg_hostsallow(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_HOSTS_DENY) == 0) {
- return lp_hostsdeny(s, lp_default_service(lp_ctx));
+ return lpcfg_hostsdeny(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_NTVFS_HANDLER) == 0) {
- return lp_ntvfs_handler(s, lp_default_service(lp_ctx));
+ return lpcfg_ntvfs_handler(s, lpcfg_default_service(lp_ctx));
}
DEBUG(0,("request for unknown share list option '%s'\n",
@@ -286,7 +286,7 @@ static NTSTATUS sclassic_list_all(TALLOC_CTX *mem_ctx,
int num_services;
const char **n;
- num_services = lp_numservices((struct loadparm_context *)ctx->priv_data);
+ num_services = lpcfg_numservices((struct loadparm_context *)ctx->priv_data);
n = talloc_array(mem_ctx, const char *, num_services);
if (!n) {
@@ -295,7 +295,7 @@ static NTSTATUS sclassic_list_all(TALLOC_CTX *mem_ctx,
}
for (i = 0; i < num_services; i++) {
- n[i] = talloc_strdup(n, lp_servicename(lp_servicebynum((struct loadparm_context *)ctx->priv_data, i)));
+ n[i] = talloc_strdup(n, lpcfg_servicename(lpcfg_servicebynum((struct loadparm_context *)ctx->priv_data, i)));
if (!n[i]) {
DEBUG(0,("ERROR: Out of memory!\n"));
talloc_free(n);
@@ -317,7 +317,7 @@ static NTSTATUS sclassic_get_config(TALLOC_CTX *mem_ctx,
struct share_config *s;
struct loadparm_service *service;
- service = lp_service((struct loadparm_context *)ctx->priv_data, name);
+ service = lpcfg_service((struct loadparm_context *)ctx->priv_data, name);
if (service == NULL) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
@@ -329,7 +329,7 @@ static NTSTATUS sclassic_get_config(TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- s->name = talloc_strdup(s, lp_servicename(service));
+ s->name = talloc_strdup(s, lpcfg_servicename(service));
if (!s->name) {
DEBUG(0,("ERROR: Out of memory!\n"));
talloc_free(s);
diff --git a/source4/param/share_ldb.c b/source4/param/share_ldb.c
index 1d9f77421e..4517661c66 100644
--- a/source4/param/share_ldb.c
+++ b/source4/param/share_ldb.c
@@ -40,7 +40,7 @@ static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops,
return NT_STATUS_NO_MEMORY;
}
- sdb = ldb_wrap_connect(*ctx, ev_ctx, lp_ctx,
+ sdb = ldb_wrap_connect(*ctx, ev_ctx, lp_ctx,
private_path(*ctx, lp_ctx, "share.ldb"),
system_session(lp_ctx),
NULL, 0);
diff --git a/source4/param/tests/loadparm.c b/source4/param/tests/loadparm.c
index 49fcdf7249..2e44a29eed 100644
--- a/source4/param/tests/loadparm.c
+++ b/source4/param/tests/loadparm.c
@@ -32,26 +32,26 @@ static bool test_create(struct torture_context *tctx)
static bool test_set_option(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "workgroup=werkgroep"), "lp_set_option failed");
- torture_assert_str_equal(tctx, "WERKGROEP", lp_workgroup(lp_ctx), "workgroup");
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "workgroup=werkgroep"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, "WERKGROEP", lpcfg_workgroup(lp_ctx), "workgroup");
return true;
}
static bool test_set_cmdline(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_cmdline(lp_ctx, "workgroup", "werkgroep"), "lp_set_cmdline failed");
- torture_assert(tctx, lp_do_global_parameter(lp_ctx, "workgroup", "barbla"), "lp_set_option failed");
- torture_assert_str_equal(tctx, "WERKGROEP", lp_workgroup(lp_ctx), "workgroup");
+ torture_assert(tctx, lpcfg_set_cmdline(lp_ctx, "workgroup", "werkgroep"), "lpcfg_set_cmdline failed");
+ torture_assert(tctx, lpcfg_do_global_parameter(lp_ctx, "workgroup", "barbla"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, "WERKGROEP", lpcfg_workgroup(lp_ctx), "workgroup");
return true;
}
static bool test_do_global_parameter(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_do_global_parameter(lp_ctx, "workgroup", "werkgroep42"),
- "lp_set_cmdline failed");
- torture_assert_str_equal(tctx, lp_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
+ torture_assert(tctx, lpcfg_do_global_parameter(lp_ctx, "workgroup", "werkgroep42"),
+ "lpcfg_set_cmdline failed");
+ torture_assert_str_equal(tctx, lpcfg_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
return true;
}
@@ -59,9 +59,9 @@ static bool test_do_global_parameter(struct torture_context *tctx)
static bool test_do_global_parameter_var(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_do_global_parameter_var(lp_ctx, "workgroup", "werk%s%d", "groep", 42),
- "lp_set_cmdline failed");
- torture_assert_str_equal(tctx, lp_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
+ torture_assert(tctx, lpcfg_do_global_parameter_var(lp_ctx, "workgroup", "werk%s%d", "groep", 42),
+ "lpcfg_set_cmdline failed");
+ torture_assert_str_equal(tctx, lpcfg_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
return true;
}
@@ -69,15 +69,15 @@ static bool test_do_global_parameter_var(struct torture_context *tctx)
static bool test_set_option_invalid(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, !lp_set_option(lp_ctx, "workgroup"), "lp_set_option succeeded");
+ torture_assert(tctx, !lpcfg_set_option(lp_ctx, "workgroup"), "lpcfg_set_option succeeded");
return true;
}
static bool test_set_option_parametric(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=blaat"), "lp_set_option failed");
- torture_assert_str_equal(tctx, lp_parm_string(lp_ctx, NULL, "some", "thing"), "blaat",
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=blaat"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, lpcfg_parm_string(lp_ctx, NULL, "some", "thing"), "blaat",
"invalid parametric option");
return true;
}
@@ -85,10 +85,10 @@ static bool test_set_option_parametric(struct torture_context *tctx)
static bool test_lp_parm_double(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=3.4"), "lp_set_option failed");
- torture_assert(tctx, lp_parm_double(lp_ctx, NULL, "some", "thing", 2.0) == 3.4,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=3.4"), "lpcfg_set_option failed");
+ torture_assert(tctx, lpcfg_parm_double(lp_ctx, NULL, "some", "thing", 2.0) == 3.4,
"invalid parametric option");
- torture_assert(tctx, lp_parm_double(lp_ctx, NULL, "some", "bla", 2.0) == 2.0,
+ torture_assert(tctx, lpcfg_parm_double(lp_ctx, NULL, "some", "bla", 2.0) == 2.0,
"invalid parametric option");
return true;
}
@@ -96,10 +96,10 @@ static bool test_lp_parm_double(struct torture_context *tctx)
static bool test_lp_parm_bool(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=true"), "lp_set_option failed");
- torture_assert(tctx, lp_parm_bool(lp_ctx, NULL, "some", "thing", false) == true,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=true"), "lpcfg_set_option failed");
+ torture_assert(tctx, lpcfg_parm_bool(lp_ctx, NULL, "some", "thing", false) == true,
"invalid parametric option");
- torture_assert(tctx, lp_parm_bool(lp_ctx, NULL, "some", "bla", true) == true,
+ torture_assert(tctx, lpcfg_parm_bool(lp_ctx, NULL, "some", "bla", true) == true,
"invalid parametric option");
return true;
}
@@ -107,10 +107,10 @@ static bool test_lp_parm_bool(struct torture_context *tctx)
static bool test_lp_parm_int(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=34"), "lp_set_option failed");
- torture_assert_int_equal(tctx, lp_parm_int(lp_ctx, NULL, "some", "thing", 20), 34,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=34"), "lpcfg_set_option failed");
+ torture_assert_int_equal(tctx, lpcfg_parm_int(lp_ctx, NULL, "some", "thing", 20), 34,
"invalid parametric option");
- torture_assert_int_equal(tctx, lp_parm_int(lp_ctx, NULL, "some", "bla", 42), 42,
+ torture_assert_int_equal(tctx, lpcfg_parm_int(lp_ctx, NULL, "some", "bla", 42), 42,
"invalid parametric option");
return true;
}
@@ -118,10 +118,10 @@ static bool test_lp_parm_int(struct torture_context *tctx)
static bool test_lp_parm_bytes(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=16K"), "lp_set_option failed");
- torture_assert_int_equal(tctx, lp_parm_bytes(lp_ctx, NULL, "some", "thing", 20), 16 * 1024,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=16K"), "lpcfg_set_option failed");
+ torture_assert_int_equal(tctx, lpcfg_parm_bytes(lp_ctx, NULL, "some", "thing", 20), 16 * 1024,
"invalid parametric option");
- torture_assert_int_equal(tctx, lp_parm_bytes(lp_ctx, NULL, "some", "bla", 42), 42,
+ torture_assert_int_equal(tctx, lpcfg_parm_bytes(lp_ctx, NULL, "some", "bla", 42), 42,
"invalid parametric option");
return true;
}
@@ -129,10 +129,10 @@ static bool test_lp_parm_bytes(struct torture_context *tctx)
static bool test_lp_do_service_parameter(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- struct loadparm_service *service = lp_add_service(lp_ctx, lp_default_service(lp_ctx), "foo");
- torture_assert(tctx, lp_do_service_parameter(lp_ctx, service,
- "some:thing", "foo"), "lp_set_option failed");
- torture_assert_str_equal(tctx, lp_parm_string(lp_ctx, service, "some", "thing"), "foo",
+ struct loadparm_service *service = lpcfg_add_service(lp_ctx, lpcfg_default_service(lp_ctx), "foo");
+ torture_assert(tctx, lpcfg_do_service_parameter(lp_ctx, service,
+ "some:thing", "foo"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, lpcfg_parm_string(lp_ctx, service, "some", "thing"), "foo",
"invalid parametric option");
return true;
}
@@ -140,8 +140,8 @@ static bool test_lp_do_service_parameter(struct torture_context *tctx)
static bool test_lp_service(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- struct loadparm_service *service = lp_add_service(lp_ctx, lp_default_service(lp_ctx), "foo");
- torture_assert(tctx, service == lp_service(lp_ctx, "foo"), "invalid service");
+ struct loadparm_service *service = lpcfg_add_service(lp_ctx, lpcfg_default_service(lp_ctx), "foo");
+ torture_assert(tctx, service == lpcfg_service(lp_ctx, "foo"), "invalid service");
return true;
}
@@ -159,7 +159,7 @@ struct torture_suite *torture_local_loadparm(TALLOC_CTX *mem_ctx)
torture_suite_add_simple_test(suite, "set_lp_parm_int", test_lp_parm_int);
torture_suite_add_simple_test(suite, "set_lp_parm_bytes", test_lp_parm_bytes);
torture_suite_add_simple_test(suite, "service_parameter", test_lp_do_service_parameter);
- torture_suite_add_simple_test(suite, "lp_service", test_lp_service);
+ torture_suite_add_simple_test(suite, "lpcfg_service", test_lp_service);
torture_suite_add_simple_test(suite, "do_global_parameter_var", test_do_global_parameter_var);
torture_suite_add_simple_test(suite, "do_global_parameter", test_do_global_parameter);
diff --git a/source4/param/util.c b/source4/param/util.c
index bbe4c87293..dd1d3193f3 100644
--- a/source4/param/util.c
+++ b/source4/param/util.c
@@ -35,33 +35,33 @@
*/
-bool lp_is_mydomain(struct loadparm_context *lp_ctx,
+bool lpcfg_is_mydomain(struct loadparm_context *lp_ctx,
const char *domain)
{
- return strequal(lp_workgroup(lp_ctx), domain);
+ return strequal(lpcfg_workgroup(lp_ctx), domain);
}
-bool lp_is_my_domain_or_realm(struct loadparm_context *lp_ctx,
+bool lpcfg_is_my_domain_or_realm(struct loadparm_context *lp_ctx,
const char *domain)
{
- return strequal(lp_workgroup(lp_ctx), domain) ||
- strequal(lp_realm(lp_ctx), domain);
+ return strequal(lpcfg_workgroup(lp_ctx), domain) ||
+ strequal(lpcfg_realm(lp_ctx), domain);
}
/**
see if a string matches either our primary or one of our secondary
netbios aliases. do a case insensitive match
*/
-bool lp_is_myname(struct loadparm_context *lp_ctx, const char *name)
+bool lpcfg_is_myname(struct loadparm_context *lp_ctx, const char *name)
{
const char **aliases;
int i;
- if (strcasecmp(name, lp_netbios_name(lp_ctx)) == 0) {
+ if (strcasecmp(name, lpcfg_netbios_name(lp_ctx)) == 0) {
return true;
}
- aliases = lp_netbios_aliases(lp_ctx);
+ aliases = lpcfg_netbios_aliases(lp_ctx);
for (i=0; aliases && aliases[i]; i++) {
if (strcasecmp(name, aliases[i]) == 0) {
return true;
@@ -86,7 +86,7 @@ char *lock_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
return talloc_strdup(mem_ctx, name);
}
- dname = talloc_strdup(mem_ctx, lp_lockdir(lp_ctx));
+ dname = talloc_strdup(mem_ctx, lpcfg_lockdir(lp_ctx));
trim_string(dname,"","/");
if (!directory_exist(dname)) {
@@ -112,7 +112,7 @@ char *config_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
const char *name)
{
char *fname, *config_dir, *p;
- config_dir = talloc_strdup(mem_ctx, lp_configfile(lp_ctx));
+ config_dir = talloc_strdup(mem_ctx, lpcfg_configfile(lp_ctx));
if (config_dir == NULL) {
config_dir = talloc_strdup(mem_ctx, lp_default_path());
}
@@ -150,7 +150,7 @@ char *private_path(TALLOC_CTX* mem_ctx,
if (name[0] == 0 || name[0] == '/' || strstr(name, ":/")) {
return talloc_strdup(mem_ctx, name);
}
- fname = talloc_asprintf(mem_ctx, "%s/%s", lp_private_dir(lp_ctx), name);
+ fname = talloc_asprintf(mem_ctx, "%s/%s", lpcfg_private_dir(lp_ctx), name);
return fname;
}
@@ -160,7 +160,7 @@ char *private_path(TALLOC_CTX* mem_ctx,
path itself
*/
char *smbd_tmp_path(TALLOC_CTX *mem_ctx,
- struct loadparm_context *lp_ctx,
+ struct loadparm_context *lp_ctx,
const char *name)
{
char *fname, *dname;
@@ -271,7 +271,7 @@ static char *modules_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
{
const char *env_moduledir = getenv("LD_SAMBA_MODULE_PATH");
return talloc_asprintf(mem_ctx, "%s/%s",
- env_moduledir?env_moduledir:lp_modulesdir(lp_ctx),
+ env_moduledir?env_moduledir:lpcfg_modulesdir(lp_ctx),
name);
}
@@ -293,7 +293,7 @@ init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, struct loadparm_context
return ret;
}
-const char *lp_messaging_path(TALLOC_CTX *mem_ctx,
+const char *lpcfg_messaging_path(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx)
{
return smbd_tmp_path(mem_ctx, lp_ctx, "messaging");
@@ -303,20 +303,20 @@ struct smb_iconv_convenience *smb_iconv_convenience_reinit_lp(TALLOC_CTX *mem_ct
struct loadparm_context *lp_ctx,
struct smb_iconv_convenience *old_ic)
{
- return smb_iconv_convenience_reinit(mem_ctx, lp_dos_charset(lp_ctx),
- lp_unix_charset(lp_ctx),
- lp_parm_bool(lp_ctx, NULL, "iconv", "native", true),
+ return smb_iconv_convenience_reinit(mem_ctx, lpcfg_dos_charset(lp_ctx),
+ lpcfg_unix_charset(lp_ctx),
+ lpcfg_parm_bool(lp_ctx, NULL, "iconv", "native", true),
old_ic);
}
-const char *lp_sam_name(struct loadparm_context *lp_ctx)
+const char *lpcfg_sam_name(struct loadparm_context *lp_ctx)
{
- switch (lp_server_role(lp_ctx)) {
+ switch (lpcfg_server_role(lp_ctx)) {
case ROLE_DOMAIN_CONTROLLER:
- return lp_workgroup(lp_ctx);
+ return lpcfg_workgroup(lp_ctx);
default:
- return lp_netbios_name(lp_ctx);
+ return lpcfg_netbios_name(lp_ctx);
}
}