From 6b266b85cf34145ac1f03d8f787b81121e4ec92b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Jul 2010 14:32:42 +1000 Subject: s4-loadparm: 2nd half of lp_ to lpcfg_ conversion this converts all callers that use the Samba4 loadparm lp_ calling convention to use the lpcfg_ prefix. Signed-off-by: Andrew Bartlett --- lib/torture/torture.c | 10 +-- lib/util/charset/tests/iconv.c | 10 +-- lib/util/tests/strlist.c | 4 +- libcli/nbt/tools/nmblookup.c | 4 +- nsswitch/libwbclient/tests/wbclient.c | 2 +- source4/auth/credentials/credentials.c | 6 +- source4/auth/credentials/credentials_files.c | 6 +- source4/auth/credentials/credentials_krb5.c | 12 +-- source4/auth/credentials/pycredentials.c | 12 +-- source4/auth/gensec/gensec.c | 6 +- source4/auth/gensec/gensec_gssapi.c | 8 +- source4/auth/gensec/pygensec.c | 2 +- source4/auth/gensec/schannel.c | 6 +- source4/auth/gensec/spnego.c | 2 +- source4/auth/kerberos/krb5_init_context.c | 4 +- source4/auth/ntlm/auth.c | 10 +-- source4/auth/ntlm/auth_anonymous.c | 2 +- source4/auth/ntlm/auth_sam.c | 22 ++--- source4/auth/ntlm/auth_server.c | 18 ++-- source4/auth/ntlm/auth_unix.c | 10 +-- source4/auth/ntlm/auth_util.c | 6 +- source4/auth/ntlmssp/ntlmssp_client.c | 10 +-- source4/auth/ntlmssp/ntlmssp_server.c | 10 +-- source4/auth/pyauth.c | 6 +- source4/auth/samba_server_gensec.c | 2 +- source4/auth/session.c | 2 +- source4/auth/system_session.c | 14 ++-- source4/cldap_server/cldap_server.c | 10 +-- source4/cldap_server/netlogon.c | 20 ++--- source4/client/cifsdd.c | 20 ++--- source4/client/client.c | 22 ++--- source4/dsdb/common/util.c | 4 +- source4/dsdb/dns/dns_update.c | 18 ++-- source4/dsdb/kcc/kcc_deleted.c | 2 +- source4/dsdb/kcc/kcc_periodic.c | 2 +- source4/dsdb/kcc/kcc_service.c | 6 +- source4/dsdb/repl/drepl_out_helpers.c | 2 +- source4/dsdb/repl/drepl_ridalloc.c | 2 +- source4/dsdb/repl/drepl_service.c | 8 +- source4/dsdb/samdb/ldb_modules/acl.c | 2 +- source4/dsdb/samdb/ldb_modules/kludge_acl.c | 2 +- source4/dsdb/samdb/ldb_modules/partition.c | 2 +- source4/dsdb/samdb/ldb_modules/password_hash.c | 12 +-- source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 2 +- source4/dsdb/samdb/ldb_modules/ridalloc.c | 2 +- source4/dsdb/samdb/ldb_modules/samba3sid.c | 2 +- source4/dsdb/samdb/ldb_modules/samldb.c | 2 +- source4/dsdb/samdb/samdb.c | 8 +- source4/dsdb/samdb/samdb_privilege.c | 2 +- source4/kdc/db-glue.c | 18 ++-- source4/kdc/kdc.c | 14 ++-- source4/kdc/kpasswdd.c | 4 +- source4/kdc/mit_samba.c | 6 +- source4/kdc/pac-glue.c | 4 +- source4/ldap_server/ldap_backend.c | 6 +- source4/ldap_server/ldap_server.c | 24 +++--- source4/lib/cmdline/popt_common.c | 28 +++---- source4/lib/com/dcom/main.c | 4 +- source4/lib/ldb-samba/ldb_wrap.c | 8 +- source4/lib/ldb-samba/pyldb.c | 2 +- source4/lib/messaging/pymessaging.c | 4 +- source4/lib/messaging/tests/irpc.c | 6 +- source4/lib/messaging/tests/messaging.c | 6 +- source4/lib/policy/gp_filesys.c | 12 +-- source4/lib/policy/gp_ldap.c | 2 +- source4/lib/policy/gp_manage.c | 2 +- source4/lib/registry/pyregistry.c | 4 +- source4/lib/registry/samba.c | 2 +- source4/lib/socket/testsuite.c | 4 +- source4/lib/tls/tls.c | 16 ++-- source4/libcli/ldap/ldap_bind.c | 2 +- source4/libcli/ldap/ldap_client.c | 8 +- source4/libcli/resolve/bcast.c | 4 +- source4/libcli/resolve/file.c | 2 +- source4/libcli/resolve/resolve_lp.c | 4 +- source4/libcli/resolve/wins.c | 4 +- source4/libcli/smb_composite/smb_composite.h | 2 +- source4/libcli/wrepl/winsrepl.c | 2 +- source4/libnet/libnet.c | 2 +- source4/libnet/libnet_become_dc.c | 10 +-- source4/libnet/libnet_join.c | 8 +- source4/libnet/libnet_lookup.c | 6 +- source4/libnet/libnet_samdump.c | 2 +- source4/libnet/libnet_samsync_ldb.c | 4 +- source4/libnet/libnet_site.c | 4 +- source4/libnet/libnet_unbecome_dc.c | 2 +- source4/libnet/libnet_vampire.c | 14 ++-- source4/libnet/py_net.c | 4 +- source4/librpc/rpc/dcerpc_connect.c | 26 +++--- source4/librpc/rpc/dcerpc_schannel.c | 2 +- source4/librpc/rpc/dcerpc_util.c | 8 +- source4/librpc/rpc/pyrpc.c | 4 +- source4/nbt_server/dgram/netlogon.c | 12 +-- source4/nbt_server/dgram/ntlogon.c | 6 +- source4/nbt_server/dgram/request.c | 8 +- source4/nbt_server/interfaces.c | 16 ++-- source4/nbt_server/nbt_server.c | 2 +- source4/nbt_server/packet.c | 2 +- source4/nbt_server/query.c | 2 +- source4/nbt_server/register.c | 26 +++--- source4/nbt_server/wins/wins_ldb.c | 4 +- source4/nbt_server/wins/winsclient.c | 10 +-- source4/nbt_server/wins/winsdb.c | 10 +-- source4/nbt_server/wins/winsserver.c | 26 +++--- source4/nbt_server/wins/winswack.c | 6 +- source4/ntp_signd/ntp_signd.c | 8 +- source4/ntptr/simple_ldb/ntptr_simple_ldb.c | 8 +- source4/ntvfs/cifs/vfs_cifs.c | 14 ++-- source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c | 2 +- source4/ntvfs/ipc/rap_server.c | 2 +- source4/ntvfs/ipc/vfs_ipc.c | 2 +- source4/ntvfs/posix/pvfs_shortname.c | 4 +- source4/ntvfs/posix/vfs_posix.c | 2 +- source4/ntvfs/print/vfs_print.c | 2 +- source4/ntvfs/simple/vfs_simple.c | 2 +- source4/ntvfs/smb2/vfs_smb2.c | 10 +-- source4/param/generic.c | 8 +- source4/param/provision.c | 6 +- source4/param/pyparam.c | 48 +++++------ source4/param/pyparam.h | 2 +- source4/param/pyparam_util.c | 8 +- source4/param/secrets.c | 2 +- source4/param/share_classic.c | 74 ++++++++--------- source4/param/share_ldb.c | 2 +- source4/param/tests/loadparm.c | 66 +++++++-------- source4/param/util.c | 42 +++++----- source4/rpc_server/common/server_info.c | 12 +-- source4/rpc_server/dcerpc_server.c | 20 ++--- source4/rpc_server/dcesrv_auth.c | 2 +- source4/rpc_server/drsuapi/addentry.c | 2 +- source4/rpc_server/drsuapi/dcesrv_drsuapi.c | 4 +- source4/rpc_server/drsuapi/drsutil.c | 2 +- source4/rpc_server/drsuapi/getncchanges.c | 8 +- source4/rpc_server/lsa/dcesrv_lsa.c | 12 +-- source4/rpc_server/lsa/lsa_init.c | 4 +- source4/rpc_server/lsa/lsa_lookup.c | 4 +- source4/rpc_server/netlogon/dcerpc_netlogon.c | 32 +++---- source4/rpc_server/remote/dcesrv_remote.c | 12 +-- source4/rpc_server/samr/dcesrv_samr.c | 14 ++-- source4/rpc_server/samr/samr_password.c | 10 +-- source4/rpc_server/service_rpc.c | 20 ++--- source4/rpc_server/spoolss/dcesrv_spoolss.c | 12 +-- source4/rpc_server/srvsvc/dcesrv_srvsvc.c | 22 ++--- source4/rpc_server/srvsvc/srvsvc_ntvfs.c | 2 +- source4/rpc_server/wkssvc/dcesrv_wkssvc.c | 2 +- source4/scripting/python/pyglue.c | 4 +- source4/smb_server/smb/negprot.c | 52 ++++++------ source4/smb_server/smb/receive.c | 6 +- source4/smb_server/smb/service.c | 2 +- source4/smb_server/smb/sesssetup.c | 2 +- source4/smb_server/smb/signing.c | 4 +- source4/smb_server/smb/trans2.c | 18 ++-- source4/smb_server/smb2/negprot.c | 8 +- source4/smb_server/smb2/receive.c | 2 +- source4/smb_server/smb_samba3.c | 16 ++-- source4/smb_server/smb_server.c | 20 ++--- source4/smbd/process_model.h | 4 +- source4/smbd/process_prefork.c | 4 +- source4/smbd/process_single.c | 6 +- source4/smbd/process_standard.c | 4 +- source4/smbd/process_thread.c | 6 +- source4/smbd/server.c | 14 ++-- source4/smbd/service_named_pipe.c | 2 +- source4/smbd/service_stream.c | 6 +- source4/smbd/service_task.c | 2 +- source4/torture/auth/ntlmssp.c | 4 +- source4/torture/auth/pac.c | 2 +- source4/torture/basic/base.c | 20 ++--- source4/torture/basic/charset.c | 2 +- source4/torture/basic/misc.c | 58 ++++++------- source4/torture/basic/secleak.c | 6 +- source4/torture/gentest.c | 22 ++--- source4/torture/ldap/cldap.c | 10 +-- source4/torture/ldap/cldapbench.c | 6 +- source4/torture/libnet/domain.c | 2 +- source4/torture/libnet/groupinfo.c | 2 +- source4/torture/libnet/groupman.c | 2 +- source4/torture/libnet/libnet_BecomeDC.c | 6 +- source4/torture/libnet/libnet_domain.c | 8 +- source4/torture/libnet/libnet_group.c | 6 +- source4/torture/libnet/libnet_lookup.c | 4 +- source4/torture/libnet/libnet_rpc.c | 6 +- source4/torture/libnet/libnet_user.c | 16 ++-- source4/torture/libnet/userinfo.c | 2 +- source4/torture/libnet/userman.c | 6 +- source4/torture/local/dbspeed.c | 2 +- source4/torture/locktest.c | 18 ++-- source4/torture/locktest2.c | 12 +-- source4/torture/masktest.c | 12 +-- source4/torture/nbt/browse.c | 2 +- source4/torture/nbt/dgram.c | 48 +++++------ source4/torture/nbt/nbt.c | 2 +- source4/torture/nbt/query.c | 2 +- source4/torture/nbt/register.c | 8 +- source4/torture/nbt/wins.c | 24 +++--- source4/torture/nbt/winsbench.c | 4 +- source4/torture/nbt/winsreplication.c | 18 ++-- source4/torture/ntp/ntp_signd.c | 2 +- source4/torture/rap/sam.c | 6 +- source4/torture/raw/composite.c | 22 ++--- source4/torture/raw/context.c | 34 ++++---- source4/torture/raw/lock.c | 6 +- source4/torture/raw/lockbench.c | 12 +-- source4/torture/raw/openbench.c | 12 +-- source4/torture/raw/oplock.c | 12 +-- source4/torture/raw/samba3misc.c | 8 +- source4/torture/raw/tconrate.c | 12 +-- source4/torture/rpc/countcalls.c | 2 +- source4/torture/rpc/drsuapi.c | 6 +- source4/torture/rpc/dssync.c | 36 ++++---- source4/torture/rpc/frsapi.c | 2 +- source4/torture/rpc/join.c | 20 ++--- source4/torture/rpc/mgmt.c | 2 +- source4/torture/rpc/netlogon.c | 42 +++++----- source4/torture/rpc/remote_pac.c | 12 +-- source4/torture/rpc/samba3rpc.c | 80 +++++++++--------- source4/torture/rpc/samlogon.c | 10 +-- source4/torture/rpc/samr.c | 4 +- source4/torture/rpc/samr_accessmask.c | 12 +-- source4/torture/rpc/samsync.c | 12 +-- source4/torture/rpc/scanner.c | 2 +- source4/torture/rpc/schannel.c | 16 ++-- source4/torture/rpc/session_key.c | 6 +- source4/torture/rpc/spoolss.c | 12 +-- source4/torture/rpc/spoolss_access.c | 2 +- source4/torture/rpc/spoolss_notify.c | 4 +- source4/torture/rpc/testjoin.c | 6 +- source4/torture/rpc/wkssvc.c | 20 ++--- source4/torture/shell.c | 4 +- source4/torture/smb2/oplock.c | 10 +-- source4/torture/smb2/scan.c | 18 ++-- source4/torture/smb2/util.c | 10 +-- source4/torture/smbiconv.c | 2 +- source4/torture/smbtorture.c | 106 ++++++++++++------------ source4/torture/unix/unix_info2.c | 12 +-- source4/torture/unix/whoami.c | 12 +-- source4/torture/util_smb.c | 14 ++-- source4/torture/winbind/struct_based.c | 10 +-- source4/utils/net/net_gpo.c | 4 +- source4/utils/net/net_join.c | 2 +- source4/utils/ntlm_auth.c | 32 +++---- source4/web_server/web_server.c | 14 ++-- source4/winbind/idmap.c | 6 +- source4/winbind/wb_cmd_getpwnam.c | 4 +- source4/winbind/wb_cmd_getpwuid.c | 4 +- source4/winbind/wb_dom_info.c | 6 +- source4/winbind/wb_dom_info_trusted.c | 2 +- source4/winbind/wb_init_domain.c | 8 +- source4/winbind/wb_pam_auth.c | 6 +- source4/winbind/wb_samba3_cmd.c | 8 +- source4/winbind/wb_server.c | 26 +++--- source4/winbind/wb_sid2domain.c | 2 +- source4/winbind/wb_utils.c | 4 +- source4/wrepl_server/wrepl_apply_records.c | 2 +- source4/wrepl_server/wrepl_in_connection.c | 14 ++-- source4/wrepl_server/wrepl_scavenging.c | 2 +- source4/wrepl_server/wrepl_server.c | 24 +++--- 257 files changed, 1312 insertions(+), 1312 deletions(-) diff --git a/lib/torture/torture.c b/lib/torture/torture.c index 4333f98990..71bd53bbf3 100644 --- a/lib/torture/torture.c +++ b/lib/torture/torture.c @@ -450,27 +450,27 @@ bool torture_run_test(struct torture_context *context, int torture_setting_int(struct torture_context *test, const char *name, int default_value) { - return lp_parm_int(test->lp_ctx, NULL, "torture", name, default_value); + return lpcfg_parm_int(test->lp_ctx, NULL, "torture", name, default_value); } unsigned long torture_setting_ulong(struct torture_context *test, const char *name, unsigned long default_value) { - return lp_parm_ulong(test->lp_ctx, NULL, "torture", name, + return lpcfg_parm_ulong(test->lp_ctx, NULL, "torture", name, default_value); } double torture_setting_double(struct torture_context *test, const char *name, double default_value) { - return lp_parm_double(test->lp_ctx, NULL, "torture", name, default_value); + return lpcfg_parm_double(test->lp_ctx, NULL, "torture", name, default_value); } bool torture_setting_bool(struct torture_context *test, const char *name, bool default_value) { - return lp_parm_bool(test->lp_ctx, NULL, "torture", name, default_value); + return lpcfg_parm_bool(test->lp_ctx, NULL, "torture", name, default_value); } const char *torture_setting_string(struct torture_context *test, @@ -482,7 +482,7 @@ const char *torture_setting_string(struct torture_context *test, SMB_ASSERT(test != NULL); SMB_ASSERT(test->lp_ctx != NULL); - ret = lp_parm_string(test->lp_ctx, NULL, "torture", name); + ret = lpcfg_parm_string(test->lp_ctx, NULL, "torture", name); if (ret == NULL) return default_value; diff --git a/lib/util/charset/tests/iconv.c b/lib/util/charset/tests/iconv.c index 178192ec2d..2b6679e799 100644 --- a/lib/util/charset/tests/iconv.c +++ b/lib/util/charset/tests/iconv.c @@ -35,7 +35,7 @@ static bool iconv_untestable(struct torture_context *tctx) { iconv_t cd; - if (!lp_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true)) + if (!lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true)) torture_skip(tctx, "system iconv disabled - skipping test"); cd = iconv_open("UTF-16LE", "UCS-4LE"); @@ -158,8 +158,8 @@ static bool test_buffer(struct torture_context *test, "failed to open %s to UTF-16LE", charset)); } - cd2 = smb_iconv_open_ex(test, charset, "UTF-16LE", lp_parm_bool(test->lp_ctx, NULL, "iconv", "native", true)); - cd3 = smb_iconv_open_ex(test, "UTF-16LE", charset, lp_parm_bool(test->lp_ctx, NULL, "iconv", "native", true)); + cd2 = smb_iconv_open_ex(test, charset, "UTF-16LE", lpcfg_parm_bool(test->lp_ctx, NULL, "iconv", "native", true)); + cd3 = smb_iconv_open_ex(test, "UTF-16LE", charset, lpcfg_parm_bool(test->lp_ctx, NULL, "iconv", "native", true)); last_charset = charset; } @@ -289,7 +289,7 @@ static bool test_codepoint(struct torture_context *tctx, unsigned int codepoint) size_t size, size2; codepoint_t c; - size = push_codepoint_convenience(lp_iconv_convenience(tctx->lp_ctx), (char *)buf, codepoint); + size = push_codepoint_convenience(lpcfg_iconv_convenience(tctx->lp_ctx), (char *)buf, codepoint); torture_assert(tctx, size != -1 || (codepoint >= 0xd800 && codepoint <= 0x10000), "Invalid Codepoint range"); @@ -300,7 +300,7 @@ static bool test_codepoint(struct torture_context *tctx, unsigned int codepoint) buf[size+2] = random(); buf[size+3] = random(); - c = next_codepoint_convenience(lp_iconv_convenience(tctx->lp_ctx), (char *)buf, &size2); + c = next_codepoint_convenience(lpcfg_iconv_convenience(tctx->lp_ctx), (char *)buf, &size2); torture_assert(tctx, c == codepoint, talloc_asprintf(tctx, diff --git a/lib/util/tests/strlist.c b/lib/util/tests/strlist.c index bf5624383c..ce7d1e4e9b 100644 --- a/lib/util/tests/strlist.c +++ b/lib/util/tests/strlist.c @@ -376,8 +376,8 @@ static bool test_list_unique_2(struct torture_context *tctx) const char **list = (const char **)str_list_make_empty(tctx); const char **list_dup = (const char **)str_list_make_empty(tctx); - count = lp_parm_int(tctx->lp_ctx, NULL, "list_unique", "count", 9); - num_dups = lp_parm_int(tctx->lp_ctx, NULL, "list_unique", "dups", 7); + count = lpcfg_parm_int(tctx->lp_ctx, NULL, "list_unique", "count", 9); + num_dups = lpcfg_parm_int(tctx->lp_ctx, NULL, "list_unique", "dups", 7); torture_comment(tctx, "test_list_unique_2() with %d elements and %d dups\n", count, num_dups); for (i = 0; i < count; i++) { diff --git a/libcli/nbt/tools/nmblookup.c b/libcli/nbt/tools/nmblookup.c index b756c1e30c..7950ab8001 100644 --- a/libcli/nbt/tools/nmblookup.c +++ b/libcli/nbt/tools/nmblookup.c @@ -357,14 +357,14 @@ int main(int argc, const char *argv[]) exit(1); } - load_interfaces(NULL, lp_interfaces(cmdline_lp_ctx), &ifaces); + load_interfaces(NULL, lpcfg_interfaces(cmdline_lp_ctx), &ifaces); ev = s4_event_context_init(talloc_autofree_context()); while (poptPeekArg(pc)) { const char *name = poptGetArg(pc); - ret &= process_one(cmdline_lp_ctx, ev, ifaces, name, lp_nbt_port(cmdline_lp_ctx)); + ret &= process_one(cmdline_lp_ctx, ev, ifaces, name, lpcfg_nbt_port(cmdline_lp_ctx)); } talloc_free(ev); diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c index e2b3794d06..948081bb1a 100644 --- a/nsswitch/libwbclient/tests/wbclient.c +++ b/nsswitch/libwbclient/tests/wbclient.c @@ -611,7 +611,7 @@ static bool test_wbc_change_password(struct torture_context *tctx) E_md4hash(oldpass, old_nt_hash); E_md4hash(newpass, new_nt_hash); - if (lp_client_lanman_auth(tctx->lp_ctx) && + if (lpcfg_client_lanman_auth(tctx->lp_ctx) && E_deshash(newpass, new_lanman_hash) && E_deshash(oldpass, old_lanman_hash)) { diff --git a/source4/auth/credentials/credentials.c b/source4/auth/credentials/credentials.c index 8aff75373e..acdcfdee69 100644 --- a/source4/auth/credentials/credentials.c +++ b/source4/auth/credentials/credentials.c @@ -669,9 +669,9 @@ _PUBLIC_ void cli_credentials_set_conf(struct cli_credentials *cred, struct loadparm_context *lp_ctx) { cli_credentials_set_username(cred, "", CRED_UNINITIALISED); - cli_credentials_set_domain(cred, lp_workgroup(lp_ctx), CRED_UNINITIALISED); - cli_credentials_set_workstation(cred, lp_netbios_name(lp_ctx), CRED_UNINITIALISED); - cli_credentials_set_realm(cred, lp_realm(lp_ctx), CRED_UNINITIALISED); + cli_credentials_set_domain(cred, lpcfg_workgroup(lp_ctx), CRED_UNINITIALISED); + cli_credentials_set_workstation(cred, lpcfg_netbios_name(lp_ctx), CRED_UNINITIALISED); + cli_credentials_set_realm(cred, lpcfg_realm(lp_ctx), CRED_UNINITIALISED); } /** diff --git a/source4/auth/credentials/credentials_files.c b/source4/auth/credentials/credentials_files.c index 2e88cf4c4e..e0fd052cbc 100644 --- a/source4/auth/credentials/credentials_files.c +++ b/source4/auth/credentials/credentials_files.c @@ -361,7 +361,7 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cr cred->machine_account_pending = false; filter = talloc_asprintf(cred, SECRETS_PRIMARY_DOMAIN_FILTER, cli_credentials_get_domain(cred)); - status = cli_credentials_set_secrets(cred, event_context_find(cred), lp_ctx, NULL, + status = cli_credentials_set_secrets(cred, event_context_find(cred), lp_ctx, NULL, SECRETS_PRIMARY_DOMAIN_DN, filter, &error_string); if (!NT_STATUS_IS_OK(status)) { @@ -391,7 +391,7 @@ NTSTATUS cli_credentials_set_krbtgt(struct cli_credentials *cred, filter = talloc_asprintf(cred, SECRETS_KRBTGT_SEARCH, cli_credentials_get_realm(cred), cli_credentials_get_domain(cred)); - status = cli_credentials_set_secrets(cred, event_ctx, lp_ctx, NULL, + status = cli_credentials_set_secrets(cred, event_ctx, lp_ctx, NULL, SECRETS_PRINCIPALS_DN, filter, &error_string); if (!NT_STATUS_IS_OK(status)) { @@ -423,7 +423,7 @@ _PUBLIC_ NTSTATUS cli_credentials_set_stored_principal(struct cli_credentials *c cli_credentials_get_realm(cred), cli_credentials_get_domain(cred), serviceprincipal); - status = cli_credentials_set_secrets(cred, event_ctx, lp_ctx, NULL, + status = cli_credentials_set_secrets(cred, event_ctx, lp_ctx, NULL, SECRETS_PRINCIPALS_DN, filter, &error_string); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/auth/credentials/credentials_krb5.c b/source4/auth/credentials/credentials_krb5.c index f4ee2641d9..622f674bf8 100644 --- a/source4/auth/credentials/credentials_krb5.c +++ b/source4/auth/credentials/credentials_krb5.c @@ -41,7 +41,7 @@ _PUBLIC_ int cli_credentials_get_krb5_context(struct cli_credentials *cred, return 0; } - ret = smb_krb5_init_context(cred, event_ctx, lp_ctx, + ret = smb_krb5_init_context(cred, event_ctx, lp_ctx, &cred->smb_krb5_context); if (ret) { cred->smb_krb5_context = NULL; @@ -144,7 +144,7 @@ _PUBLIC_ int cli_credentials_set_ccache(struct cli_credentials *cred, return ENOMEM; } - ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx, + ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx, &ccc->smb_krb5_context); if (ret) { (*error_string) = error_message(ret); @@ -216,7 +216,7 @@ static int cli_credentials_new_ccache(struct cli_credentials *cred, return ENOMEM; } - ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx, + ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx, &ccc->smb_krb5_context); if (ret) { talloc_free(ccc); @@ -417,7 +417,7 @@ _PUBLIC_ int cli_credentials_get_client_gss_creds(struct cli_credentials *cred, return 0; } - ret = cli_credentials_get_ccache(cred, event_ctx, lp_ctx, + ret = cli_credentials_get_ccache(cred, event_ctx, lp_ctx, &ccache, error_string); if (ret) { DEBUG(1, ("Failed to get CCACHE for GSSAPI client: %s\n", error_message(ret))); @@ -607,7 +607,7 @@ _PUBLIC_ int cli_credentials_get_keytab(struct cli_credentials *cred, return EINVAL; } - ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx, + ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx, &smb_krb5_context); if (ret) { return ret; @@ -683,7 +683,7 @@ _PUBLIC_ int cli_credentials_set_keytab_name(struct cli_credentials *cred, _PUBLIC_ int cli_credentials_update_keytab(struct cli_credentials *cred, struct tevent_context *event_ctx, - struct loadparm_context *lp_ctx) + struct loadparm_context *lp_ctx) { krb5_error_code ret; struct keytab_container *ktc; diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c index 361e4c9a1f..86ce63ef98 100644 --- a/source4/auth/credentials/pycredentials.c +++ b/source4/auth/credentials/pycredentials.c @@ -204,8 +204,8 @@ static PyObject *py_creds_guess(py_talloc_Object *self, PyObject *args) if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx)) return NULL; - lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ - if (lp_ctx == NULL) + lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ + if (lp_ctx == NULL) return NULL; cli_credentials_guess(creds, lp_ctx); @@ -225,8 +225,8 @@ static PyObject *py_creds_set_machine_account(py_talloc_Object *self, PyObject * if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx)) return NULL; - lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ - if (lp_ctx == NULL) + lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ + if (lp_ctx == NULL) return NULL; status = cli_credentials_set_machine_account(creds, lp_ctx); @@ -270,8 +270,8 @@ static PyObject *py_creds_get_named_ccache(py_talloc_Object *self, PyObject *arg if (!PyArg_ParseTuple(args, "|Os", &py_lp_ctx, &ccache_name)) return NULL; - lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ - if (lp_ctx == NULL) + lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ + if (lp_ctx == NULL) return NULL; event_ctx = tevent_context_init(NULL); diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c index b166d238de..3520585c95 100644 --- a/source4/auth/gensec/gensec.c +++ b/source4/auth/gensec/gensec.c @@ -47,7 +47,7 @@ _PUBLIC_ struct gensec_security_ops **gensec_security_all(void) bool gensec_security_ops_enabled(struct gensec_security_ops *ops, struct gensec_security *security) { - return lp_parm_bool(security->settings->lp_ctx, NULL, "gensec", ops->name, ops->enabled); + return lpcfg_parm_bool(security->settings->lp_ctx, NULL, "gensec", ops->name, ops->enabled); } /* Sometimes we want to force only kerberos, sometimes we want to @@ -1397,12 +1397,12 @@ static int sort_gensec(struct gensec_security_ops **gs1, struct gensec_security_ int gensec_setting_int(struct gensec_settings *settings, const char *mechanism, const char *name, int default_value) { - return lp_parm_int(settings->lp_ctx, NULL, mechanism, name, default_value); + return lpcfg_parm_int(settings->lp_ctx, NULL, mechanism, name, default_value); } bool gensec_setting_bool(struct gensec_settings *settings, const char *mechanism, const char *name, bool default_value) { - return lp_parm_bool(settings->lp_ctx, NULL, mechanism, name, default_value); + return lpcfg_parm_bool(settings->lp_ctx, NULL, mechanism, name, default_value); } /* diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c index 88fbcce532..f28ab95dbd 100644 --- a/source4/auth/gensec/gensec_gssapi.c +++ b/source4/auth/gensec/gensec_gssapi.c @@ -247,7 +247,7 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security) return NT_STATUS_INTERNAL_ERROR; } - realm = lp_realm(gensec_security->settings->lp_ctx); + realm = lpcfg_realm(gensec_security->settings->lp_ctx); if (realm != NULL) { ret = gsskrb5_set_default_realm(realm); if (ret) { @@ -352,12 +352,12 @@ static NTSTATUS gensec_gssapi_client_start(struct gensec_security *gensec_securi gensec_gssapi_state = talloc_get_type(gensec_security->private_data, struct gensec_gssapi_state); principal = gensec_get_target_principal(gensec_security); - if (principal && lp_client_use_spnego_principal(gensec_security->settings->lp_ctx)) { + if (principal && lpcfg_client_use_spnego_principal(gensec_security->settings->lp_ctx)) { name_type = GSS_C_NULL_OID; } else { principal = talloc_asprintf(gensec_gssapi_state, "%s/%s@%s", gensec_get_target_service(gensec_security), - hostname, lp_realm(gensec_security->settings->lp_ctx)); + hostname, lpcfg_realm(gensec_security->settings->lp_ctx)); name_type = GSS_C_NT_USER_NAME; } @@ -1364,7 +1364,7 @@ static NTSTATUS gensec_gssapi_session_info(struct gensec_security *gensec_securi ret = cli_credentials_set_client_gss_creds(session_info->credentials, gensec_security->event_ctx, - gensec_security->settings->lp_ctx, + gensec_security->settings->lp_ctx, gensec_gssapi_state->delegated_cred_handle, CRED_SPECIFIED, &error_string); if (ret) { diff --git a/source4/auth/gensec/pygensec.c b/source4/auth/gensec/pygensec.c index 3ae80ddaf3..fc76fad1be 100644 --- a/source4/auth/gensec/pygensec.c +++ b/source4/auth/gensec/pygensec.c @@ -69,7 +69,7 @@ static struct gensec_settings *settings_from_object(TALLOC_CTX *mem_ctx, PyObjec } s->target_hostname = PyString_AsString(py_hostname); - s->lp_ctx = lp_from_py_object(s, py_lp_ctx); + s->lp_ctx = lpcfg_from_py_object(s, py_lp_ctx); return s; } diff --git a/source4/auth/gensec/schannel.c b/source4/auth/gensec/schannel.c index d4b29484f1..6f508b4a9d 100644 --- a/source4/auth/gensec/schannel.c +++ b/source4/auth/gensec/schannel.c @@ -126,15 +126,15 @@ static NTSTATUS schannel_update(struct gensec_security *gensec_security, TALLOC_ workstation = bind_schannel.oem_netbios_computer.a; domain = bind_schannel.oem_netbios_domain.a; - if (strcasecmp_m(domain, lp_workgroup(gensec_security->settings->lp_ctx)) != 0) { + if (strcasecmp_m(domain, lpcfg_workgroup(gensec_security->settings->lp_ctx)) != 0) { DEBUG(3, ("Request for schannel to incorrect domain: %s != our domain %s\n", - domain, lp_workgroup(gensec_security->settings->lp_ctx))); + domain, lpcfg_workgroup(gensec_security->settings->lp_ctx))); return NT_STATUS_LOGON_FAILURE; } status = schannel_get_creds_state(out_mem_ctx, - lp_private_dir(gensec_security->settings->lp_ctx), + lpcfg_private_dir(gensec_security->settings->lp_ctx), workstation, &creds); if (!NT_STATUS_IS_OK(status)) { DEBUG(3, ("Could not find session key for attempted schannel connection from %s: %s\n", diff --git a/source4/auth/gensec/spnego.c b/source4/auth/gensec/spnego.c index bbcba8dc5f..612216a0ed 100644 --- a/source4/auth/gensec/spnego.c +++ b/source4/auth/gensec/spnego.c @@ -827,7 +827,7 @@ static NTSTATUS gensec_spnego_update(struct gensec_security *gensec_security, TA if (spnego.negTokenInit.targetPrincipal) { DEBUG(5, ("Server claims it's principal name is %s\n", spnego.negTokenInit.targetPrincipal)); - if (lp_client_use_spnego_principal(gensec_security->settings->lp_ctx)) { + if (lpcfg_client_use_spnego_principal(gensec_security->settings->lp_ctx)) { gensec_set_target_principal(gensec_security, spnego.negTokenInit.targetPrincipal); } } diff --git a/source4/auth/kerberos/krb5_init_context.c b/source4/auth/kerberos/krb5_init_context.c index 3bd938f0f0..ff356aa86f 100644 --- a/source4/auth/kerberos/krb5_init_context.c +++ b/source4/auth/kerberos/krb5_init_context.c @@ -398,7 +398,7 @@ smb_krb5_init_context_basic(TALLOC_CTX *tmp_ctx, return ret; } - realm = lp_realm(lp_ctx); + realm = lpcfg_realm(lp_ctx); if (realm != NULL) { ret = krb5_set_default_realm(krb5_ctx, realm); if (ret) { @@ -480,7 +480,7 @@ krb5_error_code smb_krb5_init_context(void *parent_ctx, /* Set options in kerberos */ krb5_set_dns_canonicalize_hostname((*smb_krb5_context)->krb5_context, - lp_parm_bool(lp_ctx, NULL, "krb5", "set_dns_canonicalize", false)); + lpcfg_parm_bool(lp_ctx, NULL, "krb5", "set_dns_canonicalize", false)); return 0; } diff --git a/source4/auth/ntlm/auth.c b/source4/auth/ntlm/auth.c index a9c3262f07..17fbfca2aa 100644 --- a/source4/auth/ntlm/auth.c +++ b/source4/auth/ntlm/auth.c @@ -255,7 +255,7 @@ _PUBLIC_ struct tevent_req *auth_check_password_send(TALLOC_CTX *mem_ctx, state->method = NULL; if (!user_info->mapped_state) { - nt_status = map_user_info(req, lp_workgroup(auth_ctx->lp_ctx), + nt_status = map_user_info(req, lpcfg_workgroup(auth_ctx->lp_ctx), user_info, &user_info_tmp); if (tevent_req_nterror(req, nt_status)) { return tevent_req_post(req, ev); @@ -478,15 +478,15 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char ** static const char **auth_methods_from_lp(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { const char **auth_methods = NULL; - switch (lp_server_role(lp_ctx)) { + switch (lpcfg_server_role(lp_ctx)) { case ROLE_STANDALONE: - auth_methods = lp_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "standalone", NULL); + auth_methods = lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "standalone", NULL); break; case ROLE_DOMAIN_MEMBER: - auth_methods = lp_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "member server", NULL); + auth_methods = lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "member server", NULL); break; case ROLE_DOMAIN_CONTROLLER: - auth_methods = lp_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "domain controller", NULL); + auth_methods = lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "domain controller", NULL); break; } return auth_methods; diff --git a/source4/auth/ntlm/auth_anonymous.c b/source4/auth/ntlm/auth_anonymous.c index c889071878..d5f1df2891 100644 --- a/source4/auth/ntlm/auth_anonymous.c +++ b/source4/auth/ntlm/auth_anonymous.c @@ -54,7 +54,7 @@ static NTSTATUS anonymous_check_password(struct auth_method_context *ctx, const struct auth_usersupplied_info *user_info, struct auth_serversupplied_info **_server_info) { - return auth_anonymous_server_info(mem_ctx, lp_netbios_name(ctx->auth_ctx->lp_ctx), _server_info); + return auth_anonymous_server_info(mem_ctx, lpcfg_netbios_name(ctx->auth_ctx->lp_ctx), _server_info); } static const struct auth_operations anonymous_auth_ops = { diff --git a/source4/auth/ntlm/auth_sam.c b/source4/auth/ntlm/auth_sam.c index 6d1ed0ea10..fdcc5bd90e 100644 --- a/source4/auth/ntlm/auth_sam.c +++ b/source4/auth/ntlm/auth_sam.c @@ -99,7 +99,7 @@ static NTSTATUS authsam_password_ok(struct auth_context *auth_context, *lm_sess_key = data_blob(NULL, 0); *user_sess_key = data_blob(NULL, 0); status = hash_password_check(mem_ctx, - lp_lanman_auth(auth_context->lp_ctx), + lpcfg_lanman_auth(auth_context->lp_ctx), user_info->password.hash.lanman, user_info->password.hash.nt, user_info->mapped.account_name, @@ -109,8 +109,8 @@ static NTSTATUS authsam_password_ok(struct auth_context *auth_context, case AUTH_PASSWORD_RESPONSE: status = ntlm_password_check(mem_ctx, - lp_lanman_auth(auth_context->lp_ctx), - lp_ntlm_auth(auth_context->lp_ctx), + lpcfg_lanman_auth(auth_context->lp_ctx), + lpcfg_ntlm_auth(auth_context->lp_ctx), user_info->logon_parameters, &auth_context->challenge.data, &user_info->password.response.lanman, @@ -229,8 +229,8 @@ static NTSTATUS authsam_check_password_internals(struct auth_method_context *ctx return nt_status; } - nt_status = authsam_make_server_info(tmp_ctx, ctx->auth_ctx->sam_ctx, lp_netbios_name(ctx->auth_ctx->lp_ctx), - lp_sam_name(ctx->auth_ctx->lp_ctx), + nt_status = authsam_make_server_info(tmp_ctx, ctx->auth_ctx->sam_ctx, lpcfg_netbios_name(ctx->auth_ctx->lp_ctx), + lpcfg_sam_name(ctx->auth_ctx->lp_ctx), domain_dn, msg, user_sess_key, lm_sess_key, @@ -270,13 +270,13 @@ static NTSTATUS authsam_want_check(struct auth_method_context *ctx, return NT_STATUS_NOT_IMPLEMENTED; } - is_local_name = lp_is_myname(ctx->auth_ctx->lp_ctx, + is_local_name = lpcfg_is_myname(ctx->auth_ctx->lp_ctx, user_info->mapped.domain_name); - is_my_domain = lp_is_mydomain(ctx->auth_ctx->lp_ctx, + is_my_domain = lpcfg_is_mydomain(ctx->auth_ctx->lp_ctx, user_info->mapped.domain_name); /* check whether or not we service this domain/workgroup name */ - switch (lp_server_role(ctx->auth_ctx->lp_ctx)) { + switch (lpcfg_server_role(ctx->auth_ctx->lp_ctx)) { case ROLE_STANDALONE: return NT_STATUS_OK; @@ -297,7 +297,7 @@ static NTSTATUS authsam_want_check(struct auth_method_context *ctx, return NT_STATUS_OK; } - DEBUG(6,("authsam_check_password: lp_server_role() has an undefined value\n")); + DEBUG(6,("authsam_check_password: lpcfg_server_role() has an undefined value\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -366,8 +366,8 @@ NTSTATUS authsam_get_server_info_principal(TALLOC_CTX *mem_ctx, } nt_status = authsam_make_server_info(tmp_ctx, auth_context->sam_ctx, - lp_netbios_name(auth_context->lp_ctx), - lp_workgroup(auth_context->lp_ctx), + lpcfg_netbios_name(auth_context->lp_ctx), + lpcfg_workgroup(auth_context->lp_ctx), domain_dn, msg, user_sess_key, lm_sess_key, diff --git a/source4/auth/ntlm/auth_server.c b/source4/auth/ntlm/auth_server.c index 6bb07987b5..898e2cce67 100644 --- a/source4/auth/ntlm/auth_server.c +++ b/source4/auth/ntlm/auth_server.c @@ -49,13 +49,13 @@ static NTSTATUS server_get_challenge(struct auth_method_context *ctx, TALLOC_CTX /* Make a connection to the target server, found by 'password server' in smb.conf */ - lp_smbcli_options(ctx->auth_ctx->lp_ctx, &smb_options); + lpcfg_smbcli_options(ctx->auth_ctx->lp_ctx, &smb_options); /* Make a negprot, WITHOUT SPNEGO, so we get a challenge nice an easy */ io.in.options.use_spnego = false; /* Hope we don't get * (the default), as this won't work... */ - host_list = lp_passwordserver(ctx->auth_ctx->lp_ctx); + host_list = lpcfg_passwordserver(ctx->auth_ctx->lp_ctx); if (!host_list) { return NT_STATUS_INTERNAL_ERROR; } @@ -63,16 +63,16 @@ static NTSTATUS server_get_challenge(struct auth_method_context *ctx, TALLOC_CTX if (strequal(io.in.dest_host, "*")) { return NT_STATUS_INTERNAL_ERROR; } - io.in.dest_ports = lp_smb_ports(ctx->auth_ctx->lp_ctx); - io.in.socket_options = lp_socket_options(ctx->auth_ctx->lp_ctx); - io.in.gensec_settings = lp_gensec_settings(mem_ctx, ctx->auth_ctx->lp_ctx); + io.in.dest_ports = lpcfg_smb_ports(ctx->auth_ctx->lp_ctx); + io.in.socket_options = lpcfg_socket_options(ctx->auth_ctx->lp_ctx); + io.in.gensec_settings = lpcfg_gensec_settings(mem_ctx, ctx->auth_ctx->lp_ctx); io.in.called_name = strupper_talloc(mem_ctx, io.in.dest_host); /* We don't want to get as far as the session setup */ io.in.credentials = cli_credentials_init_anon(mem_ctx); cli_credentials_set_workstation(io.in.credentials, - lp_netbios_name(ctx->auth_ctx->lp_ctx), + lpcfg_netbios_name(ctx->auth_ctx->lp_ctx), CRED_SPECIFIED); io.in.service = NULL; @@ -81,9 +81,9 @@ static NTSTATUS server_get_challenge(struct auth_method_context *ctx, TALLOC_CTX io.in.options = smb_options; - lp_smbcli_session_options(ctx->auth_ctx->lp_ctx, &io.in.session_options); + lpcfg_smbcli_session_options(ctx->auth_ctx->lp_ctx, &io.in.session_options); - status = smb_composite_connect(&io, mem_ctx, lp_resolve_context(ctx->auth_ctx->lp_ctx), + status = smb_composite_connect(&io, mem_ctx, lpcfg_resolve_context(ctx->auth_ctx->lp_ctx), ctx->auth_ctx->event_ctx); NT_STATUS_NOT_OK_RETURN(status); @@ -147,7 +147,7 @@ static NTSTATUS server_check_password(struct auth_method_context *ctx, session_setup.in.credentials = creds; session_setup.in.workgroup = ""; /* Only used with SPNEGO, which we are not doing */ - session_setup.in.gensec_settings = lp_gensec_settings(session, ctx->auth_ctx->lp_ctx); + session_setup.in.gensec_settings = lpcfg_gensec_settings(session, ctx->auth_ctx->lp_ctx); /* Check password with remove server - this should be async some day */ nt_status = smb_composite_sesssetup(session, &session_setup); diff --git a/source4/auth/ntlm/auth_unix.c b/source4/auth/ntlm/auth_unix.c index aa68bb161e..1c026f6990 100644 --- a/source4/auth/ntlm/auth_unix.c +++ b/source4/auth/ntlm/auth_unix.c @@ -430,7 +430,7 @@ static NTSTATUS smb_pam_setcred(pam_handle_t *pamh, const char * user) return pam_to_nt_status(pam_error); } -static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp_ctx, +static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp_ctx, const struct auth_usersupplied_info *user_info, struct passwd **pws) { struct smb_pam_user_info *info; @@ -465,7 +465,7 @@ static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp return nt_status; } - nt_status = smb_pam_auth(pamh, lp_null_passwords(lp_ctx), user_info->mapped.account_name); + nt_status = smb_pam_auth(pamh, lpcfg_null_passwords(lp_ctx), user_info->mapped.account_name); if (!NT_STATUS_IS_OK(nt_status)) { smb_pam_end(pamh); return nt_status; @@ -605,7 +605,7 @@ static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp char *crypted; struct passwd *pws; NTSTATUS nt_status; - int level = lp_passwordlevel(lp_ctx); + int level = lpcfg_passwordlevel(lp_ctx); *ret_passwd = NULL; @@ -708,7 +708,7 @@ static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp #endif if (crypted[0] == '\0') { - if (!lp_null_passwords(lp_ctx)) { + if (!lpcfg_null_passwords(lp_ctx)) { DEBUG(2, ("Disallowing %s with null password\n", username)); return NT_STATUS_LOGON_FAILURE; } @@ -814,7 +814,7 @@ static NTSTATUS authunix_check_password(struct auth_method_context *ctx, return nt_status; } - nt_status = authunix_make_server_info(mem_ctx, lp_netbios_name(ctx->auth_ctx->lp_ctx), + nt_status = authunix_make_server_info(mem_ctx, lpcfg_netbios_name(ctx->auth_ctx->lp_ctx), user_info, pwd, server_info); if (!NT_STATUS_IS_OK(nt_status)) { talloc_free(check_ctx); diff --git a/source4/auth/ntlm/auth_util.c b/source4/auth/ntlm/auth_util.c index 92df0bfe80..7da68a248b 100644 --- a/source4/auth/ntlm/auth_util.c +++ b/source4/auth/ntlm/auth_util.c @@ -140,8 +140,8 @@ NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth_context *auth_contex } chall_blob = data_blob_talloc(mem_ctx, chal, 8); - if (lp_client_ntlmv2_auth(auth_context->lp_ctx)) { - DATA_BLOB names_blob = NTLMv2_generate_names_blob(mem_ctx, lp_netbios_name(auth_context->lp_ctx), lp_workgroup(auth_context->lp_ctx)); + if (lpcfg_client_ntlmv2_auth(auth_context->lp_ctx)) { + DATA_BLOB names_blob = NTLMv2_generate_names_blob(mem_ctx, lpcfg_netbios_name(auth_context->lp_ctx), lpcfg_workgroup(auth_context->lp_ctx)); DATA_BLOB lmv2_response, ntlmv2_response, lmv2_session_key, ntlmv2_session_key; if (!SMBNTLMv2encrypt_hash(user_info_temp, @@ -165,7 +165,7 @@ NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth_context *auth_contex SMBOWFencrypt(user_info_in->password.hash.nt->hash, chal, blob.data); user_info_temp->password.response.nt = blob; - if (lp_client_lanman_auth(auth_context->lp_ctx) && user_info_in->password.hash.lanman) { + if (lpcfg_client_lanman_auth(auth_context->lp_ctx) && user_info_in->password.hash.lanman) { DATA_BLOB lm_blob = data_blob_talloc(mem_ctx, NULL, 24); SMBOWFencrypt(user_info_in->password.hash.lanman->hash, chal, blob.data); user_info_temp->password.response.lanman = lm_blob; diff --git a/source4/auth/ntlmssp/ntlmssp_client.c b/source4/auth/ntlmssp/ntlmssp_client.c index 005b42f4e8..1bbd4cc568 100644 --- a/source4/auth/ntlmssp/ntlmssp_client.c +++ b/source4/auth/ntlmssp/ntlmssp_client.c @@ -206,7 +206,7 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security, if (ntlmssp_state->use_nt_response) { flags |= CLI_CRED_NTLM_AUTH; } - if (lp_client_lanman_auth(gensec_security->settings->lp_ctx)) { + if (lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx)) { flags |= CLI_CRED_LANMAN_AUTH; } @@ -231,7 +231,7 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security, } if ((ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_LM_KEY) - && lp_client_lanman_auth(gensec_security->settings->lp_ctx) && lm_session_key.length == 16) { + && lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx) && lm_session_key.length == 16) { DATA_BLOB new_session_key = data_blob_talloc(mem_ctx, NULL, 16); if (lm_response.length == 24) { SMBsesskeygen_lm_sess_key(lm_session_key.data, lm_response.data, @@ -325,17 +325,17 @@ NTSTATUS gensec_ntlmssp_client_start(struct gensec_security *gensec_security) ntlmssp_state->role = NTLMSSP_CLIENT; - ntlmssp_state->domain = lp_workgroup(gensec_security->settings->lp_ctx); + ntlmssp_state->domain = lpcfg_workgroup(gensec_security->settings->lp_ctx); ntlmssp_state->unicode = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "unicode", true); ntlmssp_state->use_nt_response = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "send_nt_reponse", true); - ntlmssp_state->allow_lm_key = (lp_client_lanman_auth(gensec_security->settings->lp_ctx) + ntlmssp_state->allow_lm_key = (lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx) && (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "allow_lm_key", false) || gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "lm_key", false))); - ntlmssp_state->use_ntlmv2 = lp_client_ntlmv2_auth(gensec_security->settings->lp_ctx); + ntlmssp_state->use_ntlmv2 = lpcfg_client_ntlmv2_auth(gensec_security->settings->lp_ctx); ntlmssp_state->expected_state = NTLMSSP_INITIAL; diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c index 5562180f3a..a6ade2532b 100644 --- a/source4/auth/ntlmssp/ntlmssp_server.c +++ b/source4/auth/ntlmssp/ntlmssp_server.c @@ -724,7 +724,7 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security) ntlmssp_state->expected_state = NTLMSSP_NEGOTIATE; - ntlmssp_state->allow_lm_key = (lp_lanman_auth(gensec_security->settings->lp_ctx) + ntlmssp_state->allow_lm_key = (lpcfg_lanman_auth(gensec_security->settings->lp_ctx) && gensec_setting_bool(gensec_security->settings, "ntlmssp_server", "allow_lm_key", false)); ntlmssp_state->neg_flags = @@ -766,22 +766,22 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security) ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge; ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge; ntlmssp_state->check_password = auth_ntlmssp_check_password; - if (lp_server_role(gensec_security->settings->lp_ctx) == ROLE_STANDALONE) { + if (lpcfg_server_role(gensec_security->settings->lp_ctx) == ROLE_STANDALONE) { ntlmssp_state->server.is_standalone = true; } else { ntlmssp_state->server.is_standalone = false; } - ntlmssp_state->server.netbios_name = lp_netbios_name(gensec_security->settings->lp_ctx); + ntlmssp_state->server.netbios_name = lpcfg_netbios_name(gensec_security->settings->lp_ctx); - ntlmssp_state->server.netbios_domain = lp_workgroup(gensec_security->settings->lp_ctx); + ntlmssp_state->server.netbios_domain = lpcfg_workgroup(gensec_security->settings->lp_ctx); { char dnsdomname[MAXHOSTNAMELEN], dnsname[MAXHOSTNAMELEN]; /* Find out the DNS domain name */ dnsdomname[0] = '\0'; - safe_strcpy(dnsdomname, lp_dnsdomain(gensec_security->settings->lp_ctx), sizeof(dnsdomname) - 1); + safe_strcpy(dnsdomname, lpcfg_dnsdomain(gensec_security->settings->lp_ctx), sizeof(dnsdomname) - 1); /* Find out the DNS host name */ safe_strcpy(dnsname, ntlmssp_state->server.netbios_name, sizeof(dnsname) - 1); diff --git a/source4/auth/pyauth.c b/source4/auth/pyauth.c index 2563b85570..ee4d511fba 100644 --- a/source4/auth/pyauth.c +++ b/source4/auth/pyauth.c @@ -46,7 +46,7 @@ static PyObject *py_system_session(PyObject *module, PyObject *args) if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx)) return NULL; - lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: Leaks memory */ + lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: Leaks memory */ if (lp_ctx == NULL) return NULL; @@ -65,7 +65,7 @@ static PyObject *py_system_session_anon(PyObject *module, PyObject *args) if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx)) return NULL; - lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaks memory */ + lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaks memory */ if (lp_ctx == NULL) return NULL; @@ -84,7 +84,7 @@ static PyObject *py_admin_session(PyObject *module, PyObject *args) if (!PyArg_ParseTuple(args, "OO", &py_lp_ctx, &py_sid)) return NULL; - lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ + lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ if (lp_ctx == NULL) return NULL; diff --git a/source4/auth/samba_server_gensec.c b/source4/auth/samba_server_gensec.c index 31f52fc6b0..6d27a362e4 100644 --- a/source4/auth/samba_server_gensec.c +++ b/source4/auth/samba_server_gensec.c @@ -52,7 +52,7 @@ NTSTATUS samba_server_gensec_start(TALLOC_CTX *mem_ctx, nt_status = gensec_server_start(mem_ctx, event_ctx, - lp_gensec_settings(mem_ctx, lp_ctx), + lpcfg_gensec_settings(mem_ctx, lp_ctx), auth_context, &gensec_ctx); if (!NT_STATUS_IS_OK(nt_status)) { diff --git a/source4/auth/session.c b/source4/auth/session.c index e14644d6d8..024d8ec338 100644 --- a/source4/auth/session.c +++ b/source4/auth/session.c @@ -29,7 +29,7 @@ #include "auth/session_proto.h" _PUBLIC_ struct auth_session_info *anonymous_session(TALLOC_CTX *mem_ctx, - struct loadparm_context *lp_ctx) + struct loadparm_context *lp_ctx) { NTSTATUS nt_status; struct auth_session_info *session_info = NULL; diff --git a/source4/auth/system_session.c b/source4/auth/system_session.c index 31c9bd1a78..386f066de4 100644 --- a/source4/auth/system_session.c +++ b/source4/auth/system_session.c @@ -157,7 +157,7 @@ static int system_session_destructor(struct auth_session_info *info) * trusted/prvilaged account), including the local machine account as * the off-host credentials */ -_PUBLIC_ struct auth_session_info *system_session(struct loadparm_context *lp_ctx) +_PUBLIC_ struct auth_session_info *system_session(struct loadparm_context *lp_ctx) { static struct auth_session_info *static_session; NTSTATUS nt_status; @@ -188,7 +188,7 @@ static NTSTATUS _auth_system_session_info(TALLOC_CTX *parent_ctx, struct auth_session_info *session_info = NULL; TALLOC_CTX *mem_ctx = talloc_new(parent_ctx); - nt_status = auth_system_server_info(mem_ctx, lp_netbios_name(lp_ctx), + nt_status = auth_system_server_info(mem_ctx, lpcfg_netbios_name(lp_ctx), &server_info); if (!NT_STATUS_IS_OK(nt_status)) { talloc_free(mem_ctx); @@ -221,7 +221,7 @@ static NTSTATUS _auth_system_session_info(TALLOC_CTX *parent_ctx, /* Create a system session, but with anonymous credentials (so we do not need to open secrets.ldb) */ -_PUBLIC_ struct auth_session_info *system_session_anon(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) +_PUBLIC_ struct auth_session_info *system_session_anon(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { NTSTATUS nt_status; struct auth_session_info *session_info = NULL; @@ -240,7 +240,7 @@ _PUBLIC_ NTSTATUS auth_system_session_info(TALLOC_CTX *parent_ctx, { return _auth_system_session_info(parent_ctx, lp_ctx, - lp_parm_bool(lp_ctx, NULL, "system", "anonymous", false), + lpcfg_parm_bool(lp_ctx, NULL, "system", "anonymous", false), _session_info); } @@ -458,8 +458,8 @@ static NTSTATUS auth_domain_admin_session_info(TALLOC_CTX *parent_ctx, struct auth_session_info *session_info = NULL; TALLOC_CTX *mem_ctx = talloc_new(parent_ctx); - nt_status = auth_domain_admin_server_info(mem_ctx, lp_netbios_name(lp_ctx), - lp_workgroup(lp_ctx), domain_sid, + nt_status = auth_domain_admin_server_info(mem_ctx, lpcfg_netbios_name(lp_ctx), + lpcfg_workgroup(lp_ctx), domain_sid, &server_info); if (!NT_STATUS_IS_OK(nt_status)) { talloc_free(mem_ctx); @@ -519,7 +519,7 @@ _PUBLIC_ NTSTATUS auth_anonymous_session_info(TALLOC_CTX *parent_ctx, TALLOC_CTX *mem_ctx = talloc_new(parent_ctx); nt_status = auth_anonymous_server_info(mem_ctx, - lp_netbios_name(lp_ctx), + lpcfg_netbios_name(lp_ctx), &server_info); if (!NT_STATUS_IS_OK(nt_status)) { talloc_free(mem_ctx); diff --git a/source4/cldap_server/cldap_server.c b/source4/cldap_server/cldap_server.c index 09c9889859..286af058db 100644 --- a/source4/cldap_server/cldap_server.c +++ b/source4/cldap_server/cldap_server.c @@ -111,12 +111,12 @@ static NTSTATUS cldapd_add_socket(struct cldapd_server *cldapd, struct loadparm_ ret = tsocket_address_inet_from_strings(cldapd, "ip", address, - lp_cldap_port(lp_ctx), + lpcfg_cldap_port(lp_ctx), &socket_address); if (ret != 0) { status = map_nt_error_from_unix(errno); DEBUG(0,("invalid address %s:%d - %s:%s\n", - address, lp_cldap_port(lp_ctx), + address, lpcfg_cldap_port(lp_ctx), gai_strerror(ret), nt_errstr(status))); return status; } @@ -155,7 +155,7 @@ static NTSTATUS cldapd_startup_interfaces(struct cldapd_server *cldapd, struct l /* if we are allowing incoming packets from any address, then we need to bind to the wildcard address */ - if (!lp_bind_interfaces_only(lp_ctx)) { + if (!lpcfg_bind_interfaces_only(lp_ctx)) { status = cldapd_add_socket(cldapd, lp_ctx, "0.0.0.0"); NT_STATUS_NOT_OK_RETURN(status); } @@ -182,14 +182,14 @@ static void cldapd_task_init(struct task_server *task) NTSTATUS status; struct interface *ifaces; - load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces); + load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces); if (iface_count(ifaces) == 0) { task_server_terminate(task, "cldapd: no network interfaces configured", false); return; } - switch (lp_server_role(task->lp_ctx)) { + switch (lpcfg_server_role(task->lp_ctx)) { case ROLE_STANDALONE: task_server_terminate(task, "cldap_server: no CLDAP server required in standalone configuration", false); diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c index 7667d9bf3e..aa5533dc98 100644 --- a/source4/cldap_server/netlogon.c +++ b/source4/cldap_server/netlogon.c @@ -58,7 +58,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, const char *none_attrs[] = {NULL}; struct ldb_result *dom_res = NULL, *user_res = NULL; int ret; - const char **services = lp_server_services(lp_ctx); + const char **services = lpcfg_server_services(lp_ctx); uint32_t server_type; const char *pdc_name; struct GUID domain_uuid; @@ -81,10 +81,10 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, } /* Lookup using long or short domainname */ - if (domain && (strcasecmp_m(domain, lp_dnsdomain(lp_ctx)) == 0)) { + if (domain && (strcasecmp_m(domain, lpcfg_dnsdomain(lp_ctx)) == 0)) { domain_dn = ldb_get_default_basedn(sam_ctx); } - if (netbios_domain && (strcasecmp_m(netbios_domain, lp_sam_name(lp_ctx)) == 0)) { + if (netbios_domain && (strcasecmp_m(netbios_domain, lpcfg_sam_name(lp_ctx)) == 0)) { domain_dn = ldb_get_default_basedn(sam_ctx); } if (domain_dn) { @@ -180,7 +180,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, "objectClass=domain"); if (ret != LDB_SUCCESS) { DEBUG(2,("Error finding domain '%s'/'%s' in sam: %s\n", - lp_dnsdomain(lp_ctx), + lpcfg_dnsdomain(lp_ctx), ldb_dn_get_linearized(domain_dn), ldb_errstring(sam_ctx))); return NT_STATUS_NO_SUCH_DOMAIN; @@ -269,24 +269,24 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, #endif pdc_name = talloc_asprintf(mem_ctx, "\\\\%s", - lp_netbios_name(lp_ctx)); + lpcfg_netbios_name(lp_ctx)); NT_STATUS_HAVE_NO_MEMORY(pdc_name); domain_uuid = samdb_result_guid(dom_res->msgs[0], "objectGUID"); - dns_domain = lp_dnsdomain(lp_ctx); + dns_domain = lpcfg_dnsdomain(lp_ctx); forest_domain = samdb_forest_name(sam_ctx, mem_ctx); NT_STATUS_HAVE_NO_MEMORY(forest_domain); pdc_dns_name = talloc_asprintf(mem_ctx, "%s.%s", strlower_talloc(mem_ctx, - lp_netbios_name(lp_ctx)), + lpcfg_netbios_name(lp_ctx)), dns_domain); NT_STATUS_HAVE_NO_MEMORY(pdc_dns_name); - flatname = lp_workgroup(lp_ctx); + flatname = lpcfg_workgroup(lp_ctx); server_site = samdb_server_site_name(sam_ctx, mem_ctx); NT_STATUS_HAVE_NO_MEMORY(server_site); client_site = samdb_client_site_name(sam_ctx, mem_ctx, src_address, NULL); NT_STATUS_HAVE_NO_MEMORY(client_site); - load_interfaces(mem_ctx, lp_interfaces(lp_ctx), &ifaces); + load_interfaces(mem_ctx, lpcfg_interfaces(lp_ctx), &ifaces); /* * TODO: the caller should pass the address which the client * used to trigger this call, as the client is able to reach @@ -450,7 +450,7 @@ void cldapd_netlogon_request(struct cldap_socket *cldap, } if ((domain == NULL) && (domain_guid == NULL) && (domain_sid == NULL)) { - domain = lp_dnsdomain(cldapd->task->lp_ctx); + domain = lpcfg_dnsdomain(cldapd->task->lp_ctx); } if (version == -1) { diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c index b804a15d1c..1cd0b64ca6 100644 --- a/source4/client/cifsdd.c +++ b/source4/client/cifsdd.c @@ -425,8 +425,8 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx obs = check_arg_numeric("obs"); count = check_arg_numeric("count"); - lp_smbcli_options(lp_ctx, &options); - lp_smbcli_session_options(lp_ctx, &session_options); + lpcfg_smbcli_options(lp_ctx, &options); + lpcfg_smbcli_session_options(lp_ctx, &session_options); /* Allocate IO buffer. We need more than the max IO size because we * could accumulate a remainder if ibs and obs don't match. @@ -444,19 +444,19 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n", (unsigned long long)iomax, options.max_xmit)); - if (!(ifile = open_file(lp_resolve_context(lp_ctx), ev, "if", - lp_smb_ports(lp_ctx), &options, - lp_socket_options(lp_ctx), + if (!(ifile = open_file(lpcfg_resolve_context(lp_ctx), ev, "if", + lpcfg_smb_ports(lp_ctx), &options, + lpcfg_socket_options(lp_ctx), &session_options, - lp_gensec_settings(lp_ctx, lp_ctx)))) { + lpcfg_gensec_settings(lp_ctx, lp_ctx)))) { return(FILESYS_EXIT_CODE); } - if (!(ofile = open_file(lp_resolve_context(lp_ctx), ev, "of", - lp_smb_ports(lp_ctx), &options, - lp_socket_options(lp_ctx), + if (!(ofile = open_file(lpcfg_resolve_context(lp_ctx), ev, "of", + lpcfg_smb_ports(lp_ctx), &options, + lpcfg_socket_options(lp_ctx), &session_options, - lp_gensec_settings(lp_ctx, lp_ctx)))) { + lpcfg_gensec_settings(lp_ctx, lp_ctx)))) { return(FILESYS_EXIT_CODE); } diff --git a/source4/client/client.c b/source4/client/client.c index ee499d24bb..910a66657e 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -3261,8 +3261,8 @@ static int do_message_op(const char *netbios_name, const char *desthost, poptFreeContext(pc); - lp_smbcli_options(cmdline_lp_ctx, &smb_options); - lp_smbcli_session_options(cmdline_lp_ctx, &smb_session_options); + lpcfg_smbcli_options(cmdline_lp_ctx, &smb_options); + lpcfg_smbcli_session_options(cmdline_lp_ctx, &smb_session_options); ev_ctx = s4_event_context_init(talloc_autofree_context()); @@ -3276,25 +3276,25 @@ static int do_message_op(const char *netbios_name, const char *desthost, if (query_host) { rc = do_host_query(cmdline_lp_ctx, ev_ctx, query_host, - lp_workgroup(cmdline_lp_ctx)); + lpcfg_workgroup(cmdline_lp_ctx)); return rc; } if (message) { - rc = do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, - lp_smb_ports(cmdline_lp_ctx), dest_ip, + rc = do_message_op(lpcfg_netbios_name(cmdline_lp_ctx), desthost, + lpcfg_smb_ports(cmdline_lp_ctx), dest_ip, name_type, ev_ctx, - lp_resolve_context(cmdline_lp_ctx), + lpcfg_resolve_context(cmdline_lp_ctx), &smb_options, - lp_socket_options(cmdline_lp_ctx)); + lpcfg_socket_options(cmdline_lp_ctx)); return rc; } - if (!do_connect(ctx, ev_ctx, lp_resolve_context(cmdline_lp_ctx), - desthost, lp_smb_ports(cmdline_lp_ctx), service, - lp_socket_options(cmdline_lp_ctx), + if (!do_connect(ctx, ev_ctx, lpcfg_resolve_context(cmdline_lp_ctx), + desthost, lpcfg_smb_ports(cmdline_lp_ctx), service, + lpcfg_socket_options(cmdline_lp_ctx), cmdline_credentials, &smb_options, &smb_session_options, - lp_gensec_settings(ctx, cmdline_lp_ctx))) + lpcfg_gensec_settings(ctx, cmdline_lp_ctx))) return 1; if (base_directory) { diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 4866a9a8d9..b8d72781f6 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -595,7 +595,7 @@ unsigned int samdb_result_hashes(TALLOC_CTX *mem_ctx, const struct ldb_message * return count; } -NTSTATUS samdb_result_passwords(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, struct ldb_message *msg, +NTSTATUS samdb_result_passwords(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, struct ldb_message *msg, struct samr_Password **lm_pwd, struct samr_Password **nt_pwd) { struct samr_Password *lmPwdHash, *ntPwdHash; @@ -614,7 +614,7 @@ NTSTATUS samdb_result_passwords(TALLOC_CTX *mem_ctx, struct loadparm_context *lp /* Ensure that if we have turned off LM * authentication, that we never use the LM hash, even * if we store it */ - if (lp_lanman_auth(lp_ctx)) { + if (lpcfg_lanman_auth(lp_ctx)) { unsigned int num_lm; num_lm = samdb_result_hashes(mem_ctx, msg, "dBCSPwd", &lmPwdHash); if (num_lm == 0) { diff --git a/source4/dsdb/dns/dns_update.c b/source4/dsdb/dns/dns_update.c index 7242acfa41..e9f93038b6 100644 --- a/source4/dsdb/dns/dns_update.c +++ b/source4/dsdb/dns/dns_update.c @@ -101,9 +101,9 @@ static void dnsupdate_rebuild(struct dnsupdate_service *service) int fd; unsigned int i; const char *attrs[] = { "sAMAccountName", NULL }; - const char *realm = lp_realm(service->task->lp_ctx); + const char *realm = lpcfg_realm(service->task->lp_ctx); TALLOC_CTX *tmp_ctx = talloc_new(service); - const char * const *rndc_command = lp_rndc_command(service->task->lp_ctx); + const char * const *rndc_command = lpcfg_rndc_command(service->task->lp_ctx); /* abort any pending script run */ TALLOC_FREE(service->confupdate.subreq); @@ -117,12 +117,12 @@ static void dnsupdate_rebuild(struct dnsupdate_service *service) return; } - path = lp_parm_string(service->task->lp_ctx, NULL, "dnsupdate", "path"); + path = lpcfg_parm_string(service->task->lp_ctx, NULL, "dnsupdate", "path"); if (path == NULL) { path = private_path(tmp_ctx, service->task->lp_ctx, "named.conf.update"); } - path_static = lp_parm_string(service->task->lp_ctx, NULL, "dnsupdate", "extra_static_grant_rules"); + path_static = lpcfg_parm_string(service->task->lp_ctx, NULL, "dnsupdate", "extra_static_grant_rules"); if (path_static == NULL) { path_static = private_path(tmp_ctx, service->task->lp_ctx, "named.conf.update.static"); } @@ -286,8 +286,8 @@ static void dnsupdate_spnupdate_done(struct tevent_req *subreq) */ static void dnsupdate_check_names(struct dnsupdate_service *service) { - const char * const *dns_update_command = lp_dns_update_command(service->task->lp_ctx); - const char * const *spn_update_command = lp_spn_update_command(service->task->lp_ctx); + const char * const *dns_update_command = lpcfg_dns_update_command(service->task->lp_ctx); + const char * const *spn_update_command = lpcfg_spn_update_command(service->task->lp_ctx); /* kill any existing child */ TALLOC_FREE(service->nameupdate.subreq); @@ -355,7 +355,7 @@ static void dnsupdate_task_init(struct task_server *task) NTSTATUS status; struct dnsupdate_service *service; - if (lp_server_role(task->lp_ctx) != ROLE_DOMAIN_CONTROLLER) { + if (lpcfg_server_role(task->lp_ctx) != ROLE_DOMAIN_CONTROLLER) { /* not useful for non-DC */ return; } @@ -386,10 +386,10 @@ static void dnsupdate_task_init(struct task_server *task) return; } - service->confupdate.interval = lp_parm_int(task->lp_ctx, NULL, + service->confupdate.interval = lpcfg_parm_int(task->lp_ctx, NULL, "dnsupdate", "config interval", 60); /* in seconds */ - service->nameupdate.interval = lp_parm_int(task->lp_ctx, NULL, + service->nameupdate.interval = lpcfg_parm_int(task->lp_ctx, NULL, "dnsupdate", "name interval", 600); /* in seconds */ dnsupdate_rebuild(service); diff --git a/source4/dsdb/kcc/kcc_deleted.c b/source4/dsdb/kcc/kcc_deleted.c index dae9a8ef1b..118952a143 100644 --- a/source4/dsdb/kcc/kcc_deleted.c +++ b/source4/dsdb/kcc/kcc_deleted.c @@ -46,7 +46,7 @@ NTSTATUS kccsrv_check_deleted(struct kccsrv_service *s, TALLOC_CTX *mem_ctx) uint32_t tombstoneLifetime; time_t t = time(NULL); - if (t - s->last_deleted_check < lp_parm_int(s->task->lp_ctx, NULL, "kccsrv", + if (t - s->last_deleted_check < lpcfg_parm_int(s->task->lp_ctx, NULL, "kccsrv", "check_deleted_interval", 600)) { return NT_STATUS_OK; } diff --git a/source4/dsdb/kcc/kcc_periodic.c b/source4/dsdb/kcc/kcc_periodic.c index 9937e2e6dd..3f37208dec 100644 --- a/source4/dsdb/kcc/kcc_periodic.c +++ b/source4/dsdb/kcc/kcc_periodic.c @@ -233,7 +233,7 @@ NTSTATUS kccsrv_simple_update(struct kccsrv_service *s, TALLOC_CTX *mem_ctx) r1->other_info = talloc_zero(reps, struct repsFromTo1OtherInfo); r1->other_info->dns_name = talloc_asprintf(r1->other_info, "%s._msdcs.%s", GUID_string(mem_ctx, &ntds_guid), - lp_dnsdomain(s->task->lp_ctx)); + lpcfg_dnsdomain(s->task->lp_ctx)); r1->source_dsa_obj_guid = ntds_guid; r1->source_dsa_invocation_id = invocation_id; r1->replica_flags = diff --git a/source4/dsdb/kcc/kcc_service.c b/source4/dsdb/kcc/kcc_service.c index 989b8f8c58..4507545355 100644 --- a/source4/dsdb/kcc/kcc_service.c +++ b/source4/dsdb/kcc/kcc_service.c @@ -169,7 +169,7 @@ static void kccsrv_task_init(struct task_server *task) struct kccsrv_service *service; uint32_t periodic_startup_interval; - switch (lp_server_role(task->lp_ctx)) { + switch (lpcfg_server_role(task->lp_ctx)) { case ROLE_STANDALONE: task_server_terminate(task, "kccsrv: no KCC required in standalone configuration", false); return; @@ -217,9 +217,9 @@ static void kccsrv_task_init(struct task_server *task) return; } - periodic_startup_interval = lp_parm_int(task->lp_ctx, NULL, "kccsrv", + periodic_startup_interval = lpcfg_parm_int(task->lp_ctx, NULL, "kccsrv", "periodic_startup_interval", 15); /* in seconds */ - service->periodic.interval = lp_parm_int(task->lp_ctx, NULL, "kccsrv", + service->periodic.interval = lpcfg_parm_int(task->lp_ctx, NULL, "kccsrv", "periodic_interval", 300); /* in seconds */ status = kccsrv_periodic_schedule(service, periodic_startup_interval); diff --git a/source4/dsdb/repl/drepl_out_helpers.c b/source4/dsdb/repl/drepl_out_helpers.c index 24110529c5..8ce9d0f1a3 100644 --- a/source4/dsdb/repl/drepl_out_helpers.c +++ b/source4/dsdb/repl/drepl_out_helpers.c @@ -581,7 +581,7 @@ static void dreplsrv_update_refs_trigger(struct tevent_req *req) ntds_dns_name = talloc_asprintf(r, "%s._msdcs.%s", ntds_guid_str, - lp_dnsdomain(service->task->lp_ctx)); + lpcfg_dnsdomain(service->task->lp_ctx)); if (tevent_req_nomem(ntds_dns_name, req)) { return; } diff --git a/source4/dsdb/repl/drepl_ridalloc.c b/source4/dsdb/repl/drepl_ridalloc.c index eaff581083..c036228ee7 100644 --- a/source4/dsdb/repl/drepl_ridalloc.c +++ b/source4/dsdb/repl/drepl_ridalloc.c @@ -79,7 +79,7 @@ static WERROR drepl_create_rid_manager_source_dsa(struct dreplsrv_service *servi sdsa->repsFrom1->other_info->dns_name = talloc_asprintf(sdsa->repsFrom1->other_info, "%s._msdcs.%s", GUID_string(sdsa->repsFrom1->other_info, &sdsa->repsFrom1->source_dsa_obj_guid), - lp_dnsdomain(service->task->lp_ctx)); + lpcfg_dnsdomain(service->task->lp_ctx)); if (!sdsa->repsFrom1->other_info->dns_name) { talloc_free(sdsa); return WERR_NOMEM; diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c index e48ae3e563..652c16fda4 100644 --- a/source4/dsdb/repl/drepl_service.c +++ b/source4/dsdb/repl/drepl_service.c @@ -138,7 +138,7 @@ static void dreplsrv_task_init(struct task_server *task) bool am_rodc; int ret; - switch (lp_server_role(task->lp_ctx)) { + switch (lpcfg_server_role(task->lp_ctx)) { case ROLE_STANDALONE: task_server_terminate(task, "dreplsrv: no DSDB replication required in standalone configuration", false); @@ -187,8 +187,8 @@ static void dreplsrv_task_init(struct task_server *task) return; } - periodic_startup_interval = lp_parm_int(task->lp_ctx, NULL, "dreplsrv", "periodic_startup_interval", 15); /* in seconds */ - service->periodic.interval = lp_parm_int(task->lp_ctx, NULL, "dreplsrv", "periodic_interval", 300); /* in seconds */ + periodic_startup_interval = lpcfg_parm_int(task->lp_ctx, NULL, "dreplsrv", "periodic_startup_interval", 15); /* in seconds */ + service->periodic.interval = lpcfg_parm_int(task->lp_ctx, NULL, "dreplsrv", "periodic_interval", 300); /* in seconds */ status = dreplsrv_periodic_schedule(service, periodic_startup_interval); if (!W_ERROR_IS_OK(status)) { @@ -201,7 +201,7 @@ static void dreplsrv_task_init(struct task_server *task) /* if we are a RODC then we do not send DSReplicaSync*/ ret = samdb_rodc(service->samdb, &am_rodc); if (ret == LDB_SUCCESS && !am_rodc) { - service->notify.interval = lp_parm_int(task->lp_ctx, NULL, "dreplsrv", + service->notify.interval = lpcfg_parm_int(task->lp_ctx, NULL, "dreplsrv", "notify_interval", 5); /* in seconds */ status = dreplsrv_notify_schedule(service, service->notify.interval); if (!W_ERROR_IS_OK(status)) { diff --git a/source4/dsdb/samdb/ldb_modules/acl.c b/source4/dsdb/samdb/ldb_modules/acl.c index 6e38bc46b1..eedeb1a8b3 100644 --- a/source4/dsdb/samdb/ldb_modules/acl.c +++ b/source4/dsdb/samdb/ldb_modules/acl.c @@ -150,7 +150,7 @@ static int acl_module_init(struct ldb_module *module) } data->password_attrs = NULL; - data->acl_perform = lp_parm_bool(ldb_get_opaque(ldb, "loadparm"), + data->acl_perform = lpcfg_parm_bool(ldb_get_opaque(ldb, "loadparm"), NULL, "acl", "perform", false); ldb_module_set_private(module, data); diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c index 86f9bc43cc..e6f288d01c 100644 --- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c +++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c @@ -459,7 +459,7 @@ static int kludge_acl_init(struct ldb_module *module) } data->password_attrs = NULL; - data->acl_perform = lp_parm_bool(ldb_get_opaque(ldb, "loadparm"), + data->acl_perform = lpcfg_parm_bool(ldb_get_opaque(ldb, "loadparm"), NULL, "acl", "perform", false); ldb_module_set_private(module, data); diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index e6a315d2ef..5065bd565e 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -582,7 +582,7 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) data->partitions[i]->ctrl->dn) != 0)) { char *ref = talloc_asprintf(ac, "ldap://%s/%s%s", - lp_dnsdomain(lp_ctx), + lpcfg_dnsdomain(lp_ctx), ldb_dn_get_linearized(data->partitions[i]->ctrl->dn), req->op.search.scope == LDB_SCOPE_ONELEVEL ? "??base" : ""); diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index 99bba57d10..0f078b5c76 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -1404,7 +1404,7 @@ static int setup_password_fields(struct setup_password_fields_io *io) return ret; } - if (lp_lanman_auth(lp_ctx)) { + if (lpcfg_lanman_auth(lp_ctx)) { ret = setup_lm_fields(io); if (ret != LDB_SUCCESS) { return ret; @@ -1807,12 +1807,12 @@ static int setup_io(struct ph_context *ac, return LDB_ERR_UNWILLING_TO_PERFORM; } - if (lp_lanman_auth(lp_ctx) && (lm_hash != NULL)) { + if (lpcfg_lanman_auth(lp_ctx) && (lm_hash != NULL)) { io->n.lm_hash = talloc(io->ac, struct samr_Password); memcpy(io->n.lm_hash->hash, lm_hash->data, MIN(lm_hash->length, sizeof(io->n.lm_hash->hash))); } - if (lp_lanman_auth(lp_ctx) && (old_lm_hash != NULL)) { + if (lpcfg_lanman_auth(lp_ctx) && (old_lm_hash != NULL)) { io->og.lm_hash = talloc(io->ac, struct samr_Password); memcpy(io->og.lm_hash->hash, old_lm_hash->data, MIN(old_lm_hash->length, sizeof(io->og.lm_hash->hash))); @@ -2061,9 +2061,9 @@ static int get_domain_data_callback(struct ldb_request *req, lp_ctx = talloc_get_type(ldb_get_opaque(ldb, "loadparm"), struct loadparm_context); - ac->status->domain_data.dns_domain = lp_dnsdomain(lp_ctx); - ac->status->domain_data.realm = lp_realm(lp_ctx); - ac->status->domain_data.netbios_domain = lp_sam_name(lp_ctx); + ac->status->domain_data.dns_domain = lpcfg_dnsdomain(lp_ctx); + ac->status->domain_data.realm = lpcfg_realm(lp_ctx); + ac->status->domain_data.netbios_domain = lpcfg_sam_name(lp_ctx); ac->status->reject_reason = SAM_PWD_CHANGE_NO_ERROR; diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 2205be07c1..160f60f18c 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -2180,7 +2180,7 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req) referral = talloc_asprintf(req, "ldap://%s/%s", - lp_dnsdomain(lp_ctx), + lpcfg_dnsdomain(lp_ctx), ldb_dn_get_linearized(msg->dn)); ret = ldb_module_send_referral(req, referral); return ldb_module_done(req, NULL, NULL, ret); diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c index 2b0c4b9fa8..9cde5c89f7 100644 --- a/source4/dsdb/samdb/ldb_modules/ridalloc.c +++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c @@ -72,7 +72,7 @@ static void ridalloc_poke_rid_manager(struct ldb_module *module) (struct loadparm_context *)ldb_get_opaque(ldb, "loadparm"); TALLOC_CTX *tmp_ctx = talloc_new(module); - msg = messaging_client_init(tmp_ctx, lp_messaging_path(tmp_ctx, lp_ctx), + msg = messaging_client_init(tmp_ctx, lpcfg_messaging_path(tmp_ctx, lp_ctx), ldb_get_event_context(ldb)); if (!msg) { DEBUG(3,(__location__ ": Failed to create messaging context\n")); diff --git a/source4/dsdb/samdb/ldb_modules/samba3sid.c b/source4/dsdb/samdb/ldb_modules/samba3sid.c index 6c21382cd3..9368e0d007 100644 --- a/source4/dsdb/samdb/ldb_modules/samba3sid.c +++ b/source4/dsdb/samdb/ldb_modules/samba3sid.c @@ -56,7 +56,7 @@ static int samba3sid_next_sid(struct ldb_module *module, DSDB_FLAG_NEXT_MODULE | DSDB_SEARCH_SEARCH_ALL_PARTITIONS, "(&(objectClass=sambaDomain)(sambaDomainName=%s))", - lp_sam_name(ldb_get_opaque(ldb, "loadparm"))); + lpcfg_sam_name(ldb_get_opaque(ldb, "loadparm"))); if (ret != LDB_SUCCESS) { ldb_asprintf_errstring(ldb, __location__ diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index b9a9720018..9ae308b9bc 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -950,7 +950,7 @@ static int samldb_fill_object(struct samldb_ctx *ac, const char *type) } if ( ! ac->sid) { - sid_generator = lp_sid_generator(lp_ctx); + sid_generator = lpcfg_sid_generator(lp_ctx); if (sid_generator == SID_GENERATOR_INTERNAL) { ret = samldb_add_step(ac, samldb_allocate_sid); if (ret != LDB_SUCCESS) return ret; diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c index 67b55385cb..2b4e9a1438 100644 --- a/source4/dsdb/samdb/samdb.c +++ b/source4/dsdb/samdb/samdb.c @@ -83,7 +83,7 @@ static int samdb_credentials_destructor(struct cli_credentials *creds) that we always get the same pointer in ldb_wrap_connect() */ struct cli_credentials *samdb_credentials(struct tevent_context *event_ctx, - struct loadparm_context *lp_ctx) + struct loadparm_context *lp_ctx) { static struct cli_credentials *static_credentials; struct cli_credentials *cred; @@ -126,9 +126,9 @@ struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx, struct auth_session_info *session_info) { struct ldb_context *ldb; - ldb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, - lp_sam_url(lp_ctx), session_info, - samdb_credentials(ev_ctx, lp_ctx), + ldb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, + lpcfg_sam_url(lp_ctx), session_info, + samdb_credentials(ev_ctx, lp_ctx), 0); if (!ldb) { return NULL; diff --git a/source4/dsdb/samdb/samdb_privilege.c b/source4/dsdb/samdb/samdb_privilege.c index ad0312dd72..f05b7e2a18 100644 --- a/source4/dsdb/samdb/samdb_privilege.c +++ b/source4/dsdb/samdb/samdb_privilege.c @@ -33,7 +33,7 @@ struct ldb_context *privilege_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, "privilege.ldb", + return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, "privilege.ldb", NULL, NULL, 0); } diff --git a/source4/kdc/db-glue.c b/source4/kdc/db-glue.c index e913647511..c8bbea7531 100644 --- a/source4/kdc/db-glue.c +++ b/source4/kdc/db-glue.c @@ -517,7 +517,7 @@ static krb5_error_code samba_kdc_message2entry(krb5_context context, unsigned int i; krb5_error_code ret = 0; krb5_boolean is_computer = FALSE; - char *realm = strupper_talloc(mem_ctx, lp_realm(lp_ctx)); + char *realm = strupper_talloc(mem_ctx, lpcfg_realm(lp_ctx)); struct samba_kdc_entry *p; NTTIME acct_expiry; @@ -604,7 +604,7 @@ static krb5_error_code samba_kdc_message2entry(krb5_context context, * their probably patheticly insecure password) */ if (entry_ex->entry.flags.server - && lp_parm_bool(lp_ctx, NULL, "kdc", "require spn for service", true)) { + && lpcfg_parm_bool(lp_ctx, NULL, "kdc", "require spn for service", true)) { if (!is_computer && !ldb_msg_find_attr_as_string(msg, "servicePrincipalName", NULL)) { entry_ex->entry.flags.server = 0; } @@ -663,7 +663,7 @@ static krb5_error_code samba_kdc_message2entry(krb5_context context, && principal->name.name_string.len == 2 && (strcmp(principal->name.name_string.val[0], "kadmin") == 0) && (strcmp(principal->name.name_string.val[1], "changepw") == 0) - && lp_is_my_domain_or_realm(lp_ctx, principal->realm)) { + && lpcfg_is_my_domain_or_realm(lp_ctx, principal->realm)) { entry_ex->entry.flags.change_pw = 1; } entry_ex->entry.flags.client = 0; @@ -769,7 +769,7 @@ static krb5_error_code samba_kdc_trust_message2entry(krb5_context context, { struct loadparm_context *lp_ctx = kdc_db_ctx->lp_ctx; const char *dnsdomain; - char *realm = strupper_talloc(mem_ctx, lp_realm(lp_ctx)); + char *realm = strupper_talloc(mem_ctx, lpcfg_realm(lp_ctx)); DATA_BLOB password_utf16; struct samr_Password password_hash; const struct ldb_val *password_val; @@ -1052,8 +1052,8 @@ static krb5_error_code samba_kdc_fetch_krbtgt(krb5_context context, /* krbtgt case. Either us or a trusted realm */ - if (lp_is_my_domain_or_realm(lp_ctx, principal->realm) - && lp_is_my_domain_or_realm(lp_ctx, principal->name.name_string.val[1])) { + if (lpcfg_is_my_domain_or_realm(lp_ctx, principal->realm) + && lpcfg_is_my_domain_or_realm(lp_ctx, principal->name.name_string.val[1])) { /* us */ /* Cludge, cludge cludge. If the realm part of krbtgt/realm, * is in our db, then direct the caller at our primary @@ -1077,7 +1077,7 @@ static krb5_error_code samba_kdc_fetch_krbtgt(krb5_context context, return HDB_ERR_NOENTRY; } - realm_fixed = strupper_talloc(mem_ctx, lp_realm(lp_ctx)); + realm_fixed = strupper_talloc(mem_ctx, lpcfg_realm(lp_ctx)); if (!realm_fixed) { ret = ENOMEM; krb5_set_error_message(context, ret, "strupper_talloc: out of memory"); @@ -1112,13 +1112,13 @@ static krb5_error_code samba_kdc_fetch_krbtgt(krb5_context context, /* Either an inbound or outbound trust */ - if (strcasecmp(lp_realm(lp_ctx), principal->realm) == 0) { + if (strcasecmp(lpcfg_realm(lp_ctx), principal->realm) == 0) { /* look for inbound trust */ direction = INBOUND; realm = principal->name.name_string.val[1]; } - if (strcasecmp(lp_realm(lp_ctx), principal->name.name_string.val[1]) == 0) { + if (strcasecmp(lpcfg_realm(lp_ctx), principal->name.name_string.val[1]) == 0) { /* look for outbound trust */ direction = OUTBOUND; realm = principal->realm; diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c index e16e20b470..5adb0709cf 100644 --- a/source4/kdc/kdc.c +++ b/source4/kdc/kdc.c @@ -483,7 +483,7 @@ static NTSTATUS kdc_add_socket(struct kdc_server *kdc, model_ops, &kdc_tcp_stream_ops, "ip", address, &port, - lp_socket_options(kdc->task->lp_ctx), + lpcfg_socket_options(kdc->task->lp_ctx), kdc_socket); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("Failed to bind to %s:%u TCP - %s\n", @@ -547,8 +547,8 @@ static NTSTATUS kdc_startup_interfaces(struct kdc_server *kdc, struct loadparm_c for (i=0; ismb_krb5_context->krb5_context, &principal, - lp_realm(kdc->task->lp_ctx), - "krbtgt", lp_realm(kdc->task->lp_ctx), + lpcfg_realm(kdc->task->lp_ctx), + "krbtgt", lpcfg_realm(kdc->task->lp_ctx), NULL); if (ret != 0) { @@ -678,7 +678,7 @@ static void kdc_task_init(struct task_server *task) krb5_error_code ret; struct interface *ifaces; - switch (lp_server_role(task->lp_ctx)) { + switch (lpcfg_server_role(task->lp_ctx)) { case ROLE_STANDALONE: task_server_terminate(task, "kdc: no KDC required in standalone configuration", false); return; @@ -690,7 +690,7 @@ static void kdc_task_init(struct task_server *task) break; } - load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces); + load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces); if (iface_count(ifaces) == 0) { task_server_terminate(task, "kdc: no network interfaces configured", false); diff --git a/source4/kdc/kpasswdd.c b/source4/kdc/kpasswdd.c index fb6723c77c..9c02ac3465 100644 --- a/source4/kdc/kpasswdd.c +++ b/source4/kdc/kpasswdd.c @@ -222,7 +222,7 @@ static bool kpasswd_process_request(struct kdc_server *kdc, case KRB5_KPASSWD_VERS_CHANGEPW: { DATA_BLOB password; - if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(kdc->task->lp_ctx), + if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(kdc->task->lp_ctx), CH_UTF8, CH_UTF16, (const char *)input->data, input->length, @@ -262,7 +262,7 @@ static bool kpasswd_process_request(struct kdc_server *kdc, reply); } - if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(kdc->task->lp_ctx), + if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(kdc->task->lp_ctx), CH_UTF8, CH_UTF16, (const char *)chpw.newpasswd.data, chpw.newpasswd.length, diff --git a/source4/kdc/mit_samba.c b/source4/kdc/mit_samba.c index cb1284cfca..58ab1673ff 100644 --- a/source4/kdc/mit_samba.c +++ b/source4/kdc/mit_samba.c @@ -82,11 +82,11 @@ static int mit_samba_context_init(struct mit_samba_context **_ctx) } /* init s4 configuration */ - s4_conf_file = lp_configfile(ctx->db_ctx->lp_ctx); + s4_conf_file = lpcfg_configfile(ctx->db_ctx->lp_ctx); if (s4_conf_file) { - lp_load(ctx->db_ctx->lp_ctx, s4_conf_file); + lpcfg_load(ctx->db_ctx->lp_ctx, s4_conf_file); } else { - lp_load_default(ctx->db_ctx->lp_ctx); + lpcfg_load_default(ctx->db_ctx->lp_ctx); } ctx->session_info = system_session(ctx->db_ctx->lp_ctx); diff --git a/source4/kdc/pac-glue.c b/source4/kdc/pac-glue.c index 8c203e555d..3eeb26c98d 100644 --- a/source4/kdc/pac-glue.c +++ b/source4/kdc/pac-glue.c @@ -140,8 +140,8 @@ NTSTATUS samba_kdc_get_pac_blob(TALLOC_CTX *mem_ctx, } nt_status = authsam_make_server_info(mem_ctx, p->kdc_db_ctx->samdb, - lp_netbios_name(p->kdc_db_ctx->lp_ctx), - lp_sam_name(p->kdc_db_ctx->lp_ctx), + lpcfg_netbios_name(p->kdc_db_ctx->lp_ctx), + lpcfg_sam_name(p->kdc_db_ctx->lp_ctx), p->realm_dn, p->msg, data_blob(NULL, 0), diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c index 23210fa176..a6566df92a 100644 --- a/source4/ldap_server/ldap_backend.c +++ b/source4/ldap_server/ldap_backend.c @@ -184,9 +184,9 @@ NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn) conn->ldb = ldb_wrap_connect(conn, conn->connection->event.ctx, conn->lp_ctx, - lp_sam_url(conn->lp_ctx), + lpcfg_sam_url(conn->lp_ctx), conn->session_info, - samdb_credentials(conn->connection->event.ctx, conn->lp_ctx), + samdb_credentials(conn->connection->event.ctx, conn->lp_ctx), conn->global_catalog ? LDB_FLG_RDONLY : 0); if (conn->ldb == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; @@ -199,7 +199,7 @@ NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn) = gensec_use_kerberos_mechs(conn, backends, conn->server_credentials); unsigned int i, j = 0; for (i = 0; ops && ops[i]; i++) { - if (!lp_parm_bool(conn->lp_ctx, NULL, "gensec", ops[i]->name, ops[i]->enabled)) + if (!lpcfg_parm_bool(conn->lp_ctx, NULL, "gensec", ops[i]->name, ops[i]->enabled)) continue; if (ops[i]->sasl_name && ops[i]->server_start) { diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c index 49d3d58edf..946e1bf3b7 100644 --- a/source4/ldap_server/ldap_server.c +++ b/source4/ldap_server/ldap_server.c @@ -490,7 +490,7 @@ static const struct stream_server_ops ldap_stream_priv_ops = { add a socket address to the list of events, one event per port */ static NTSTATUS add_socket(struct tevent_context *event_context, - struct loadparm_context *lp_ctx, + struct loadparm_context *lp_ctx, const struct model_ops *model_ops, const char *address, struct ldapsrv_service *ldap_service) { @@ -501,7 +501,7 @@ static NTSTATUS add_socket(struct tevent_context *event_context, status = stream_setup_socket(event_context, lp_ctx, model_ops, &ldap_stream_nonpriv_ops, "ipv4", address, &port, - lp_socket_options(lp_ctx), + lpcfg_socket_options(lp_ctx), ldap_service); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n", @@ -512,11 +512,11 @@ static NTSTATUS add_socket(struct tevent_context *event_context, if (tls_support(ldap_service->tls_params)) { /* add ldaps server */ port = 636; - status = stream_setup_socket(event_context, lp_ctx, + status = stream_setup_socket(event_context, lp_ctx, model_ops, &ldap_stream_nonpriv_ops, "ipv4", address, &port, - lp_socket_options(lp_ctx), + lpcfg_socket_options(lp_ctx), ldap_service); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n", @@ -538,7 +538,7 @@ static NTSTATUS add_socket(struct tevent_context *event_context, model_ops, &ldap_stream_nonpriv_ops, "ipv4", address, &port, - lp_socket_options(lp_ctx), + lpcfg_socket_options(lp_ctx), ldap_service); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n", @@ -567,7 +567,7 @@ static void ldapsrv_task_init(struct task_server *task) NTSTATUS status; const struct model_ops *model_ops; - switch (lp_server_role(task->lp_ctx)) { + switch (lpcfg_server_role(task->lp_ctx)) { case ROLE_STANDALONE: task_server_terminate(task, "ldap_server: no LDAP server required in standalone configuration", false); @@ -595,12 +595,12 @@ static void ldapsrv_task_init(struct task_server *task) ldap_service->tls_params = tls_initialise(ldap_service, task->lp_ctx); if (ldap_service->tls_params == NULL) goto failed; - if (lp_interfaces(task->lp_ctx) && lp_bind_interfaces_only(task->lp_ctx)) { + if (lpcfg_interfaces(task->lp_ctx) && lpcfg_bind_interfaces_only(task->lp_ctx)) { struct interface *ifaces; int num_interfaces; int i; - load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces); + load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces); num_interfaces = iface_count(ifaces); /* We have been given an interfaces line, and been @@ -613,8 +613,8 @@ static void ldapsrv_task_init(struct task_server *task) if (!NT_STATUS_IS_OK(status)) goto failed; } } else { - status = add_socket(task->event_ctx, task->lp_ctx, model_ops, - lp_socket_address(task->lp_ctx), ldap_service); + status = add_socket(task->event_ctx, task->lp_ctx, model_ops, + lpcfg_socket_address(task->lp_ctx), ldap_service); if (!NT_STATUS_IS_OK(status)) goto failed; } @@ -626,7 +626,7 @@ static void ldapsrv_task_init(struct task_server *task) status = stream_setup_socket(task->event_ctx, task->lp_ctx, model_ops, &ldap_stream_nonpriv_ops, "unix", ldapi_path, NULL, - lp_socket_options(task->lp_ctx), + lpcfg_socket_options(task->lp_ctx), ldap_service); talloc_free(ldapi_path); if (!NT_STATUS_IS_OK(status)) { @@ -657,7 +657,7 @@ static void ldapsrv_task_init(struct task_server *task) status = stream_setup_socket(task->event_ctx, task->lp_ctx, model_ops, &ldap_stream_priv_ops, "unix", ldapi_path, NULL, - lp_socket_options(task->lp_ctx), + lpcfg_socket_options(task->lp_ctx), ldap_service); talloc_free(ldapi_path); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c index 77218290ff..7d9e65d55f 100644 --- a/source4/lib/cmdline/popt_common.c +++ b/source4/lib/cmdline/popt_common.c @@ -66,8 +66,8 @@ static void popt_samba_callback(poptContext con, const char *pname; if (reason == POPT_CALLBACK_REASON_POST) { - if (lp_configfile(cmdline_lp_ctx) == NULL) { - lp_load_default(cmdline_lp_ctx); + if (lpcfg_configfile(cmdline_lp_ctx) == NULL) { + lpcfg_load_default(cmdline_lp_ctx); } /* Hook any 'every Samba program must do this, after * the smb.conf is setup' functions here */ @@ -108,14 +108,14 @@ static void popt_samba_callback(poptContext con, break; case OPT_OPTION: - if (!lp_set_option(cmdline_lp_ctx, arg)) { + if (!lpcfg_set_option(cmdline_lp_ctx, arg)) { fprintf(stderr, "Error setting option '%s'\n", arg); exit(1); } break; case 'd': - lp_set_cmdline(cmdline_lp_ctx, "log level", arg); + lpcfg_set_cmdline(cmdline_lp_ctx, "log level", arg); break; case OPT_DEBUG_STDERR: @@ -124,14 +124,14 @@ static void popt_samba_callback(poptContext con, case 's': if (arg) { - lp_load(cmdline_lp_ctx, arg); + lpcfg_load(cmdline_lp_ctx, arg); } break; case 'l': if (arg) { char *new_logfile = talloc_asprintf(NULL, "%s/log.%s", arg, pname); - lp_set_cmdline(cmdline_lp_ctx, "log file", new_logfile); + lpcfg_set_cmdline(cmdline_lp_ctx, "log file", new_logfile); talloc_free(new_logfile); } break; @@ -152,36 +152,36 @@ static void popt_common_callback(poptContext con, switch(opt->val) { case 'O': if (arg) { - lp_set_cmdline(lp_ctx, "socket options", arg); + lpcfg_set_cmdline(lp_ctx, "socket options", arg); } break; case 'W': - lp_set_cmdline(lp_ctx, "workgroup", arg); + lpcfg_set_cmdline(lp_ctx, "workgroup", arg); break; case 'r': - lp_set_cmdline(lp_ctx, "realm", arg); + lpcfg_set_cmdline(lp_ctx, "realm", arg); break; case 'n': - lp_set_cmdline(lp_ctx, "netbios name", arg); + lpcfg_set_cmdline(lp_ctx, "netbios name", arg); break; case 'i': - lp_set_cmdline(lp_ctx, "netbios scope", arg); + lpcfg_set_cmdline(lp_ctx, "netbios scope", arg); break; case 'm': - lp_set_cmdline(lp_ctx, "client max protocol", arg); + lpcfg_set_cmdline(lp_ctx, "client max protocol", arg); break; case 'R': - lp_set_cmdline(lp_ctx, "name resolve order", arg); + lpcfg_set_cmdline(lp_ctx, "name resolve order", arg); break; case 'S': - lp_set_cmdline(lp_ctx, "client signing", arg); + lpcfg_set_cmdline(lp_ctx, "client signing", arg); break; } diff --git a/source4/lib/com/dcom/main.c b/source4/lib/com/dcom/main.c index 261dac05c6..b205cb48a8 100644 --- a/source4/lib/com/dcom/main.c +++ b/source4/lib/com/dcom/main.c @@ -171,7 +171,7 @@ static NTSTATUS dcom_connect_host(struct com_context *ctx, if (server == NULL) { return dcerpc_pipe_connect(ctx->event_ctx, p, "ncalrpc", &ndr_table_IRemoteActivation, - dcom_get_server_credentials(ctx, NULL), ctx->event_ctx, ctx->lp_ctx); + dcom_get_server_credentials(ctx, NULL), ctx->event_ctx, ctx->lp_ctx); } loc_ctx = talloc_new(ctx); @@ -182,7 +182,7 @@ static NTSTATUS dcom_connect_host(struct com_context *ctx, bd->flags |= DCERPC_DEBUG_PRINT_BOTH; status = dcerpc_pipe_connect_b(ctx->event_ctx, p, bd, &ndr_table_IRemoteActivation, - dcom_get_server_credentials(ctx, bd->host), ctx->event_ctx, ctx->lp_ctx); + dcom_get_server_credentials(ctx, bd->host), ctx->event_ctx, ctx->lp_ctx); goto end; } diff --git a/source4/lib/ldb-samba/ldb_wrap.c b/source4/lib/ldb-samba/ldb_wrap.c index 80256c9a94..365b67b6af 100644 --- a/source4/lib/ldb-samba/ldb_wrap.c +++ b/source4/lib/ldb-samba/ldb_wrap.c @@ -166,7 +166,7 @@ static int ldb_wrap_destructor(struct ldb_wrap *w) ldb_set_modules_dir(ldb, talloc_asprintf(ldb, "%s/ldb", - lp_modulesdir(lp_ctx))); + lpcfg_modulesdir(lp_ctx))); if (session_info) { if (ldb_set_opaque(ldb, "sessionInfo", session_info)) { @@ -197,7 +197,7 @@ static int ldb_wrap_destructor(struct ldb_wrap *w) return NULL; } - if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) { + if (lp_ctx != NULL && strcmp(lpcfg_sam_url(lp_ctx), url) == 0) { dsdb_set_global_schema(ldb); } @@ -212,7 +212,7 @@ static int ldb_wrap_destructor(struct ldb_wrap *w) } /* allow admins to force non-sync ldb for all databases */ - if (lp_parm_bool(lp_ctx, NULL, "ldb", "nosync", false)) { + if (lpcfg_parm_bool(lp_ctx, NULL, "ldb", "nosync", false)) { flags |= LDB_FLG_NOSYNC; } @@ -253,7 +253,7 @@ static int ldb_wrap_destructor(struct ldb_wrap *w) DLIST_ADD(ldb_wrap_list, w); /* make the resulting schema global */ - if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) { + if (lp_ctx != NULL && strcmp(lpcfg_sam_url(lp_ctx), url) == 0) { struct dsdb_schema *schema = dsdb_get_schema(ldb, NULL); if (schema) { dsdb_make_schema_global(ldb, schema); diff --git a/source4/lib/ldb-samba/pyldb.c b/source4/lib/ldb-samba/pyldb.c index 2b7b23739e..e8cdb90b9f 100644 --- a/source4/lib/ldb-samba/pyldb.c +++ b/source4/lib/ldb-samba/pyldb.c @@ -56,7 +56,7 @@ static PyObject *py_ldb_set_loadparm(PyObject *self, PyObject *args) ldb = PyLdb_AsLdbContext(self); - lp_ctx = lp_from_py_object(ldb, py_lp_ctx); + lp_ctx = lpcfg_from_py_object(ldb, py_lp_ctx); if (lp_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "Expected loadparm object"); return NULL; diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c index ddcf945400..131f6c5f74 100644 --- a/source4/lib/messaging/pymessaging.c +++ b/source4/lib/messaging/pymessaging.c @@ -84,7 +84,7 @@ PyObject *py_messaging_connect(PyTypeObject *self, PyObject *args, PyObject *kwa ev = s4_event_context_init(ret->mem_ctx); if (messaging_path == NULL) { - messaging_path = lp_messaging_path(ret->mem_ctx, + messaging_path = lpcfg_messaging_path(ret->mem_ctx, py_default_loadparm_context(ret->mem_ctx)); } else { messaging_path = talloc_strdup(ret->mem_ctx, messaging_path); @@ -338,7 +338,7 @@ PyObject *py_irpc_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs) ev = s4_event_context_init(ret->mem_ctx); if (messaging_path == NULL) { - messaging_path = lp_messaging_path(ret->mem_ctx, + messaging_path = lpcfg_messaging_path(ret->mem_ctx, py_default_loadparm_context(ret->mem_ctx)); } else { messaging_path = talloc_strdup(ret->mem_ctx, messaging_path); diff --git a/source4/lib/messaging/tests/irpc.c b/source4/lib/messaging/tests/irpc.c index 87a3c7a124..44a116af1f 100644 --- a/source4/lib/messaging/tests/irpc.c +++ b/source4/lib/messaging/tests/irpc.c @@ -215,19 +215,19 @@ static bool irpc_setup(struct torture_context *tctx, void **_data) *_data = data = talloc(tctx, struct irpc_test_data); - lp_set_cmdline(tctx->lp_ctx, "pid directory", "piddir.tmp"); + lpcfg_set_cmdline(tctx->lp_ctx, "pid directory", "piddir.tmp"); data->ev = tctx->ev; torture_assert(tctx, data->msg_ctx1 = messaging_init(tctx, - lp_messaging_path(tctx, tctx->lp_ctx), + lpcfg_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, MSG_ID1), data->ev), "Failed to init first messaging context"); torture_assert(tctx, data->msg_ctx2 = messaging_init(tctx, - lp_messaging_path(tctx, tctx->lp_ctx), + lpcfg_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, MSG_ID2), data->ev), "Failed to init second messaging context"); diff --git a/source4/lib/messaging/tests/messaging.c b/source4/lib/messaging/tests/messaging.c index 96cb180ff7..bf6f13bc67 100644 --- a/source4/lib/messaging/tests/messaging.c +++ b/source4/lib/messaging/tests/messaging.c @@ -67,12 +67,12 @@ static bool test_ping_speed(struct torture_context *tctx) int timelimit = torture_setting_int(tctx, "timelimit", 10); uint32_t msg_ping, msg_exit; - lp_set_cmdline(tctx->lp_ctx, "pid directory", "piddir.tmp"); + lpcfg_set_cmdline(tctx->lp_ctx, "pid directory", "piddir.tmp"); ev = tctx->ev; msg_server_ctx = messaging_init(tctx, - lp_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1), + lpcfg_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1), ev); torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context"); @@ -81,7 +81,7 @@ static bool test_ping_speed(struct torture_context *tctx) messaging_register_tmp(msg_server_ctx, tctx, exit_message, &msg_exit); msg_client_ctx = messaging_init(tctx, - lp_messaging_path(tctx, tctx->lp_ctx), + lpcfg_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, 2), ev); diff --git a/source4/lib/policy/gp_filesys.c b/source4/lib/policy/gp_filesys.c index b932ee5bff..bdc2337b48 100644 --- a/source4/lib/policy/gp_filesys.c +++ b/source4/lib/policy/gp_filesys.c @@ -161,23 +161,23 @@ static NTSTATUS gp_cli_connect(struct gp_context *gp_ctx) gp_ctx->cli = smbcli_state_init(gp_ctx); - lp_smbcli_options(gp_ctx->lp_ctx, &options); - lp_smbcli_session_options(gp_ctx->lp_ctx, &session_options); + lpcfg_smbcli_options(gp_ctx->lp_ctx, &options); + lpcfg_smbcli_session_options(gp_ctx->lp_ctx, &session_options); return smbcli_full_connection(gp_ctx, &gp_ctx->cli, gp_ctx->active_dc.name, - lp_smb_ports(gp_ctx->lp_ctx), + lpcfg_smb_ports(gp_ctx->lp_ctx), "sysvol", NULL, - lp_socket_options(gp_ctx->lp_ctx), + lpcfg_socket_options(gp_ctx->lp_ctx), gp_ctx->credentials, - lp_resolve_context(gp_ctx->lp_ctx), + lpcfg_resolve_context(gp_ctx->lp_ctx), gp_ctx->ev_ctx, &options, &session_options, - lp_gensec_settings(gp_ctx, gp_ctx->lp_ctx)); + lpcfg_gensec_settings(gp_ctx, gp_ctx->lp_ctx)); return NT_STATUS_OK; } diff --git a/source4/lib/policy/gp_ldap.c b/source4/lib/policy/gp_ldap.c index 5e76b3f747..9a66f4f6ac 100644 --- a/source4/lib/policy/gp_ldap.c +++ b/source4/lib/policy/gp_ldap.c @@ -158,7 +158,7 @@ NTSTATUS gp_init(TALLOC_CTX *mem_ctx, io = talloc_zero(mem_ctx, struct libnet_LookupDCs); NT_STATUS_HAVE_NO_MEMORY(io); io->in.name_type = NBT_NAME_PDC; - io->in.domain_name = lp_workgroup(lp_ctx); + io->in.domain_name = lpcfg_workgroup(lp_ctx); /* Find Active DC's */ rv = libnet_LookupDCs(net_ctx, mem_ctx, io); diff --git a/source4/lib/policy/gp_manage.c b/source4/lib/policy/gp_manage.c index 8d0ab2df4a..f2d32431df 100644 --- a/source4/lib/policy/gp_manage.c +++ b/source4/lib/policy/gp_manage.c @@ -156,7 +156,7 @@ NTSTATUS gp_create_gpo (struct gp_context *gp_ctx, const char *display_name, str gpo->display_name = talloc_strdup(gpo, display_name); NT_STATUS_HAVE_NO_MEMORY_AND_FREE(gpo->display_name, mem_ctx); - gpo->file_sys_path = talloc_asprintf(gpo, "\\\\%s\\sysvol\\%s\\Policies\\%s", lp_dnsdomain(gp_ctx->lp_ctx), lp_dnsdomain(gp_ctx->lp_ctx), name); + gpo->file_sys_path = talloc_asprintf(gpo, "\\\\%s\\sysvol\\%s\\Policies\\%s", lpcfg_dnsdomain(gp_ctx->lp_ctx), lpcfg_dnsdomain(gp_ctx->lp_ctx), name); NT_STATUS_HAVE_NO_MEMORY_AND_FREE(gpo->file_sys_path, mem_ctx); /* Create the GPT */ diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c index 58894feb3a..a3ba6c5351 100644 --- a/source4/lib/registry/pyregistry.c +++ b/source4/lib/registry/pyregistry.c @@ -275,7 +275,7 @@ static PyObject *py_open_samba(PyObject *self, PyObject *args, PyObject *kwargs) &py_credentials)) return NULL; - lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ + lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ if (lp_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "Expected loadparm context"); return NULL; @@ -346,7 +346,7 @@ static PyObject *py_open_ldb_file(PyObject *self, PyObject *args, PyObject *kwar &py_credentials, &py_lp_ctx)) return NULL; - lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ + lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ if (lp_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "Expected loadparm context"); return NULL; diff --git a/source4/lib/registry/samba.c b/source4/lib/registry/samba.c index f4949939c9..f798496dbe 100644 --- a/source4/lib/registry/samba.c +++ b/source4/lib/registry/samba.c @@ -38,7 +38,7 @@ static WERROR mount_samba_hive(struct registry_context *ctx, const char *location; location = talloc_asprintf(ctx, "%s/%s.ldb", - lp_private_dir(lp_ctx), + lpcfg_private_dir(lp_ctx), name); W_ERROR_HAVE_NO_MEMORY(location); diff --git a/source4/lib/socket/testsuite.c b/source4/lib/socket/testsuite.c index cba283f558..0195064a80 100644 --- a/source4/lib/socket/testsuite.c +++ b/source4/lib/socket/testsuite.c @@ -42,7 +42,7 @@ static bool test_udp(struct torture_context *tctx) TALLOC_CTX *mem_ctx = tctx; struct interface *ifaces; - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); status = socket_create("ip", SOCKET_TYPE_DGRAM, &sock1, 0); torture_assert_ntstatus_ok(tctx, status, "creating DGRAM IP socket 1"); @@ -135,7 +135,7 @@ static bool test_tcp(struct torture_context *tctx) torture_assert_ntstatus_ok(tctx, status, "creating IP stream socket 1"); talloc_steal(mem_ctx, sock2); - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); localhost = socket_address_from_strings(sock1, sock1->backend_name, iface_best_ip(ifaces, "127.0.0.1"), 0); torture_assert(tctx, localhost, "Localhost not found"); diff --git a/source4/lib/tls/tls.c b/source4/lib/tls/tls.c index 470b555aee..63724e9628 100644 --- a/source4/lib/tls/tls.c +++ b/source4/lib/tls/tls.c @@ -357,11 +357,11 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx, struct loadparm_context * struct tls_params *params; int ret; TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); - const char *keyfile = lp_tls_keyfile(tmp_ctx, lp_ctx); - const char *certfile = lp_tls_certfile(tmp_ctx, lp_ctx); - const char *cafile = lp_tls_cafile(tmp_ctx, lp_ctx); - const char *crlfile = lp_tls_crlfile(tmp_ctx, lp_ctx); - const char *dhpfile = lp_tls_dhpfile(tmp_ctx, lp_ctx); + const char *keyfile = lpcfg_tls_keyfile(tmp_ctx, lp_ctx); + const char *certfile = lpcfg_tls_certfile(tmp_ctx, lp_ctx); + const char *cafile = lpcfg_tls_cafile(tmp_ctx, lp_ctx); + const char *crlfile = lpcfg_tls_crlfile(tmp_ctx, lp_ctx); + const char *dhpfile = lpcfg_tls_dhpfile(tmp_ctx, lp_ctx); void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *, const char *); params = talloc(mem_ctx, struct tls_params); if (params == NULL) { @@ -369,7 +369,7 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx, struct loadparm_context * return NULL; } - if (!lp_tls_enabled(lp_ctx) || keyfile == NULL || *keyfile == 0) { + if (!lpcfg_tls_enabled(lp_ctx) || keyfile == NULL || *keyfile == 0) { params->tls_enabled = false; talloc_free(tmp_ctx); return params; @@ -377,8 +377,8 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx, struct loadparm_context * if (!file_exist(cafile)) { char *hostname = talloc_asprintf(mem_ctx, "%s.%s", - lp_netbios_name(lp_ctx), - lp_dnsdomain(lp_ctx)); + lpcfg_netbios_name(lp_ctx), + lpcfg_dnsdomain(lp_ctx)); if (hostname == NULL) { goto init_failed; } diff --git a/source4/libcli/ldap/ldap_bind.c b/source4/libcli/ldap/ldap_bind.c index 804c57c2b2..5a2635ac0b 100644 --- a/source4/libcli/ldap/ldap_bind.c +++ b/source4/libcli/ldap/ldap_bind.c @@ -225,7 +225,7 @@ _PUBLIC_ NTSTATUS ldap_bind_sasl(struct ldap_connection *conn, status = gensec_client_start(conn, &conn->gensec, conn->event.event_ctx, - lp_gensec_settings(conn, lp_ctx)); + lpcfg_gensec_settings(conn, lp_ctx)); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("Failed to start GENSEC engine (%s)\n", nt_errstr(status))); goto failed; diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c index 281266361e..b000b20f1e 100644 --- a/source4/libcli/ldap/ldap_client.c +++ b/source4/libcli/ldap/ldap_client.c @@ -339,8 +339,8 @@ _PUBLIC_ struct composite_context *ldap_connect_send(struct ldap_connection *con * local host name as the target for gensec's * DIGEST-MD5 mechanism */ conn->host = talloc_asprintf(conn, "%s.%s", - lp_netbios_name(conn->lp_ctx), - lp_dnsdomain(conn->lp_ctx)); + lpcfg_netbios_name(conn->lp_ctx), + lpcfg_dnsdomain(conn->lp_ctx)); if (composite_nomem(conn->host, state->ctx)) { return result; } @@ -375,7 +375,7 @@ _PUBLIC_ struct composite_context *ldap_connect_send(struct ldap_connection *con } ctx = socket_connect_multi_send(state, conn->host, 1, &conn->port, - lp_resolve_context(conn->lp_ctx), conn->event.event_ctx); + lpcfg_resolve_context(conn->lp_ctx), conn->event.event_ctx); if (ctx == NULL) goto failed; ctx->async.fn = ldap_connect_recv_tcp_conn; @@ -405,7 +405,7 @@ static void ldap_connect_got_sock(struct composite_context *ctx, talloc_steal(conn, conn->sock); if (conn->ldaps) { struct socket_context *tls_socket; - char *cafile = lp_tls_cafile(conn->sock, conn->lp_ctx); + char *cafile = lpcfg_tls_cafile(conn->sock, conn->lp_ctx); if (!cafile || !*cafile) { talloc_free(conn->sock); diff --git a/source4/libcli/resolve/bcast.c b/source4/libcli/resolve/bcast.c index da58eb8665..0ad3e1230b 100644 --- a/source4/libcli/resolve/bcast.c +++ b/source4/libcli/resolve/bcast.c @@ -101,6 +101,6 @@ bool resolve_context_add_bcast_method(struct resolve_context *ctx, struct interf bool resolve_context_add_bcast_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx) { struct interface *ifaces; - load_interfaces(ctx, lp_interfaces(lp_ctx), &ifaces); - return resolve_context_add_bcast_method(ctx, ifaces, lp_nbt_port(lp_ctx), lp_parm_int(lp_ctx, NULL, "nbt", "timeout", 1)); + load_interfaces(ctx, lpcfg_interfaces(lp_ctx), &ifaces); + return resolve_context_add_bcast_method(ctx, ifaces, lpcfg_nbt_port(lp_ctx), lpcfg_parm_int(lp_ctx, NULL, "nbt", "timeout", 1)); } diff --git a/source4/libcli/resolve/file.c b/source4/libcli/resolve/file.c index 950815ddc4..c01b462909 100644 --- a/source4/libcli/resolve/file.c +++ b/source4/libcli/resolve/file.c @@ -146,5 +146,5 @@ bool resolve_context_add_file_method(struct resolve_context *ctx, const char *lo bool resolve_context_add_file_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx) { - return resolve_context_add_file_method(ctx, lp_parm_string(lp_ctx, NULL, "resolv", "host file")); + return resolve_context_add_file_method(ctx, lpcfg_parm_string(lp_ctx, NULL, "resolv", "host file")); } diff --git a/source4/libcli/resolve/resolve_lp.c b/source4/libcli/resolve/resolve_lp.c index 887e0d543e..69c05a2ea0 100644 --- a/source4/libcli/resolve/resolve_lp.c +++ b/source4/libcli/resolve/resolve_lp.c @@ -21,9 +21,9 @@ #include "libcli/resolve/resolve.h" #include "param/param.h" -struct resolve_context *lp_resolve_context(struct loadparm_context *lp_ctx) +struct resolve_context *lpcfg_resolve_context(struct loadparm_context *lp_ctx) { - const char **methods = lp_name_resolve_order(lp_ctx); + const char **methods = lpcfg_name_resolve_order(lp_ctx); int i; struct resolve_context *ret = resolve_context_init(lp_ctx); diff --git a/source4/libcli/resolve/wins.c b/source4/libcli/resolve/wins.c index 03eaf8786f..989f40e6cd 100644 --- a/source4/libcli/resolve/wins.c +++ b/source4/libcli/resolve/wins.c @@ -77,6 +77,6 @@ bool resolve_context_add_wins_method(struct resolve_context *ctx, const char **a bool resolve_context_add_wins_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx) { struct interface *ifaces; - load_interfaces(ctx, lp_interfaces(lp_ctx), &ifaces); - return resolve_context_add_wins_method(ctx, lp_wins_server_list(lp_ctx), ifaces, lp_nbt_port(lp_ctx), lp_parm_int(lp_ctx, NULL, "nbt", "timeout", 1)); + load_interfaces(ctx, lpcfg_interfaces(lp_ctx), &ifaces); + return resolve_context_add_wins_method(ctx, lpcfg_wins_server_list(lp_ctx), ifaces, lpcfg_nbt_port(lp_ctx), lpcfg_parm_int(lp_ctx, NULL, "nbt", "timeout", 1)); } diff --git a/source4/libcli/smb_composite/smb_composite.h b/source4/libcli/smb_composite/smb_composite.h index 448e05a6ed..84d9e78b91 100644 --- a/source4/libcli/smb_composite/smb_composite.h +++ b/source4/libcli/smb_composite/smb_composite.h @@ -178,7 +178,7 @@ struct smb_composite_connectmulti { int num_dests; const char **hostnames; const char **addresses; - int *ports; /* Either NULL for lp_smb_ports() per + int *ports; /* Either NULL for lpcfg_smb_ports() per * destination or a list of explicit ports */ } in; struct { diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c index 75cb34f632..032be8f79f 100644 --- a/source4/libcli/wrepl/winsrepl.c +++ b/source4/libcli/wrepl/winsrepl.c @@ -136,7 +136,7 @@ NTSTATUS wrepl_socket_split_stream(struct wrepl_socket *wrepl_socket, const char *wrepl_best_ip(struct loadparm_context *lp_ctx, const char *peer_ip) { struct interface *ifaces; - load_interfaces(lp_ctx, lp_interfaces(lp_ctx), &ifaces); + load_interfaces(lp_ctx, lpcfg_interfaces(lp_ctx), &ifaces); return iface_best_ip(ifaces, peer_ip); } diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 86cf80b4da..05f18b42a5 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -46,7 +46,7 @@ struct libnet_context *libnet_context_init(struct tevent_context *ev, dcerpc_init(lp_ctx); /* name resolution methods */ - ctx->resolve_ctx = lp_resolve_context(lp_ctx); + ctx->resolve_ctx = lpcfg_resolve_context(lp_ctx); /* connected services' params */ ZERO_STRUCT(ctx->samr); diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index 833f5d3bd6..828fd521d9 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -740,7 +740,7 @@ struct libnet_BecomeDC_state { static int32_t get_dc_function_level(struct loadparm_context *lp_ctx) { /* per default we are (Windows) 2008 R2 compatible */ - return lp_parm_int(lp_ctx, NULL, "ads", "dc function level", + return lpcfg_parm_int(lp_ctx, NULL, "ads", "dc function level", DS_DOMAIN_FUNCTION_2008_R2); } @@ -766,7 +766,7 @@ static void becomeDC_send_cldap(struct libnet_BecomeDC_state *s) ret = tsocket_address_inet_from_strings(s, "ip", s->source_dsa.address, - lp_cldap_port(s->libnet->lp_ctx), + lpcfg_cldap_port(s->libnet->lp_ctx), &dest_address); if (ret != 0) { c->status = map_nt_error_from_unix(errno); @@ -1549,12 +1549,12 @@ static void becomeDC_drsuapi_connect_send(struct libnet_BecomeDC_state *s, * configuration partition works fine, but it fails for * the domain partition. */ - if (lp_parm_bool(s->libnet->lp_ctx, NULL, "become_dc", + if (lpcfg_parm_bool(s->libnet->lp_ctx, NULL, "become_dc", "force krb5", true)) { krb5_str = "krb5,"; } - if (lp_parm_bool(s->libnet->lp_ctx, NULL, "become_dc", + if (lpcfg_parm_bool(s->libnet->lp_ctx, NULL, "become_dc", "print", false)) { print_str = "print,"; @@ -2905,7 +2905,7 @@ static void becomeDC_drsuapi_update_refs_send(struct libnet_BecomeDC_state *s, r->in.req.req1.options = DRSUAPI_DRS_ADD_REF | DRSUAPI_DRS_DEL_REF; /* I think this is how we mark ourselves as a RODC */ - if (!lp_parm_bool(s->libnet->lp_ctx, NULL, "repl", "RODC", false)) { + if (!lpcfg_parm_bool(s->libnet->lp_ctx, NULL, "repl", "RODC", false)) { r->in.req.req1.options |= DRSUAPI_DRS_WRIT_REP; } diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c index a8edabf760..dd533355ad 100644 --- a/source4/libnet/libnet_join.c +++ b/source4/libnet/libnet_join.c @@ -226,7 +226,7 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J return NT_STATUS_NO_MEMORY; } - remote_ldb = ldb_wrap_connect(tmp_ctx, ctx->event_ctx, ctx->lp_ctx, + remote_ldb = ldb_wrap_connect(tmp_ctx, ctx->event_ctx, ctx->lp_ctx, remote_ldb_url, NULL, ctx->cred, 0); if (!remote_ldb) { @@ -560,8 +560,8 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, r->in.domain_name); } else { /* Bugger, we just lost our way to automatically find the domain name */ - connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, lp_workgroup(ctx->lp_ctx)); - connect_with_info->out.realm = talloc_strdup(tmp_ctx, lp_realm(ctx->lp_ctx)); + connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, lpcfg_workgroup(ctx->lp_ctx)); + connect_with_info->out.realm = talloc_strdup(tmp_ctx, lpcfg_realm(ctx->lp_ctx)); } } @@ -934,7 +934,7 @@ static NTSTATUS libnet_Join_primary_domain(struct libnet_context *ctx, if (r->in.netbios_name != NULL) { netbios_name = r->in.netbios_name; } else { - netbios_name = talloc_strdup(tmp_mem, lp_netbios_name(ctx->lp_ctx)); + netbios_name = talloc_strdup(tmp_mem, lpcfg_netbios_name(ctx->lp_ctx)); if (!netbios_name) { r->out.error_string = NULL; talloc_free(tmp_mem); diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c index 177292c7cd..43a7654d4b 100644 --- a/source4/libnet/libnet_lookup.c +++ b/source4/libnet/libnet_lookup.c @@ -193,11 +193,11 @@ struct composite_context* libnet_LookupDCs_send(struct libnet_context *ctx, struct composite_context *c; struct messaging_context *msg_ctx = messaging_client_init(mem_ctx, - lp_messaging_path(mem_ctx, ctx->lp_ctx), + lpcfg_messaging_path(mem_ctx, ctx->lp_ctx), ctx->event_ctx); - c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx), - lp_nbt_port(ctx->lp_ctx), io->in.domain_name, + c = finddcs_send(mem_ctx, lpcfg_netbios_name(ctx->lp_ctx), + lpcfg_nbt_port(ctx->lp_ctx), io->in.domain_name, io->in.name_type, NULL, ctx->resolve_ctx, ctx->event_ctx, msg_ctx); return c; diff --git a/source4/libnet/libnet_samdump.c b/source4/libnet/libnet_samdump.c index 8092260515..ab58598f29 100644 --- a/source4/libnet/libnet_samdump.c +++ b/source4/libnet/libnet_samdump.c @@ -185,7 +185,7 @@ NTSTATUS libnet_SamDump(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, if (strcasecmp_m(s->name, secret_name) != 0) { continue; } - if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(ctx->lp_ctx), CH_UTF16, CH_UNIX, + if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(ctx->lp_ctx), CH_UTF16, CH_UNIX, s->secret.data, s->secret.length, (void **)&secret_string, NULL, false)) { r->out.error_string = talloc_asprintf(mem_ctx, diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c index 05b0c13862..b9e93cf7c8 100644 --- a/source4/libnet/libnet_samsync_ldb.c +++ b/source4/libnet/libnet_samsync_ldb.c @@ -1186,7 +1186,7 @@ static NTSTATUS libnet_samsync_ldb_init(TALLOC_CTX *mem_ctx, state->remote_ldb = ldb_wrap_connect(mem_ctx, state->samsync_state->machine_net_ctx->event_ctx, - state->samsync_state->machine_net_ctx->lp_ctx, + state->samsync_state->machine_net_ctx->lp_ctx, ldap_url, NULL, state->samsync_state->machine_net_ctx->cred, 0); @@ -1215,7 +1215,7 @@ NTSTATUS libnet_samsync_ldb(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, str state->sam_ldb = samdb_connect(mem_ctx, ctx->event_ctx, - ctx->lp_ctx, + ctx->lp_ctx, r->in.session_info); if (!state->sam_ldb) { return NT_STATUS_INTERNAL_DB_ERROR; diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c index bd6dfbf421..e4f037d0b8 100644 --- a/source4/libnet/libnet_site.c +++ b/source4/libnet/libnet_site.c @@ -168,7 +168,7 @@ NTSTATUS libnet_JoinSite(struct libnet_context *ctx, } make_nbt_name_client(&name, libnet_r->out.samr_binding->host); - status = resolve_name(lp_resolve_context(ctx->lp_ctx), &name, r, &dest_addr, ctx->event_ctx); + status = resolve_name(lpcfg_resolve_context(ctx->lp_ctx), &name, r, &dest_addr, ctx->event_ctx); if (!NT_STATUS_IS_OK(status)) { libnet_r->out.error_string = NULL; talloc_free(tmp_ctx); @@ -179,7 +179,7 @@ NTSTATUS libnet_JoinSite(struct libnet_context *ctx, r->in.dest_address = dest_addr; r->in.netbios_name = libnet_r->in.netbios_name; r->in.domain_dn_str = libnet_r->out.domain_dn_str; - r->in.cldap_port = lp_cldap_port(ctx->lp_ctx); + r->in.cldap_port = lpcfg_cldap_port(ctx->lp_ctx); status = libnet_FindSite(tmp_ctx, ctx, r); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c index a8b53df56d..cf0142da86 100644 --- a/source4/libnet/libnet_unbecome_dc.c +++ b/source4/libnet/libnet_unbecome_dc.c @@ -274,7 +274,7 @@ static void unbecomeDC_send_cldap(struct libnet_UnbecomeDC_state *s) ret = tsocket_address_inet_from_strings(s, "ip", s->source_dsa.address, - lp_cldap_port(s->libnet->lp_ctx), + lpcfg_cldap_port(s->libnet->lp_ctx), &dest_address); if (ret != 0) { c->status = map_nt_error_from_unix(errno); diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c index 9f1f9626bf..b85869e93e 100644 --- a/source4/libnet/libnet_vampire.c +++ b/source4/libnet/libnet_vampire.c @@ -378,7 +378,7 @@ static NTSTATUS libnet_vampire_cb_apply_schema(struct libnet_vampire_cb_state *s return werror_to_ntstatus(status); } - if (lp_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) { + if (lpcfg_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) { for (i=0; i < schema_objs->num_objects; i++) { struct ldb_ldif ldif; fprintf(stdout, "#\n"); @@ -652,7 +652,7 @@ NTSTATUS libnet_vampire_cb_store_chunk(void *private_data, return werror_to_ntstatus(status); } - if (lp_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) { + if (lpcfg_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) { for (i=0; i < objs->num_objects; i++) { struct ldb_ldif ldif; fprintf(stdout, "#\n"); @@ -689,7 +689,7 @@ NTSTATUS libnet_vampire_cb_store_chunk(void *private_data, return NT_STATUS_FOOBAR; } - if (lp_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) { + if (lpcfg_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) { DEBUG(0,("# %s\n", sa->lDAPDisplayName)); NDR_PRINT_DEBUG(drsuapi_DsReplicaLinkedAttribute, &linked_attributes[i]); dump_data(0, @@ -727,7 +727,7 @@ NTSTATUS libnet_Vampire(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, if (r->in.netbios_name != NULL) { netbios_name = r->in.netbios_name; } else { - netbios_name = talloc_reference(join, lp_netbios_name(ctx->lp_ctx)); + netbios_name = talloc_reference(join, lpcfg_netbios_name(ctx->lp_ctx)); if (!netbios_name) { talloc_free(join); r->out.error_string = NULL; @@ -780,8 +780,8 @@ NTSTATUS libnet_Vampire(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, /* Now set these values into the smb.conf - we probably had * empty or useless defaults here from whatever smb.conf we * started with */ - lp_set_cmdline(s->lp_ctx, "realm", join->out.realm); - lp_set_cmdline(s->lp_ctx, "workgroup", join->out.domain_name); + lpcfg_set_cmdline(s->lp_ctx, "realm", join->out.realm); + lpcfg_set_cmdline(s->lp_ctx, "workgroup", join->out.domain_name); b.in.domain_dns_name = join->out.realm; b.in.domain_netbios_name = join->out.domain_name; @@ -796,7 +796,7 @@ NTSTATUS libnet_Vampire(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, b.in.callbacks.config_chunk = libnet_vampire_cb_store_chunk; b.in.callbacks.domain_chunk = libnet_vampire_cb_store_chunk; - b.in.rodc_join = lp_parm_bool(s->lp_ctx, NULL, "repl", "RODC", false); + b.in.rodc_join = lpcfg_parm_bool(s->lp_ctx, NULL, "repl", "RODC", false); status = libnet_BecomeDC(ctx, s, &b); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c index 9b5fa5d76b..f5eea223e6 100644 --- a/source4/libnet/py_net.c +++ b/source4/libnet/py_net.c @@ -281,7 +281,7 @@ static PyObject *py_net_vampire(py_net_Object *self, PyObject *args, PyObject *k return NULL; } - r.in.netbios_name = lp_netbios_name(self->libnet_ctx->lp_ctx); + r.in.netbios_name = lpcfg_netbios_name(self->libnet_ctx->lp_ctx); r.out.error_string = NULL; mem_ctx = talloc_new(NULL); @@ -346,7 +346,7 @@ static PyObject *net_obj_new(PyTypeObject *type, PyObject *args, PyObject *kwarg ret->ev = s4_event_context_init(NULL); ret->mem_ctx = talloc_new(ret->ev); - lp = lp_from_py_object(ret->mem_ctx, py_lp); + lp = lpcfg_from_py_object(ret->mem_ctx, py_lp); if (lp == NULL) { Py_DECREF(ret); return NULL; diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c index bd371be2d3..7779d31f99 100644 --- a/source4/librpc/rpc/dcerpc_connect.c +++ b/source4/librpc/rpc/dcerpc_connect.c @@ -111,19 +111,19 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT /* prepare smb connection parameters: we're connecting to IPC$ share on remote rpc server */ conn->in.dest_host = s->io.binding->host; - conn->in.dest_ports = lp_smb_ports(lp_ctx); + conn->in.dest_ports = lpcfg_smb_ports(lp_ctx); if (s->io.binding->target_hostname == NULL) conn->in.called_name = "*SMBSERVER"; /* FIXME: This is invalid */ else conn->in.called_name = s->io.binding->target_hostname; - conn->in.socket_options = lp_socket_options(lp_ctx); + conn->in.socket_options = lpcfg_socket_options(lp_ctx); conn->in.service = "IPC$"; conn->in.service_type = NULL; - conn->in.workgroup = lp_workgroup(lp_ctx); - conn->in.gensec_settings = lp_gensec_settings(conn, lp_ctx); + conn->in.workgroup = lpcfg_workgroup(lp_ctx); + conn->in.gensec_settings = lpcfg_gensec_settings(conn, lp_ctx); - lp_smbcli_options(lp_ctx, &conn->in.options); - lp_smbcli_session_options(lp_ctx, &conn->in.session_options); + lpcfg_smbcli_options(lp_ctx, &conn->in.options); + lpcfg_smbcli_session_options(lp_ctx, &conn->in.session_options); /* * provide proper credentials - user supplied, but allow a @@ -244,18 +244,18 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send( cli_credentials_guess(s->io.creds, lp_ctx); } - lp_smbcli_options(lp_ctx, &options); + lpcfg_smbcli_options(lp_ctx, &options); /* send smb2 connect request */ conn_req = smb2_connect_send(mem_ctx, s->io.binding->host, - lp_parm_string_list(mem_ctx, lp_ctx, NULL, "smb2", "ports", NULL), + lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "smb2", "ports", NULL), "IPC$", s->io.resolve_ctx, s->io.creds, c->event_ctx, &options, - lp_socket_options(lp_ctx), - lp_gensec_settings(mem_ctx, lp_ctx) + lpcfg_socket_options(lp_ctx), + lpcfg_gensec_settings(mem_ctx, lp_ctx) ); composite_continue(c, conn_req, continue_smb2_connect, c); return c; @@ -462,7 +462,7 @@ static struct composite_context* dcerpc_pipe_connect_ncalrpc_send(TALLOC_CTX *me s->io = *io; /* send pipe open request */ - pipe_req = dcerpc_pipe_open_pipe_send(s->io.pipe->conn, lp_ncalrpc_dir(lp_ctx), + pipe_req = dcerpc_pipe_open_pipe_send(s->io.pipe->conn, lpcfg_ncalrpc_dir(lp_ctx), s->io.binding->endpoint); composite_continue(c, pipe_req, continue_pipe_open_ncalrpc, c); return c; @@ -539,7 +539,7 @@ static void continue_connect(struct composite_context *c, struct pipe_connect_st pc.binding = s->binding; pc.interface = s->table; pc.creds = s->credentials; - pc.resolve_ctx = lp_resolve_context(s->lp_ctx); + pc.resolve_ctx = lpcfg_resolve_context(s->lp_ctx); /* connect dcerpc pipe depending on required transport */ switch (s->binding->transport) { @@ -746,7 +746,7 @@ _PUBLIC_ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent if (composite_nomem(s->pipe, c)) return c; if (DEBUGLEVEL >= 10) - s->pipe->conn->packet_log_dir = lp_lockdir(lp_ctx); + s->pipe->conn->packet_log_dir = lpcfg_lockdir(lp_ctx); /* store parameters in state structure */ s->binding = binding; diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c index 253748218a..b8839f9c77 100644 --- a/source4/librpc/rpc/dcerpc_schannel.c +++ b/source4/librpc/rpc/dcerpc_schannel.c @@ -327,7 +327,7 @@ static void continue_schannel_key(struct composite_context *ctx) /* send bind auth request with received creds */ auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table, s->credentials, - lp_gensec_settings(c, s->lp_ctx), + lpcfg_gensec_settings(c, s->lp_ctx), DCERPC_AUTH_TYPE_SCHANNEL, s->auth_level, NULL); if (composite_nomem(auth_req, c)) return; diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index b2bd145d1a..280115eb90 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -460,7 +460,7 @@ static void continue_ntlmssp_connection(struct composite_context *ctx) /* initiate a authenticated bind */ auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table, s->credentials, - lp_gensec_settings(c, s->lp_ctx), + lpcfg_gensec_settings(c, s->lp_ctx), DCERPC_AUTH_TYPE_NTLMSSP, dcerpc_auth_level(s->pipe->conn), s->table->authservices->names[0]); @@ -493,7 +493,7 @@ static void continue_spnego_after_wrong_pass(struct composite_context *ctx) /* initiate a authenticated bind */ auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table, s->credentials, - lp_gensec_settings(c, s->lp_ctx), + lpcfg_gensec_settings(c, s->lp_ctx), DCERPC_AUTH_TYPE_SPNEGO, dcerpc_auth_level(s->pipe->conn), s->table->authservices->names[0]); @@ -618,7 +618,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p, /* try SPNEGO with fallback to NTLMSSP */ auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table, s->credentials, - lp_gensec_settings(c, s->lp_ctx), + lpcfg_gensec_settings(c, s->lp_ctx), DCERPC_AUTH_TYPE_SPNEGO, dcerpc_auth_level(conn), s->table->authservices->names[0]); @@ -628,7 +628,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p, auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table, s->credentials, - lp_gensec_settings(c, s->lp_ctx), + lpcfg_gensec_settings(c, s->lp_ctx), auth_type, dcerpc_auth_level(conn), s->table->authservices->names[0]); diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c index d0f9878b31..258e4584be 100644 --- a/source4/librpc/rpc/pyrpc.c +++ b/source4/librpc/rpc/pyrpc.c @@ -317,7 +317,7 @@ PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, Py return NULL; } - lp_ctx = lp_from_py_object(mem_ctx, py_lp_ctx); + lp_ctx = lpcfg_from_py_object(mem_ctx, py_lp_ctx); if (lp_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "Expected loadparm context"); talloc_free(mem_ctx); @@ -411,7 +411,7 @@ static PyObject *dcerpc_interface_new(PyTypeObject *type, PyObject *args, PyObje return NULL; } - lp_ctx = lp_from_py_object(mem_ctx, py_lp_ctx); + lp_ctx = lpcfg_from_py_object(mem_ctx, py_lp_ctx); if (lp_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "Expected loadparm context"); talloc_free(mem_ctx); diff --git a/source4/nbt_server/dgram/netlogon.c b/source4/nbt_server/dgram/netlogon.c index c9d864c3c3..8e231ccc23 100644 --- a/source4/nbt_server/dgram/netlogon.c +++ b/source4/nbt_server/dgram/netlogon.c @@ -55,13 +55,13 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot, samctx = iface->nbtsrv->sam_ctx; - if (lp_server_role(iface->nbtsrv->task->lp_ctx) != ROLE_DOMAIN_CONTROLLER + if (lpcfg_server_role(iface->nbtsrv->task->lp_ctx) != ROLE_DOMAIN_CONTROLLER || !samdb_is_pdc(samctx)) { DEBUG(2, ("Not a PDC, so not processing LOGON_PRIMARY_QUERY\n")); return; } - if (strcasecmp_m(name->name, lp_workgroup(iface->nbtsrv->task->lp_ctx)) != 0) { + if (strcasecmp_m(name->name, lpcfg_workgroup(iface->nbtsrv->task->lp_ctx)) != 0) { DEBUG(5,("GetDC requested for a domian %s that we don't host\n", name->name)); return; } @@ -72,16 +72,16 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot, pdc = &netlogon_response.data.get_pdc; pdc->command = NETLOGON_RESPONSE_FROM_PDC; - pdc->pdc_name = lp_netbios_name(iface->nbtsrv->task->lp_ctx); + pdc->pdc_name = lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx); pdc->unicode_pdc_name = pdc->pdc_name; - pdc->domain_name = lp_workgroup(iface->nbtsrv->task->lp_ctx); + pdc->domain_name = lpcfg_workgroup(iface->nbtsrv->task->lp_ctx); pdc->nt_version = 1; pdc->lmnt_token = 0xFFFF; pdc->lm20_token = 0xFFFF; dgram_mailslot_netlogon_reply(reply_iface->dgmsock, packet, - lp_netbios_name(iface->nbtsrv->task->lp_ctx), + lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx), netlogon->req.pdc.mailslot_name, &netlogon_response); } @@ -137,7 +137,7 @@ static void nbtd_netlogon_samlogon(struct dgram_mailslot_handler *dgmslot, dgram_mailslot_netlogon_reply(reply_iface->dgmsock, packet, - lp_netbios_name(iface->nbtsrv->task->lp_ctx), + lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx), netlogon->req.logon.mailslot_name, &netlogon_response); } diff --git a/source4/nbt_server/dgram/ntlogon.c b/source4/nbt_server/dgram/ntlogon.c index 87e76e08ee..978d354abc 100644 --- a/source4/nbt_server/dgram/ntlogon.c +++ b/source4/nbt_server/dgram/ntlogon.c @@ -51,9 +51,9 @@ static void nbtd_ntlogon_sam_logon(struct dgram_mailslot_handler *dgmslot, logon = &reply.req.reply; logon->server = talloc_asprintf(packet, "\\\\%s", - lp_netbios_name(iface->nbtsrv->task->lp_ctx)); + lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx)); logon->user_name = ntlogon->req.logon.user_name; - logon->domain = lp_workgroup(iface->nbtsrv->task->lp_ctx); + logon->domain = lpcfg_workgroup(iface->nbtsrv->task->lp_ctx); logon->nt_version = 1; logon->lmnt_token = 0xFFFF; logon->lm20_token = 0xFFFF; @@ -62,7 +62,7 @@ static void nbtd_ntlogon_sam_logon(struct dgram_mailslot_handler *dgmslot, dgram_mailslot_ntlogon_reply(reply_iface->dgmsock, packet, - lp_netbios_name(iface->nbtsrv->task->lp_ctx), + lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx), ntlogon->req.logon.mailslot_name, &reply); } diff --git a/source4/nbt_server/dgram/request.c b/source4/nbt_server/dgram/request.c index 4a3bd13368..0e9a045945 100644 --- a/source4/nbt_server/dgram/request.c +++ b/source4/nbt_server/dgram/request.c @@ -83,7 +83,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address bcast_addr = socket_address_from_strings(tmp_ctx, bcast_dgmsock->sock->backend_name, iface->bcast_address, - lp_dgram_port(iface->nbtsrv->task->lp_ctx)); + lpcfg_dgram_port(iface->nbtsrv->task->lp_ctx)); if (!bcast_addr) { talloc_free(tmp_ctx); return NT_STATUS_NO_MEMORY; @@ -93,7 +93,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address if (!NT_STATUS_IS_OK(status)) { talloc_free(tmp_ctx); DEBUG(0,("Failed to bind to %s:%d - %s\n", - iface->bcast_address, lp_dgram_port(iface->nbtsrv->task->lp_ctx), + iface->bcast_address, lpcfg_dgram_port(iface->nbtsrv->task->lp_ctx), nt_errstr(status))); return status; } @@ -109,7 +109,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address } bind_addr = socket_address_from_strings(tmp_ctx, iface->dgmsock->sock->backend_name, - bind_address, lp_dgram_port(iface->nbtsrv->task->lp_ctx)); + bind_address, lpcfg_dgram_port(iface->nbtsrv->task->lp_ctx)); if (!bind_addr) { talloc_free(tmp_ctx); return NT_STATUS_NO_MEMORY; @@ -119,7 +119,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address if (!NT_STATUS_IS_OK(status)) { talloc_free(tmp_ctx); DEBUG(0,("Failed to bind to %s:%d - %s\n", - bind_address, lp_dgram_port(iface->nbtsrv->task->lp_ctx), nt_errstr(status))); + bind_address, lpcfg_dgram_port(iface->nbtsrv->task->lp_ctx), nt_errstr(status))); return status; } diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c index 19639dd167..bd2143e26c 100644 --- a/source4/nbt_server/interfaces.c +++ b/source4/nbt_server/interfaces.c @@ -193,7 +193,7 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv, } bcast_address = socket_address_from_strings(bcast_nbtsock, bcast_nbtsock->sock->backend_name, - bcast, lp_nbt_port(lp_ctx)); + bcast, lpcfg_nbt_port(lp_ctx)); if (!bcast_address) { talloc_free(iface); return NT_STATUS_NO_MEMORY; @@ -202,7 +202,7 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv, status = socket_listen(bcast_nbtsock->sock, bcast_address, 0, 0); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("Failed to bind to %s:%d - %s\n", - bcast, lp_nbt_port(lp_ctx), nt_errstr(status))); + bcast, lpcfg_nbt_port(lp_ctx), nt_errstr(status))); talloc_free(iface); return status; } @@ -220,12 +220,12 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv, unicast_address = socket_address_from_strings(iface->nbtsock, iface->nbtsock->sock->backend_name, - bind_address, lp_nbt_port(lp_ctx)); + bind_address, lpcfg_nbt_port(lp_ctx)); status = socket_listen(iface->nbtsock->sock, unicast_address, 0, 0); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("Failed to bind to %s:%d - %s\n", - bind_address, lp_nbt_port(lp_ctx), nt_errstr(status))); + bind_address, lpcfg_nbt_port(lp_ctx), nt_errstr(status))); talloc_free(iface); return status; } @@ -283,7 +283,7 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_con /* if we are allowing incoming packets from any address, then we also need to bind to the wildcard address */ - if (!lp_bind_interfaces_only(lp_ctx)) { + if (!lpcfg_bind_interfaces_only(lp_ctx)) { const char *primary_address; /* the primary address is the address we will return @@ -293,7 +293,7 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_con primary_address = iface_n_ip(ifaces, 0); } else { primary_address = inet_ntoa(interpret_addr2( - lp_netbios_name(lp_ctx))); + lpcfg_netbios_name(lp_ctx))); } primary_address = talloc_strdup(tmp_ctx, primary_address); NT_STATUS_HAVE_NO_MEMORY(primary_address); @@ -318,12 +318,12 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_con bcast = talloc_strdup(tmp_ctx, bcast); netmask = talloc_strdup(tmp_ctx, iface_n_netmask(ifaces, i)); - status = nbtd_add_socket(nbtsrv, lp_ctx, + status = nbtd_add_socket(nbtsrv, lp_ctx, address, address, bcast, netmask); NT_STATUS_NOT_OK_RETURN(status); } - if (lp_wins_server_list(lp_ctx)) { + if (lpcfg_wins_server_list(lp_ctx)) { status = nbtd_add_wins_socket(nbtsrv); NT_STATUS_NOT_OK_RETURN(status); } diff --git a/source4/nbt_server/nbt_server.c b/source4/nbt_server/nbt_server.c index 38abf7135e..2ffa911587 100644 --- a/source4/nbt_server/nbt_server.c +++ b/source4/nbt_server/nbt_server.c @@ -39,7 +39,7 @@ static void nbtd_task_init(struct task_server *task) NTSTATUS status; struct interface *ifaces; - load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces); + load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces); if (iface_count(ifaces) == 0) { task_server_terminate(task, "nbtd: no network interfaces configured", false); diff --git a/source4/nbt_server/packet.c b/source4/nbt_server/packet.c index ff4e94fef9..af96a0130b 100644 --- a/source4/nbt_server/packet.c +++ b/source4/nbt_server/packet.c @@ -79,7 +79,7 @@ bool nbtd_self_packet(struct nbt_name_socket *nbtsock, struct nbtd_server *nbtsrv = iface->nbtsrv; /* if its not from the nbt port, then it wasn't a broadcast from us */ - if (src->port != lp_nbt_port(iface->nbtsrv->task->lp_ctx)) { + if (src->port != lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx)) { return false; } diff --git a/source4/nbt_server/query.c b/source4/nbt_server/query.c index be1492f1cd..c888dcaca1 100644 --- a/source4/nbt_server/query.c +++ b/source4/nbt_server/query.c @@ -82,7 +82,7 @@ void nbtd_request_query(struct nbt_name_socket *nbtsock, if (!(packet->operation & NBT_FLAG_BROADCAST) && (packet->operation & NBT_FLAG_RECURSION_DESIRED) && (iname->nb_flags & NBT_NM_GROUP) && - lp_wins_support(iface->nbtsrv->task->lp_ctx)) { + lpcfg_wins_support(iface->nbtsrv->task->lp_ctx)) { nbtd_winsserver_request(nbtsock, packet, src); return; } diff --git a/source4/nbt_server/register.c b/source4/nbt_server/register.c index a2840ab5c0..b151fd285d 100644 --- a/source4/nbt_server/register.c +++ b/source4/nbt_server/register.c @@ -93,7 +93,7 @@ static void name_refresh_handler(struct tevent_context *ev, struct tevent_timer registration packets */ io.in.name = iname->name; io.in.dest_addr = iface->bcast_address; - io.in.dest_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx); + io.in.dest_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx); io.in.address = iface->ip_address; io.in.nb_flags = iname->nb_flags; io.in.ttl = iname->ttl; @@ -118,7 +118,7 @@ static void name_refresh_handler(struct tevent_context *ev, struct tevent_timer static void nbtd_start_refresh_timer(struct nbtd_iface_name *iname) { uint32_t refresh_time; - uint32_t max_refresh_time = lp_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "max_refresh_time", 7200); + uint32_t max_refresh_time = lpcfg_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "max_refresh_time", 7200); refresh_time = MIN(max_refresh_time, iname->ttl/2); @@ -171,7 +171,7 @@ static void nbtd_register_name_iface(struct nbtd_interface *iface, uint16_t nb_flags) { struct nbtd_iface_name *iname; - const char *scope = lp_netbios_scope(iface->nbtsrv->task->lp_ctx); + const char *scope = lpcfg_netbios_scope(iface->nbtsrv->task->lp_ctx); struct nbt_name_register_bcast io; struct composite_context *creq; struct nbtd_server *nbtsrv = iface->nbtsrv; @@ -188,7 +188,7 @@ static void nbtd_register_name_iface(struct nbtd_interface *iface, iname->name.scope = NULL; } iname->nb_flags = nb_flags; - iname->ttl = lp_parm_int(iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "bcast_ttl", 300000); + iname->ttl = lpcfg_parm_int(iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "bcast_ttl", 300000); iname->registration_time = timeval_zero(); iname->wins_server = NULL; @@ -211,7 +211,7 @@ static void nbtd_register_name_iface(struct nbtd_interface *iface, /* setup a broadcast name registration request */ io.in.name = iname->name; io.in.dest_addr = iface->bcast_address; - io.in.dest_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx); + io.in.dest_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx); io.in.address = iface->ip_address; io.in.nb_flags = nb_flags; io.in.ttl = iname->ttl; @@ -262,29 +262,29 @@ void nbtd_register_names(struct nbtd_server *nbtsrv) /* note that we don't initially mark the names "ACTIVE". They are marked active once registration is successful */ - nbtd_register_name(nbtsrv, lp_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_CLIENT, nb_flags); - nbtd_register_name(nbtsrv, lp_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_USER, nb_flags); - nbtd_register_name(nbtsrv, lp_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_SERVER, nb_flags); + nbtd_register_name(nbtsrv, lpcfg_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_CLIENT, nb_flags); + nbtd_register_name(nbtsrv, lpcfg_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_USER, nb_flags); + nbtd_register_name(nbtsrv, lpcfg_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_SERVER, nb_flags); - aliases = lp_netbios_aliases(nbtsrv->task->lp_ctx); + aliases = lpcfg_netbios_aliases(nbtsrv->task->lp_ctx); while (aliases && aliases[0]) { nbtd_register_name(nbtsrv, aliases[0], NBT_NAME_CLIENT, nb_flags); nbtd_register_name(nbtsrv, aliases[0], NBT_NAME_SERVER, nb_flags); aliases++; } - if (lp_server_role(nbtsrv->task->lp_ctx) == ROLE_DOMAIN_CONTROLLER) { + if (lpcfg_server_role(nbtsrv->task->lp_ctx) == ROLE_DOMAIN_CONTROLLER) { bool is_pdc = samdb_is_pdc(nbtsrv->sam_ctx); if (is_pdc) { - nbtd_register_name(nbtsrv, lp_workgroup(nbtsrv->task->lp_ctx), + nbtd_register_name(nbtsrv, lpcfg_workgroup(nbtsrv->task->lp_ctx), NBT_NAME_PDC, nb_flags); } - nbtd_register_name(nbtsrv, lp_workgroup(nbtsrv->task->lp_ctx), + nbtd_register_name(nbtsrv, lpcfg_workgroup(nbtsrv->task->lp_ctx), NBT_NAME_LOGON, nb_flags | NBT_NM_GROUP); } nb_flags |= NBT_NM_GROUP; - nbtd_register_name(nbtsrv, lp_workgroup(nbtsrv->task->lp_ctx), NBT_NAME_CLIENT, nb_flags); + nbtd_register_name(nbtsrv, lpcfg_workgroup(nbtsrv->task->lp_ctx), NBT_NAME_CLIENT, nb_flags); nb_flags |= NBT_NM_PERMANENT; nbtd_register_name(nbtsrv, "__SAMBA__", NBT_NAME_CLIENT, nb_flags); diff --git a/source4/nbt_server/wins/wins_ldb.c b/source4/nbt_server/wins/wins_ldb.c index 93382d7ddc..fd609b2780 100644 --- a/source4/nbt_server/wins/wins_ldb.c +++ b/source4/nbt_server/wins/wins_ldb.c @@ -89,10 +89,10 @@ static int wins_ldb_init(struct ldb_module *module) ldb_module_set_private(module, NULL); - owner = lp_parm_string(lp_ctx, NULL, "winsdb", "local_owner"); + owner = lpcfg_parm_string(lp_ctx, NULL, "winsdb", "local_owner"); if (!owner) { struct interface *ifaces; - load_interfaces(module, lp_interfaces(lp_ctx), &ifaces); + load_interfaces(module, lpcfg_interfaces(lp_ctx), &ifaces); owner = iface_n_ip(ifaces, 0); if (!owner) { owner = "0.0.0.0"; diff --git a/source4/nbt_server/wins/winsclient.c b/source4/nbt_server/wins/winsclient.c index 94c354a22a..bbd943aca1 100644 --- a/source4/nbt_server/wins/winsclient.c +++ b/source4/nbt_server/wins/winsclient.c @@ -58,7 +58,7 @@ static void nbtd_wins_register_retry(struct tevent_context *ev, struct tevent_ti static void nbtd_wins_start_refresh_timer(struct nbtd_iface_name *iname) { uint32_t refresh_time; - uint32_t max_refresh_time = lp_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "max_refresh_time", 7200); + uint32_t max_refresh_time = lpcfg_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "max_refresh_time", 7200); refresh_time = MIN(max_refresh_time, iname->ttl/2); @@ -141,7 +141,7 @@ static void nbtd_wins_refresh(struct tevent_context *ev, struct tevent_timer *te /* setup a wins name refresh request */ io.in.name = iname->name; io.in.wins_servers = (const char **)str_list_make_single(tmp_ctx, iname->wins_server); - io.in.wins_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx); + io.in.wins_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx); io.in.addresses = nbtd_address_list(iface, tmp_ctx); io.in.nb_flags = iname->nb_flags; io.in.ttl = iname->ttl; @@ -180,7 +180,7 @@ static void nbtd_wins_register_handler(struct composite_context *c) if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { /* none of the WINS servers responded - try again periodically */ - int wins_retry_time = lp_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "wins_retry", 300); + int wins_retry_time = lpcfg_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "wins_retry", 300); event_add_timed(iname->iface->nbtsrv->task->event_ctx, iname, timeval_current_ofs(wins_retry_time, 0), @@ -237,8 +237,8 @@ void nbtd_winsclient_register(struct nbtd_iface_name *iname) /* setup a wins name register request */ io.in.name = iname->name; - io.in.wins_port = lp_nbt_port(iname->iface->nbtsrv->task->lp_ctx); - io.in.wins_servers = lp_wins_server_list(iname->iface->nbtsrv->task->lp_ctx); + io.in.wins_port = lpcfg_nbt_port(iname->iface->nbtsrv->task->lp_ctx); + io.in.wins_servers = lpcfg_wins_server_list(iname->iface->nbtsrv->task->lp_ctx); io.in.addresses = nbtd_address_list(iface, iname); io.in.nb_flags = iname->nb_flags; io.in.ttl = iname->ttl; diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c index fef5cc84d5..a0fe87dc68 100644 --- a/source4/nbt_server/wins/winsdb.c +++ b/source4/nbt_server/wins/winsdb.c @@ -971,11 +971,11 @@ static bool winsdb_check_or_add_module_list(struct tevent_context *ev_ctx, talloc_free(h->ldb); h->ldb = NULL; - if (lp_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) { + if (lpcfg_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) { flags |= LDB_FLG_NOSYNC; } - h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lp_wins_url(lp_ctx)), + h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lpcfg_wins_url(lp_ctx)), NULL, NULL, flags); if (!h->ldb) goto failed; @@ -1007,16 +1007,16 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, h = talloc_zero(mem_ctx, struct winsdb_handle); if (!h) return NULL; - if (lp_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) { + if (lpcfg_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) { flags |= LDB_FLG_NOSYNC; } - h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lp_wins_url(lp_ctx)), + h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lpcfg_wins_url(lp_ctx)), NULL, NULL, flags); if (!h->ldb) goto failed; h->caller = caller; - h->hook_script = lp_wins_hook(lp_ctx); + h->hook_script = lpcfg_wins_hook(lp_ctx); h->local_owner = talloc_strdup(h, owner); if (!h->local_owner) goto failed; diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c index ff4c5fdbb9..516258e892 100644 --- a/source4/nbt_server/wins/winsserver.c +++ b/source4/nbt_server/wins/winsserver.c @@ -415,7 +415,7 @@ static void wins_register_wack(struct nbt_name_socket *nbtsock, if (talloc_reference(s, src) == NULL) goto failed; s->io.in.nbtd_server = iface->nbtsrv; - s->io.in.nbt_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx); + s->io.in.nbt_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx); s->io.in.event_ctx = iface->nbtsrv->task->event_ctx; s->io.in.name = rec->name; s->io.in.num_addresses = winsdb_addr_list_length(rec->addresses); @@ -672,7 +672,7 @@ static void nbtd_wins_randomize1Clist(struct loadparm_context *lp_ctx, /* first sort the addresses depending on the matching to the client */ LDB_TYPESAFE_QSORT(addresses, num_addrs, src, nbtd_wins_randomize1Clist_sort); - mask = lp_parm_string(lp_ctx, NULL, "nbtd", "wins_randomize1Clist_mask"); + mask = lpcfg_parm_string(lp_ctx, NULL, "nbtd", "wins_randomize1Clist_mask"); if (!mask) { mask = "255.255.255.0"; } @@ -750,7 +750,7 @@ static void nbtd_winsserver_query(struct loadparm_context *lp_ctx, * Value: 0 = deactivated, 1 = activated */ if (name->type == NBT_NAME_LOGON && - lp_parm_bool(lp_ctx, NULL, "nbtd", "wins_prepend1Bto1Cqueries", true)) { + lpcfg_parm_bool(lp_ctx, NULL, "nbtd", "wins_prepend1Bto1Cqueries", true)) { struct nbt_name name_1b; name_1b = *name; @@ -764,7 +764,7 @@ static void nbtd_winsserver_query(struct loadparm_context *lp_ctx, status = winsdb_lookup(winssrv->wins_db, name, packet, &rec); if (!NT_STATUS_IS_OK(status)) { - if (!lp_wins_dns_proxy(lp_ctx)) { + if (!lpcfg_wins_dns_proxy(lp_ctx)) { goto notfound; } @@ -846,7 +846,7 @@ static void nbtd_winsserver_query(struct loadparm_context *lp_ctx, * Value: 0 = deactivated, 1 = activated */ if (name->type == NBT_NAME_LOGON && - lp_parm_bool(lp_ctx, NULL, "nbtd", "wins_randomize1Clist", false)) { + lpcfg_parm_bool(lp_ctx, NULL, "nbtd", "wins_randomize1Clist", false)) { nbtd_wins_randomize1Clist(lp_ctx, addresses, src); } @@ -959,7 +959,7 @@ static void nbtd_winsserver_release(struct nbt_name_socket *nbtsock, if (strcmp(rec->wins_owner, winssrv->wins_db->local_owner) != 0) { modify_flags = WINSDB_FLAG_ALLOC_VERSION | WINSDB_FLAG_TAKE_OWNERSHIP; } - if (lp_parm_bool(iface->nbtsrv->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false)) { + if (lpcfg_parm_bool(iface->nbtsrv->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false)) { /* * We have an option to propagate every name release, * this is off by default to match windows servers @@ -1038,7 +1038,7 @@ NTSTATUS nbtd_winsserver_init(struct nbtd_server *nbtsrv) uint32_t tmp; const char *owner; - if (!lp_wins_support(nbtsrv->task->lp_ctx)) { + if (!lpcfg_wins_support(nbtsrv->task->lp_ctx)) { nbtsrv->winssrv = NULL; return NT_STATUS_OK; } @@ -1046,18 +1046,18 @@ NTSTATUS nbtd_winsserver_init(struct nbtd_server *nbtsrv) nbtsrv->winssrv = talloc_zero(nbtsrv, struct wins_server); NT_STATUS_HAVE_NO_MEMORY(nbtsrv->winssrv); - nbtsrv->winssrv->config.max_renew_interval = lp_max_wins_ttl(nbtsrv->task->lp_ctx); - nbtsrv->winssrv->config.min_renew_interval = lp_min_wins_ttl(nbtsrv->task->lp_ctx); - tmp = lp_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv", "tombstone_interval", 6*24*60*60); + nbtsrv->winssrv->config.max_renew_interval = lpcfg_max_wins_ttl(nbtsrv->task->lp_ctx); + nbtsrv->winssrv->config.min_renew_interval = lpcfg_min_wins_ttl(nbtsrv->task->lp_ctx); + tmp = lpcfg_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv", "tombstone_interval", 6*24*60*60); nbtsrv->winssrv->config.tombstone_interval = tmp; - tmp = lp_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv"," tombstone_timeout", 1*24*60*60); + tmp = lpcfg_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv"," tombstone_timeout", 1*24*60*60); nbtsrv->winssrv->config.tombstone_timeout = tmp; - owner = lp_parm_string(nbtsrv->task->lp_ctx, NULL, "winsdb", "local_owner"); + owner = lpcfg_parm_string(nbtsrv->task->lp_ctx, NULL, "winsdb", "local_owner"); if (owner == NULL) { struct interface *ifaces; - load_interfaces(nbtsrv->task, lp_interfaces(nbtsrv->task->lp_ctx), &ifaces); + load_interfaces(nbtsrv->task, lpcfg_interfaces(nbtsrv->task->lp_ctx), &ifaces); owner = iface_n_ip(ifaces, 0); } diff --git a/source4/nbt_server/wins/winswack.c b/source4/nbt_server/wins/winswack.c index a58362830a..0fd9767b73 100644 --- a/source4/nbt_server/wins/winswack.c +++ b/source4/nbt_server/wins/winswack.c @@ -163,7 +163,7 @@ static void wins_release_demand_handler(struct nbt_name_request *req) if (state->current_address < state->io->in.num_addresses) { struct nbtd_interface *iface; - state->release.in.dest_port = lp_nbt_port(state->io->in.nbtd_server->task->lp_ctx); + state->release.in.dest_port = lpcfg_nbt_port(state->io->in.nbtd_server->task->lp_ctx); state->release.in.dest_addr = state->io->in.addresses[state->current_address]; state->release.in.address = state->release.in.dest_addr; state->release.in.timeout = (state->addresses_left > 1 ? 2 : 1); @@ -223,7 +223,7 @@ static struct composite_context *wins_release_demand_send(TALLOC_CTX *mem_ctx, s * with 2 retries */ state->release.in.name = *state->io->in.name; - state->release.in.dest_port = lp_nbt_port(state->io->in.nbtd_server->task->lp_ctx); + state->release.in.dest_port = lpcfg_nbt_port(state->io->in.nbtd_server->task->lp_ctx); state->release.in.dest_addr = state->io->in.addresses[state->current_address]; state->release.in.address = state->release.in.dest_addr; state->release.in.broadcast = false; @@ -306,7 +306,7 @@ NTSTATUS nbtd_proxy_wins_challenge(struct irpc_message *msg, s->req = req; s->io.in.nbtd_server = nbtd_server; - s->io.in.nbt_port = lp_nbt_port(nbtd_server->task->lp_ctx); + s->io.in.nbt_port = lpcfg_nbt_port(nbtd_server->task->lp_ctx); s->io.in.event_ctx = msg->ev; s->io.in.name = &req->in.name; s->io.in.num_addresses = req->in.num_addrs; diff --git a/source4/ntp_signd/ntp_signd.c b/source4/ntp_signd/ntp_signd.c index 3110b20059..029071e2c2 100644 --- a/source4/ntp_signd/ntp_signd.c +++ b/source4/ntp_signd/ntp_signd.c @@ -491,9 +491,9 @@ static void ntp_signd_task_init(struct task_server *task) const char *address; - if (!directory_create_or_exist(lp_ntp_signd_socket_directory(task->lp_ctx), geteuid(), 0755)) { + if (!directory_create_or_exist(lpcfg_ntp_signd_socket_directory(task->lp_ctx), geteuid(), 0755)) { char *error = talloc_asprintf(task, "Cannot create NTP signd pipe directory: %s", - lp_ntp_signd_socket_directory(task->lp_ctx)); + lpcfg_ntp_signd_socket_directory(task->lp_ctx)); task_server_terminate(task, error, true); return; @@ -525,14 +525,14 @@ static void ntp_signd_task_init(struct task_server *task) return; } - address = talloc_asprintf(ntp_signd, "%s/socket", lp_ntp_signd_socket_directory(task->lp_ctx)); + address = talloc_asprintf(ntp_signd, "%s/socket", lpcfg_ntp_signd_socket_directory(task->lp_ctx)); status = stream_setup_socket(ntp_signd->task->event_ctx, ntp_signd->task->lp_ctx, model_ops, &ntp_signd_stream_ops, "unix", address, NULL, - lp_socket_options(ntp_signd->task->lp_ctx), + lpcfg_socket_options(ntp_signd->task->lp_ctx), ntp_signd); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("Failed to bind to %s - %s\n", diff --git a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c index ef456f05df..7197af8bfc 100644 --- a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c +++ b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c @@ -44,7 +44,7 @@ */ static struct ldb_context *sptr_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_spoolss_url(lp_ctx), system_session(lp_ctx), + return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, lpcfg_spoolss_url(lp_ctx), system_session(lp_ctx), NULL, 0); } @@ -129,7 +129,7 @@ static WERROR sptr_PrintServerData(struct ntptr_GenericHandle *server, union spoolss_PrinterData *r, enum winreg_Type *type) { - struct dcerpc_server_info *server_info = lp_dcerpc_server_info(mem_ctx, server->ntptr->lp_ctx); + struct dcerpc_server_info *server_info = lpcfg_dcerpc_server_info(mem_ctx, server->ntptr->lp_ctx); if (strcmp("W3SvcInstalled", value_name) == 0) { *type = REG_DWORD; r->value = 0; @@ -212,13 +212,13 @@ static WERROR sptr_PrintServerData(struct ntptr_GenericHandle *server, r->binary = blob; return WERR_OK; } else if (strcmp("DNSMachineName", value_name) == 0) { - const char *dnsdomain = lp_dnsdomain(server->ntptr->lp_ctx); + const char *dnsdomain = lpcfg_dnsdomain(server->ntptr->lp_ctx); if (dnsdomain == NULL) return WERR_INVALID_PARAM; *type = REG_SZ; r->string = talloc_asprintf(mem_ctx, "%s.%s", - lp_netbios_name(server->ntptr->lp_ctx), + lpcfg_netbios_name(server->ntptr->lp_ctx), dnsdomain); W_ERROR_HAVE_NO_MEMORY(r->string); return WERR_OK; diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c index 9821d2751b..a8cd89a2ec 100644 --- a/source4/ntvfs/cifs/vfs_cifs.c +++ b/source4/ntvfs/cifs/vfs_cifs.c @@ -231,24 +231,24 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, /* connect to the server, using the smbd event context */ io.in.dest_host = host; - io.in.dest_ports = lp_smb_ports(ntvfs->ctx->lp_ctx); - io.in.socket_options = lp_socket_options(ntvfs->ctx->lp_ctx); + io.in.dest_ports = lpcfg_smb_ports(ntvfs->ctx->lp_ctx); + io.in.socket_options = lpcfg_socket_options(ntvfs->ctx->lp_ctx); io.in.called_name = host; io.in.credentials = credentials; io.in.fallback_to_anonymous = false; - io.in.workgroup = lp_workgroup(ntvfs->ctx->lp_ctx); + io.in.workgroup = lpcfg_workgroup(ntvfs->ctx->lp_ctx); io.in.service = remote_share; io.in.service_type = "?????"; - io.in.gensec_settings = lp_gensec_settings(p, ntvfs->ctx->lp_ctx); - lp_smbcli_options(ntvfs->ctx->lp_ctx, &io.in.options); - lp_smbcli_session_options(ntvfs->ctx->lp_ctx, &io.in.session_options); + io.in.gensec_settings = lpcfg_gensec_settings(p, ntvfs->ctx->lp_ctx); + lpcfg_smbcli_options(ntvfs->ctx->lp_ctx, &io.in.options); + lpcfg_smbcli_session_options(ntvfs->ctx->lp_ctx, &io.in.session_options); if (!(ntvfs->ctx->client_caps & NTVFS_CLIENT_CAP_LEVEL_II_OPLOCKS)) { io.in.options.use_level2_oplocks = false; } creq = smb_composite_connect_send(&io, p, - lp_resolve_context(ntvfs->ctx->lp_ctx), + lpcfg_resolve_context(ntvfs->ctx->lp_ctx), ntvfs->ctx->event_ctx); status = smb_composite_connect_recv(creq, p); NT_STATUS_NOT_OK_RETURN(status); diff --git a/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c b/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c index 6ee6961610..2a8c69e220 100644 --- a/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c +++ b/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c @@ -836,7 +836,7 @@ static NTSTATUS cifspsx_fsattr(struct ntvfs_module_context *ntvfs, fs->generic.out.serial_number = 1; fs->generic.out.fs_type = talloc_strdup(req, "NTFS"); fs->generic.out.volume_name = talloc_strdup(req, - lp_servicename(req->tcon->service)); + lpcfg_servicename(req->tcon->service)); return NT_STATUS_OK; } diff --git a/source4/ntvfs/ipc/rap_server.c b/source4/ntvfs/ipc/rap_server.c index b919cbcb20..126c78ca93 100644 --- a/source4/ntvfs/ipc/rap_server.c +++ b/source4/ntvfs/ipc/rap_server.c @@ -46,7 +46,7 @@ NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx, r->out.available = 0; r->out.info = NULL; - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(lp_ctx), event_ctx, lp_ctx, &sctx); + nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(lp_ctx), event_ctx, lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return nterr; } diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c index bfc792ec95..4f143986fc 100644 --- a/source4/ntvfs/ipc/vfs_ipc.c +++ b/source4/ntvfs/ipc/vfs_ipc.c @@ -270,7 +270,7 @@ static NTSTATUS ipc_open(struct ntvfs_module_context *ntvfs, } directory = talloc_asprintf(req, "%s/np", - lp_ncalrpc_dir(ipriv->ntvfs->ctx->lp_ctx)); + lpcfg_ncalrpc_dir(ipriv->ntvfs->ctx->lp_ctx)); NT_STATUS_HAVE_NO_MEMORY(directory); state = talloc(req, struct ipc_open_state); diff --git a/source4/ntvfs/posix/pvfs_shortname.c b/source4/ntvfs/posix/pvfs_shortname.c index fc1cad1894..bdd86f2097 100644 --- a/source4/ntvfs/posix/pvfs_shortname.c +++ b/source4/ntvfs/posix/pvfs_shortname.c @@ -614,7 +614,7 @@ NTSTATUS pvfs_mangle_init(struct pvfs_state *pvfs) } /* by default have a max of 512 entries in the cache. */ - ctx->cache_size = lp_parm_int(pvfs->ntvfs->ctx->lp_ctx, NULL, "mangle", "cachesize", 512); + ctx->cache_size = lpcfg_parm_int(pvfs->ntvfs->ctx->lp_ctx, NULL, "mangle", "cachesize", 512); ctx->prefix_cache = talloc_array(ctx, char *, ctx->cache_size); if (ctx->prefix_cache == NULL) { @@ -628,7 +628,7 @@ NTSTATUS pvfs_mangle_init(struct pvfs_state *pvfs) memset(ctx->prefix_cache, 0, sizeof(char *) * ctx->cache_size); memset(ctx->prefix_cache_hashes, 0, sizeof(uint32_t) * ctx->cache_size); - ctx->mangle_prefix = lp_parm_int(pvfs->ntvfs->ctx->lp_ctx, NULL, "mangle", "prefix", -1); + ctx->mangle_prefix = lpcfg_parm_int(pvfs->ntvfs->ctx->lp_ctx, NULL, "mangle", "prefix", -1); if (ctx->mangle_prefix < 0 || ctx->mangle_prefix > 6) { ctx->mangle_prefix = DEFAULT_MANGLE_PREFIX; } diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 05bdd0a8aa..1e0efcddc8 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -266,7 +266,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->notify_context = notify_init(pvfs, pvfs->ntvfs->ctx->server_id, pvfs->ntvfs->ctx->msg_ctx, - pvfs->ntvfs->ctx->lp_ctx, + pvfs->ntvfs->ctx->lp_ctx, pvfs->ntvfs->ctx->event_ctx, pvfs->ntvfs->ctx->config); diff --git a/source4/ntvfs/print/vfs_print.c b/source4/ntvfs/print/vfs_print.c index 0530e04f6d..06c9dfcc2f 100644 --- a/source4/ntvfs/print/vfs_print.c +++ b/source4/ntvfs/print/vfs_print.c @@ -88,7 +88,7 @@ static NTSTATUS print_ioctl(struct ntvfs_module_context *ntvfs, p = (char *)io->ioctl.out.blob.data; SSVAL(p,0, 1 /* REWRITE: fsp->rap_print_jobid */); - push_string(p+2, lp_netbios_name(ntvfs->ctx->lp_ctx), 15, STR_TERMINATE|STR_ASCII); + push_string(p+2, lpcfg_netbios_name(ntvfs->ctx->lp_ctx), 15, STR_TERMINATE|STR_ASCII); push_string(p+18, ntvfs->ctx->config->name, 13, STR_TERMINATE|STR_ASCII); return NT_STATUS_OK; } diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c index 6dbd6f0352..03bf76634d 100644 --- a/source4/ntvfs/simple/vfs_simple.c +++ b/source4/ntvfs/simple/vfs_simple.c @@ -833,7 +833,7 @@ static NTSTATUS svfs_fsattr(struct ntvfs_module_context *ntvfs, fs->generic.out.serial_number = 1; fs->generic.out.fs_type = talloc_strdup(req, "NTFS"); fs->generic.out.volume_name = talloc_strdup(req, - lp_servicename(req->tcon->service)); + lpcfg_servicename(req->tcon->service)); return NT_STATUS_OK; } diff --git a/source4/ntvfs/smb2/vfs_smb2.c b/source4/ntvfs/smb2/vfs_smb2.c index e279b5ab49..b2c90f5908 100644 --- a/source4/ntvfs/smb2/vfs_smb2.c +++ b/source4/ntvfs/smb2/vfs_smb2.c @@ -246,16 +246,16 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, return NT_STATUS_INVALID_PARAMETER; } - lp_smbcli_options(ntvfs->ctx->lp_ctx, &options); + lpcfg_smbcli_options(ntvfs->ctx->lp_ctx, &options); creq = smb2_connect_send(p, host, - lp_parm_string_list(p, ntvfs->ctx->lp_ctx, NULL, "smb2", "ports", NULL), + lpcfg_parm_string_list(p, ntvfs->ctx->lp_ctx, NULL, "smb2", "ports", NULL), remote_share, - lp_resolve_context(ntvfs->ctx->lp_ctx), + lpcfg_resolve_context(ntvfs->ctx->lp_ctx), credentials, ntvfs->ctx->event_ctx, &options, - lp_socket_options(ntvfs->ctx->lp_ctx), - lp_gensec_settings(p, ntvfs->ctx->lp_ctx) + lpcfg_socket_options(ntvfs->ctx->lp_ctx), + lpcfg_gensec_settings(p, ntvfs->ctx->lp_ctx) ); status = smb2_connect_recv(creq, p, &tree); 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/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); } } diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index d6e11edd00..1c8f7de400 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -35,7 +35,7 @@ enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct { enum srvsvc_PlatformId id; - id = lp_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "platform_id", PLATFORM_ID_NT); + id = lpcfg_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "platform_id", PLATFORM_ID_NT); return id; } @@ -46,7 +46,7 @@ const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_con /* if there's no string return our NETBIOS name */ if (!p) { - return talloc_strdup(mem_ctx, lp_netbios_name(dce_ctx->lp_ctx)); + return talloc_strdup(mem_ctx, lpcfg_netbios_name(dce_ctx->lp_ctx)); } /* if there're '\\\\' in front remove them otherwise just pass the string */ @@ -66,7 +66,7 @@ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct tevent_contex default_server_announce |= SV_TYPE_SERVER; default_server_announce |= SV_TYPE_SERVER_UNIX; - switch (lp_announce_as(dce_ctx->lp_ctx)) { + switch (lpcfg_announce_as(dce_ctx->lp_ctx)) { case ANNOUNCE_AS_NT_SERVER: default_server_announce |= SV_TYPE_SERVER_NT; /* fall through... */ @@ -83,7 +83,7 @@ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct tevent_contex break; } - switch (lp_server_role(dce_ctx->lp_ctx)) { + switch (lpcfg_server_role(dce_ctx->lp_ctx)) { case ROLE_DOMAIN_MEMBER: default_server_announce |= SV_TYPE_DOMAIN_MEMBER; break; @@ -115,10 +115,10 @@ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct tevent_contex default: break; } - if (lp_time_server(dce_ctx->lp_ctx)) + if (lpcfg_time_server(dce_ctx->lp_ctx)) default_server_announce |= SV_TYPE_TIME_SOURCE; - if (lp_host_msdfs(dce_ctx->lp_ctx)) + if (lpcfg_host_msdfs(dce_ctx->lp_ctx)) default_server_announce |= SV_TYPE_DFS_SERVER; diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index 774309996d..f2edbf74c6 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -386,7 +386,7 @@ _PUBLIC_ NTSTATUS dcesrv_endpoint_connect(struct dcesrv_context *dce_ctx, p->endpoint = ep; p->contexts = NULL; p->call_list = NULL; - p->packet_log_dir = lp_lockdir(dce_ctx->lp_ctx); + p->packet_log_dir = lpcfg_lockdir(dce_ctx->lp_ctx); p->incoming_fragmented_call_list = NULL; p->pending_call_list = NULL; p->cli_max_recv_frag = 0; @@ -468,7 +468,7 @@ static NTSTATUS dcesrv_fault(struct dcesrv_call_state *call, uint32_t fault_code NTSTATUS status; /* setup a bind_ack */ - dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); + dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); pkt.auth_length = 0; pkt.call_id = call->pkt.call_id; pkt.ptype = DCERPC_PKT_FAULT; @@ -516,7 +516,7 @@ static NTSTATUS dcesrv_bind_nak(struct dcesrv_call_state *call, uint32_t reason) NTSTATUS status; /* setup a bind_nak */ - dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); + dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); pkt.auth_length = 0; pkt.call_id = call->pkt.call_id; pkt.ptype = DCERPC_PKT_BIND_NAK; @@ -580,7 +580,7 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call) if provided, check the assoc_group is valid */ if (call->pkt.u.bind.assoc_group_id != 0 && - lp_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","assoc group checking", true) && + lpcfg_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","assoc group checking", true) && dcesrv_assoc_group_find(call->conn->dce_ctx, call->pkt.u.bind.assoc_group_id) == NULL) { return dcesrv_bind_nak(call, 0); } @@ -667,7 +667,7 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call) } if ((call->pkt.pfc_flags & DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN) && - lp_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","header signing", false)) { + lpcfg_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","header signing", false)) { call->conn->state_flags |= DCESRV_CALL_STATE_FLAG_HEADER_SIGNING; extra_flags |= DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN; } @@ -680,7 +680,7 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call) } /* setup a bind_ack */ - dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); + dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); pkt.auth_length = 0; pkt.call_id = call->pkt.call_id; pkt.ptype = DCERPC_PKT_BIND_ACK; @@ -875,7 +875,7 @@ static NTSTATUS dcesrv_alter(struct dcesrv_call_state *call) if (result == 0 && call->pkt.u.alter.assoc_group_id != 0 && - lp_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","assoc group checking", true) && + lpcfg_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","assoc group checking", true) && call->pkt.u.alter.assoc_group_id != call->context->assoc_group->id) { DEBUG(0,(__location__ ": Failed attempt to use new assoc_group in alter context (0x%08x 0x%08x)\n", call->context->assoc_group->id, call->pkt.u.alter.assoc_group_id)); @@ -885,7 +885,7 @@ static NTSTATUS dcesrv_alter(struct dcesrv_call_state *call) } /* setup a alter_resp */ - dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); + dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); pkt.auth_length = 0; pkt.call_id = call->pkt.call_id; pkt.ptype = DCERPC_PKT_ALTER_RESP; @@ -1031,7 +1031,7 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state *call) pointers */ push->ptr_count = call->ndr_pull->ptr_count; - if (lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx)) { + if (lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx)) { push->flags |= LIBNDR_FLAG_BIGENDIAN; } @@ -1070,7 +1070,7 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state *call) length = MIN(chunk_size, stub.length); /* form the dcerpc response packet */ - dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); + dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); pkt.auth_length = 0; pkt.call_id = call->pkt.call_id; pkt.ptype = DCERPC_PKT_RESPONSE; diff --git a/source4/rpc_server/dcesrv_auth.c b/source4/rpc_server/dcesrv_auth.c index 50d6f5933a..3d18e65229 100644 --- a/source4/rpc_server/dcesrv_auth.c +++ b/source4/rpc_server/dcesrv_auth.c @@ -74,7 +74,7 @@ bool dcesrv_auth_bind(struct dcesrv_call_state *call) status = samba_server_gensec_start(dce_conn, call->event_ctx, call->msg_ctx, - call->conn->dce_ctx->lp_ctx, + call->conn->dce_ctx->lp_ctx, server_credentials, NULL, &auth->gensec_security); diff --git a/source4/rpc_server/drsuapi/addentry.c b/source4/rpc_server/drsuapi/addentry.c index e87c940597..ab75ff4005 100644 --- a/source4/rpc_server/drsuapi/addentry.c +++ b/source4/rpc_server/drsuapi/addentry.c @@ -79,7 +79,7 @@ static WERROR drsuapi_add_SPNs(struct drsuapi_bind_state *b_state, ntds_guid_str = GUID_string(res, &ntds_guid); - dom_string = lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx); + dom_string = lpcfg_dnsdomain(dce_call->conn->dce_ctx->lp_ctx); /* get the dNSHostName and cn */ ret = ldb_search(b_state->sam_ctx, mem_ctx, &res2, diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c index 7db9bfda45..e4dd2f28a6 100644 --- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c +++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c @@ -77,7 +77,7 @@ static WERROR dcesrv_drsuapi_DsBind(struct dcesrv_call_state *dce_call, TALLOC_C * connect to the samdb */ b_state->sam_ctx = samdb_connect(b_state, dce_call->event_ctx, - dce_call->conn->dce_ctx->lp_ctx, auth_info); + dce_call->conn->dce_ctx->lp_ctx, auth_info); if (!b_state->sam_ctx) { return WERR_FOOBAR; } @@ -745,7 +745,7 @@ static WERROR dcesrv_drsuapi_DsReplicaGetInfo(struct dcesrv_call_state *dce_call { enum security_user_level level; - if (!lp_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL, + if (!lpcfg_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "disable_sec_check", false)) { level = security_session_user_level(dce_call->conn->auth_state.session_info, NULL); if (level < SECURITY_ADMINISTRATOR) { diff --git a/source4/rpc_server/drsuapi/drsutil.c b/source4/rpc_server/drsuapi/drsutil.c index c00653f1d7..e29c14dbc1 100644 --- a/source4/rpc_server/drsuapi/drsutil.c +++ b/source4/rpc_server/drsuapi/drsutil.c @@ -107,7 +107,7 @@ WERROR drs_security_level_check(struct dcesrv_call_state *dce_call, { enum security_user_level level; - if (lp_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL, + if (lpcfg_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "disable_sec_check", false)) { return WERR_OK; } diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c index 5d4a44be2f..cea5fc99c6 100644 --- a/source4/rpc_server/drsuapi/getncchanges.c +++ b/source4/rpc_server/drsuapi/getncchanges.c @@ -851,7 +851,7 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_ enum ldb_scope scope = LDB_SCOPE_SUBTREE; const char *extra_filter; - extra_filter = lp_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "object filter"); + extra_filter = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "object filter"); getnc_state->min_usn = req8->highwatermark.highest_usn; @@ -941,14 +941,14 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_ /* use this to force single objects at a time, which is useful * for working out what object is giving problems */ - max_objects = lp_parm_int(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "max object sync", 1000); + max_objects = lpcfg_parm_int(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "max object sync", 1000); if (req8->max_object_count < max_objects) { max_objects = req8->max_object_count; } /* * TODO: work out how the maximum should be calculated */ - max_links = lp_parm_int(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "max link sync", 1500); + max_links = lpcfg_parm_int(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "max link sync", 1500); for(i=getnc_state->num_sent; isite_res->count && @@ -1021,7 +1021,7 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_ ureq.naming_context = ncRoot; ureq.dest_dsa_dns_name = talloc_asprintf(mem_ctx, "%s._msdcs.%s", GUID_string(mem_ctx, &req8->destination_dsa_guid), - lp_realm(dce_call->conn->dce_ctx->lp_ctx)); + lpcfg_realm(dce_call->conn->dce_ctx->lp_ctx)); if (!ureq.dest_dsa_dns_name) { return WERR_NOMEM; } diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c index 3f5c9ff870..37e807bfe9 100644 --- a/source4/rpc_server/lsa/dcesrv_lsa.c +++ b/source4/rpc_server/lsa/dcesrv_lsa.c @@ -410,7 +410,7 @@ static WERROR dcesrv_dssetup_DsRoleGetPrimaryDomainInformation(struct dcesrv_cal ZERO_STRUCT(domain_guid); - switch (lp_server_role(dce_call->conn->dce_ctx->lp_ctx)) { + switch (lpcfg_server_role(dce_call->conn->dce_ctx->lp_ctx)) { case ROLE_STANDALONE: role = DS_ROLE_STANDALONE_SERVER; break; @@ -426,13 +426,13 @@ static WERROR dcesrv_dssetup_DsRoleGetPrimaryDomainInformation(struct dcesrv_cal break; } - switch (lp_server_role(dce_call->conn->dce_ctx->lp_ctx)) { + switch (lpcfg_server_role(dce_call->conn->dce_ctx->lp_ctx)) { case ROLE_STANDALONE: - domain = talloc_strdup(mem_ctx, lp_workgroup(dce_call->conn->dce_ctx->lp_ctx)); + domain = talloc_strdup(mem_ctx, lpcfg_workgroup(dce_call->conn->dce_ctx->lp_ctx)); W_ERROR_HAVE_NO_MEMORY(domain); break; case ROLE_DOMAIN_MEMBER: - domain = talloc_strdup(mem_ctx, lp_workgroup(dce_call->conn->dce_ctx->lp_ctx)); + domain = talloc_strdup(mem_ctx, lpcfg_workgroup(dce_call->conn->dce_ctx->lp_ctx)); W_ERROR_HAVE_NO_MEMORY(domain); /* TODO: what is with dns_domain and forest and guid? */ break; @@ -2901,7 +2901,7 @@ static NTSTATUS dcesrv_lsa_CreateSecret(struct dcesrv_call_state *dce_call, TALL name = &r->in.name.string[2]; /* We need to connect to the database as system, as this is one of the rare RPC calls that must read the secrets (and this is denied otherwise) */ secret_state->sam_ldb = talloc_reference(secret_state, - samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, system_session(dce_call->conn->dce_ctx->lp_ctx))); + samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, system_session(dce_call->conn->dce_ctx->lp_ctx))); secret_state->global = true; if (strlen(name) < 1) { @@ -3038,7 +3038,7 @@ static NTSTATUS dcesrv_lsa_OpenSecret(struct dcesrv_call_state *dce_call, TALLOC name = &r->in.name.string[2]; /* We need to connect to the database as system, as this is one of the rare RPC calls that must read the secrets (and this is denied otherwise) */ secret_state->sam_ldb = talloc_reference(secret_state, - samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, system_session(dce_call->conn->dce_ctx->lp_ctx))); + samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, system_session(dce_call->conn->dce_ctx->lp_ctx))); secret_state->global = true; if (strlen(name) < 1) { diff --git a/source4/rpc_server/lsa/lsa_init.c b/source4/rpc_server/lsa/lsa_init.c index 486faaacf1..deb73c2980 100644 --- a/source4/rpc_server/lsa/lsa_init.c +++ b/source4/rpc_server/lsa/lsa_init.c @@ -43,7 +43,7 @@ NTSTATUS dcesrv_lsa_get_policy_state(struct dcesrv_call_state *dce_call, TALLOC_ } /* make sure the sam database is accessible */ - state->sam_ldb = samdb_connect(state, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, dce_call->conn->auth_state.session_info); + state->sam_ldb = samdb_connect(state, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, dce_call->conn->auth_state.session_info); if (state->sam_ldb == NULL) { return NT_STATUS_INVALID_SYSTEM_SERVICE; } @@ -88,7 +88,7 @@ NTSTATUS dcesrv_lsa_get_policy_state(struct dcesrv_call_state *dce_call, TALLOC_ talloc_free(dom_res); - state->domain_name = lp_sam_name(dce_call->conn->dce_ctx->lp_ctx); + state->domain_name = lpcfg_sam_name(dce_call->conn->dce_ctx->lp_ctx); state->domain_dns = ldb_dn_canonical_string(state, state->domain_dn); if (!state->domain_dns) { diff --git a/source4/rpc_server/lsa/lsa_lookup.c b/source4/rpc_server/lsa/lsa_lookup.c index 11a6750a8a..d024ea0dd2 100644 --- a/source4/rpc_server/lsa/lsa_lookup.c +++ b/source4/rpc_server/lsa/lsa_lookup.c @@ -808,7 +808,7 @@ NTSTATUS dcesrv_lsa_LookupNames3(struct dcesrv_call_state *dce_call, r->out.sids->sids[i].sid_index = 0xFFFFFFFF; r->out.sids->sids[i].flags = 0; - status2 = dcesrv_lsa_lookup_name(dce_call->event_ctx, lp_ctx, policy_state, mem_ctx, name, + status2 = dcesrv_lsa_lookup_name(dce_call->event_ctx, lp_ctx, policy_state, mem_ctx, name, &authority_name, &sid, &rtype, &rid); if (!NT_STATUS_IS_OK(status2) || sid->num_auths == 0) { continue; @@ -953,7 +953,7 @@ NTSTATUS dcesrv_lsa_LookupNames2(struct dcesrv_call_state *dce_call, r->out.sids->sids[i].sid_index = 0xFFFFFFFF; r->out.sids->sids[i].unknown = 0; - status2 = dcesrv_lsa_lookup_name(dce_call->event_ctx, lp_ctx, state, mem_ctx, name, + status2 = dcesrv_lsa_lookup_name(dce_call->event_ctx, lp_ctx, state, mem_ctx, name, &authority_name, &sid, &rtype, &rid); if (!NT_STATUS_IS_OK(status2)) { continue; diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 28e517f0c9..1a765d93af 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -249,7 +249,7 @@ static NTSTATUS dcesrv_netr_ServerAuthenticate3(struct dcesrv_call_state *dce_ca creds->sid = samdb_result_dom_sid(creds, msgs[0], "objectSid"); nt_status = schannel_save_creds_state(mem_ctx, - lp_private_dir(dce_call->conn->dce_ctx->lp_ctx), + lpcfg_private_dir(dce_call->conn->dce_ctx->lp_ctx), creds); return nt_status; @@ -349,7 +349,7 @@ static NTSTATUS dcesrv_netr_creds_server_step_check(struct dcesrv_call_state *dc { NTSTATUS nt_status; struct dcerpc_auth *auth_info = dce_call->conn->auth_state.auth_info; - bool schannel_global_required = false; /* Should be lp_schannel_server() == true */ + bool schannel_global_required = false; /* Should be lpcfg_schannel_server() == true */ if (schannel_global_required) { nt_status = schannel_check_required(auth_info, @@ -361,7 +361,7 @@ static NTSTATUS dcesrv_netr_creds_server_step_check(struct dcesrv_call_state *dc } nt_status = schannel_check_creds_state(mem_ctx, - lp_private_dir(dce_call->conn->dce_ctx->lp_ctx), + lpcfg_private_dir(dce_call->conn->dce_ctx->lp_ctx), computer_name, received_authenticator, return_authenticator, @@ -657,7 +657,7 @@ static NTSTATUS dcesrv_netr_LogonSamLogon_base(struct dcesrv_call_state *dce_cal sam6->sidcount = sam3->sidcount; sam6->sids = sam3->sids; - sam6->dns_domainname.string = lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx); + sam6->dns_domainname.string = lpcfg_dnsdomain(dce_call->conn->dce_ctx->lp_ctx); sam6->principle.string = talloc_asprintf(mem_ctx, "%s@%s", sam->account_name.string, sam6->dns_domainname.string); NT_STATUS_HAVE_NO_MEMORY(sam6->principle.string); @@ -712,7 +712,7 @@ static NTSTATUS dcesrv_netr_LogonSamLogonEx(struct dcesrv_call_state *dce_call, struct netlogon_creds_CredentialState *creds; nt_status = schannel_get_creds_state(mem_ctx, - lp_private_dir(dce_call->conn->dce_ctx->lp_ctx), + lpcfg_private_dir(dce_call->conn->dce_ctx->lp_ctx), r->in.computer_name, &creds); if (!NT_STATUS_IS_OK(nt_status)) { return nt_status; @@ -916,7 +916,7 @@ static WERROR dcesrv_netr_GetDcName(struct dcesrv_call_state *dce_call, TALLOC_C * - check all r->in.* parameters (server_unc is ignored by w2k3!) */ dcname = talloc_asprintf(mem_ctx, "\\\\%s", - lp_netbios_name(dce_call->conn->dce_ctx->lp_ctx)); + lpcfg_netbios_name(dce_call->conn->dce_ctx->lp_ctx)); W_ERROR_HAVE_NO_MEMORY(dcname); *r->out.dcname = dcname; @@ -1006,7 +1006,7 @@ static WERROR dcesrv_netr_GetAnyDCName(struct dcesrv_call_state *dce_call, TALLO if ((r->in.domainname == NULL) || (r->in.domainname[0] == '\0')) { /* if the domainname parameter wasn't set assume our domain */ - r->in.domainname = lp_workgroup(lp_ctx); + r->in.domainname = lpcfg_workgroup(lp_ctx); } sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx, @@ -1015,7 +1015,7 @@ static WERROR dcesrv_netr_GetAnyDCName(struct dcesrv_call_state *dce_call, TALLO return WERR_DS_UNAVAILABLE; } - if (strcasecmp(r->in.domainname, lp_workgroup(lp_ctx)) == 0) { + if (strcasecmp(r->in.domainname, lpcfg_workgroup(lp_ctx)) == 0) { /* well we asked for a DC of our own domain */ if (samdb_is_pdc(sam_ctx)) { /* we are the PDC of the specified domain */ @@ -1023,7 +1023,7 @@ static WERROR dcesrv_netr_GetAnyDCName(struct dcesrv_call_state *dce_call, TALLO } *r->out.dcname = talloc_asprintf(mem_ctx, "\\%s", - lp_netbios_name(lp_ctx)); + lpcfg_netbios_name(lp_ctx)); W_ERROR_HAVE_NO_MEMORY(*r->out.dcname); return WERR_OK; @@ -1188,8 +1188,8 @@ static NTSTATUS fill_one_domain_info(TALLOC_CTX *mem_ctx, } if (is_local) { - info->domainname.string = lp_workgroup(lp_ctx); - info->dns_domainname.string = lp_dnsdomain(lp_ctx); + info->domainname.string = lpcfg_workgroup(lp_ctx); + info->dns_domainname.string = lpcfg_dnsdomain(lp_ctx); info->domain_guid = samdb_result_guid(res, "objectGUID"); info->domain_sid = samdb_result_dom_sid(mem_ctx, res, "objectSid"); } else { @@ -1931,7 +1931,7 @@ static WERROR dcesrv_netr_DsrEnumerateDomainTrusts(struct dcesrv_call_state *dce struct ldb_message **dom_res; const char * const dom_attrs[] = { "objectSid", "objectGUID", NULL }; struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx; - const char *dnsdomain = lp_dnsdomain(lp_ctx); + const char *dnsdomain = lpcfg_dnsdomain(lp_ctx); const char *p; WERROR werr; @@ -1996,8 +1996,8 @@ static WERROR dcesrv_netr_DsrEnumerateDomainTrusts(struct dcesrv_call_state *dce trusts->count); W_ERROR_HAVE_NO_MEMORY(trusts->array); - trusts->array[n].netbios_name = lp_workgroup(lp_ctx); - trusts->array[n].dns_name = lp_dnsdomain(lp_ctx); + trusts->array[n].netbios_name = lpcfg_workgroup(lp_ctx); + trusts->array[n].dns_name = lpcfg_dnsdomain(lp_ctx); trusts->array[n].trust_flags = NETR_TRUST_FLAG_NATIVE | NETR_TRUST_FLAG_TREEROOT | @@ -2090,8 +2090,8 @@ static WERROR fill_forest_trust_array(TALLOC_CTX *mem_ctx, domain_info = &e->forest_trust_data.domain_info; domain_info->domain_sid = samdb_result_dom_sid(info, dom_res[0], "objectSid"); - domain_info->dns_domain_name.string = lp_dnsdomain(lp_ctx); - domain_info->netbios_domain_name.string = lp_workgroup(lp_ctx); + domain_info->dns_domain_name.string = lpcfg_dnsdomain(lp_ctx); + domain_info->netbios_domain_name.string = lpcfg_workgroup(lp_ctx); info->entries[1] = e; diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c index 052160329d..7ba39462fd 100644 --- a/source4/rpc_server/remote/dcesrv_remote.c +++ b/source4/rpc_server/remote/dcesrv_remote.c @@ -42,7 +42,7 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct NTSTATUS status; const struct ndr_interface_table *table; struct dcesrv_remote_private *priv; - const char *binding = lp_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "binding"); + const char *binding = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "binding"); const char *user, *pass, *domain; struct cli_credentials *credentials; bool must_free_credentials = true; @@ -50,7 +50,7 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct struct dcerpc_binding *b; struct composite_context *pipe_conn_req; - machine_account = lp_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "use_machine_account", false); + machine_account = lpcfg_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "use_machine_account", false); priv = talloc(dce_call->conn, struct dcesrv_remote_private); if (!priv) { @@ -65,9 +65,9 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct return NT_STATUS_INVALID_PARAMETER; } - user = lp_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "user"); - pass = lp_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "password"); - domain = lp_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dceprc_remote", "domain"); + user = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "user"); + pass = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "password"); + domain = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dceprc_remote", "domain"); table = ndr_table_by_uuid(&iface->syntax_id.uuid); /* FIXME: What about if_version ? */ if (!table) { @@ -294,7 +294,7 @@ static NTSTATUS remote_register_one_iface(struct dcesrv_context *dce_ctx, const static NTSTATUS remote_op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server) { unsigned int i; - const char **ifaces = (const char **)str_list_make(dce_ctx, lp_parm_string(dce_ctx->lp_ctx, NULL, "dcerpc_remote", "interfaces"),NULL); + const char **ifaces = (const char **)str_list_make(dce_ctx, lpcfg_parm_string(dce_ctx->lp_ctx, NULL, "dcerpc_remote", "interfaces"),NULL); if (!ifaces) { DEBUG(3,("remote_op_init_server: no interfaces configured\n")); diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index cca828aa17..e222a41d26 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -173,7 +173,7 @@ static NTSTATUS dcesrv_samr_Connect(struct dcesrv_call_state *dce_call, TALLOC_C } /* make sure the sam database is accessible */ - c_state->sam_ctx = samdb_connect(c_state, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, dce_call->conn->auth_state.session_info); + c_state->sam_ctx = samdb_connect(c_state, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, dce_call->conn->auth_state.session_info); if (c_state->sam_ctx == NULL) { talloc_free(c_state); return NT_STATUS_INVALID_SYSTEM_SERVICE; @@ -293,7 +293,7 @@ static NTSTATUS dcesrv_samr_LookupDomain(struct dcesrv_call_state *dce_call, TAL ret = gendb_search(c_state->sam_ctx, mem_ctx, NULL, &dom_msgs, dom_attrs, "(objectClass=builtinDomain)"); - } else if (strcasecmp_m(r->in.domain_name->string, lp_sam_name(dce_call->conn->dce_ctx->lp_ctx)) == 0) { + } else if (strcasecmp_m(r->in.domain_name->string, lpcfg_sam_name(dce_call->conn->dce_ctx->lp_ctx)) == 0) { ret = gendb_search_dn(c_state->sam_ctx, mem_ctx, ldb_get_default_basedn(c_state->sam_ctx), &dom_msgs, dom_attrs); @@ -363,7 +363,7 @@ static NTSTATUS dcesrv_samr_EnumDomains(struct dcesrv_call_state *dce_call, TALL for (i=0;i<2-start_i;i++) { array->entries[i].idx = start_i + i; if (i == 0) { - array->entries[i].name.string = lp_sam_name(dce_call->conn->dce_ctx->lp_ctx); + array->entries[i].name.string = lpcfg_sam_name(dce_call->conn->dce_ctx->lp_ctx); } else { array->entries[i].name.string = "BUILTIN"; } @@ -412,7 +412,7 @@ static NTSTATUS dcesrv_samr_OpenDomain(struct dcesrv_call_state *dce_call, TALLO d_state->domain_name = "BUILTIN"; } else { d_state->builtin = false; - d_state->domain_name = lp_sam_name(dce_call->conn->dce_ctx->lp_ctx); + d_state->domain_name = lpcfg_sam_name(dce_call->conn->dce_ctx->lp_ctx); } ret = gendb_search(c_state->sam_ctx, @@ -433,7 +433,7 @@ static NTSTATUS dcesrv_samr_OpenDomain(struct dcesrv_call_state *dce_call, TALLO } d_state->domain_dn = talloc_steal(d_state, dom_msgs[0]->dn); - d_state->role = lp_server_role(dce_call->conn->dce_ctx->lp_ctx); + d_state->role = lpcfg_server_role(dce_call->conn->dce_ctx->lp_ctx); d_state->connect_state = talloc_reference(d_state, c_state); d_state->sam_ctx = c_state->sam_ctx; d_state->access_mask = r->in.access_mask; @@ -489,7 +489,7 @@ static NTSTATUS dcesrv_samr_info_DomGeneralInformation(struct samr_domain_state info->primary.string = samdb_result_fsmo_name(state->sam_ctx, mem_ctx, dom_msgs[0], "fSMORoleOwner"); if (!info->primary.string) { - info->primary.string = lp_netbios_name(state->lp_ctx); + info->primary.string = lpcfg_netbios_name(state->lp_ctx); } info->force_logoff_time = ldb_msg_find_attr_as_uint64(dom_msgs[0], "forceLogoff", @@ -587,7 +587,7 @@ static NTSTATUS dcesrv_samr_info_DomInfo6(struct samr_domain_state *state, dom_msgs[0], "fSMORoleOwner"); if (!info->primary.string) { - info->primary.string = lp_netbios_name(state->lp_ctx); + info->primary.string = lpcfg_netbios_name(state->lp_ctx); } return NT_STATUS_OK; diff --git a/source4/rpc_server/samr/samr_password.c b/source4/rpc_server/samr/samr_password.c index ff247815a5..f7aa376501 100644 --- a/source4/rpc_server/samr/samr_password.c +++ b/source4/rpc_server/samr/samr_password.c @@ -183,7 +183,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, } /* this call can only work with lanman auth */ - if (!lp_lanman_auth(dce_call->conn->dce_ctx->lp_ctx)) { + if (!lpcfg_lanman_auth(dce_call->conn->dce_ctx->lp_ctx)) { return NT_STATUS_WRONG_PASSWORD; } @@ -232,7 +232,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, return NT_STATUS_WRONG_PASSWORD; } - if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), + if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), CH_DOS, CH_UNIX, (const char *)new_password.data, new_password.length, @@ -242,7 +242,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, return NT_STATUS_WRONG_PASSWORD; } - if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), + if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), CH_DOS, CH_UTF16, (const char *)new_password.data, new_password.length, @@ -345,7 +345,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call, user_dn = res[0]->dn; - status = samdb_result_passwords(mem_ctx, dce_call->conn->dce_ctx->lp_ctx, + status = samdb_result_passwords(mem_ctx, dce_call->conn->dce_ctx->lp_ctx, res[0], &lm_pwd, &nt_pwd); if (!NT_STATUS_IS_OK(status) ) { goto failed; @@ -386,7 +386,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call, * this) */ if (lm_pwd && r->in.lm_verifier != NULL) { char *new_pass; - if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), + if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), CH_UTF16, CH_UNIX, (const char *)new_password.data, new_password.length, diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c index 8c52c2c122..6be3fe9029 100644 --- a/source4/rpc_server/service_rpc.c +++ b/source4/rpc_server/service_rpc.c @@ -477,7 +477,7 @@ static NTSTATUS dcesrv_add_ep_unix(struct dcesrv_context *dce_ctx, status = stream_setup_socket(event_ctx, lp_ctx, model_ops, &dcesrv_stream_ops, "unix", e->ep_description->endpoint, &port, - lp_socket_options(lp_ctx), + lpcfg_socket_options(lp_ctx), dcesrv_sock); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("service_setup_stream_socket(path=%s) failed - %s\n", @@ -504,7 +504,7 @@ static NTSTATUS dcesrv_add_ep_ncalrpc(struct dcesrv_context *dce_ctx, e->ep_description->endpoint = talloc_strdup(dce_ctx, "DEFAULT"); } - full_path = talloc_asprintf(dce_ctx, "%s/%s", lp_ncalrpc_dir(lp_ctx), + full_path = talloc_asprintf(dce_ctx, "%s/%s", lpcfg_ncalrpc_dir(lp_ctx), e->ep_description->endpoint); dcesrv_sock = talloc(event_ctx, struct dcesrv_socket_context); @@ -517,7 +517,7 @@ static NTSTATUS dcesrv_add_ep_ncalrpc(struct dcesrv_context *dce_ctx, status = stream_setup_socket(event_ctx, lp_ctx, model_ops, &dcesrv_stream_ops, "unix", full_path, &port, - lp_socket_options(lp_ctx), + lpcfg_socket_options(lp_ctx), dcesrv_sock); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("service_setup_stream_socket(identifier=%s,path=%s) failed - %s\n", @@ -584,7 +584,7 @@ static NTSTATUS add_socket_rpc_tcp_iface(struct dcesrv_context *dce_ctx, struct status = stream_setup_socket(event_ctx, dce_ctx->lp_ctx, model_ops, &dcesrv_stream_ops, "ipv4", address, &port, - lp_socket_options(dce_ctx->lp_ctx), + lpcfg_socket_options(dce_ctx->lp_ctx), dcesrv_sock); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("service_setup_stream_socket(address=%s,port=%u) failed - %s\n", @@ -606,12 +606,12 @@ static NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, NTSTATUS status; /* Add TCP/IP sockets */ - if (lp_interfaces(lp_ctx) && lp_bind_interfaces_only(lp_ctx)) { + if (lpcfg_interfaces(lp_ctx) && lpcfg_bind_interfaces_only(lp_ctx)) { int num_interfaces; int i; struct interface *ifaces; - load_interfaces(dce_ctx, lp_interfaces(lp_ctx), &ifaces); + load_interfaces(dce_ctx, lpcfg_interfaces(lp_ctx), &ifaces); num_interfaces = iface_count(ifaces); for(i = 0; i < num_interfaces; i++) { @@ -621,7 +621,7 @@ static NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, } } else { status = add_socket_rpc_tcp_iface(dce_ctx, e, event_ctx, model_ops, - lp_socket_address(lp_ctx)); + lpcfg_socket_address(lp_ctx)); NT_STATUS_NOT_OK_RETURN(status); } @@ -673,13 +673,13 @@ static void dcesrv_task_init(struct task_server *task) status = dcesrv_init_context(task->event_ctx, task->lp_ctx, - lp_dcerpc_endpoint_servers(task->lp_ctx), + lpcfg_dcerpc_endpoint_servers(task->lp_ctx), &dce_ctx); if (!NT_STATUS_IS_OK(status)) goto failed; /* Make sure the directory for NCALRPC exists */ - if (!directory_exist(lp_ncalrpc_dir(task->lp_ctx))) { - mkdir(lp_ncalrpc_dir(task->lp_ctx), 0755); + if (!directory_exist(lpcfg_ncalrpc_dir(task->lp_ctx))) { + mkdir(lpcfg_ncalrpc_dir(task->lp_ctx), 0755); } for (e=dce_ctx->endpoint_list;e;e=e->next) { diff --git a/source4/rpc_server/spoolss/dcesrv_spoolss.c b/source4/rpc_server/spoolss/dcesrv_spoolss.c index f6212da250..e17fb812f4 100644 --- a/source4/rpc_server/spoolss/dcesrv_spoolss.c +++ b/source4/rpc_server/spoolss/dcesrv_spoolss.c @@ -174,10 +174,10 @@ static WERROR dcesrv_spoolss_check_server_name(struct dcesrv_call_state *dce_cal server_name += 2; /* NETBIOS NAME is ok */ - ret = strequal(lp_netbios_name(dce_call->conn->dce_ctx->lp_ctx), server_name); + ret = strequal(lpcfg_netbios_name(dce_call->conn->dce_ctx->lp_ctx), server_name); if (ret) return WERR_OK; - aliases = lp_netbios_aliases(dce_call->conn->dce_ctx->lp_ctx); + aliases = lpcfg_netbios_aliases(dce_call->conn->dce_ctx->lp_ctx); for (i=0; aliases && aliases[i]; i++) { if (strequal(aliases[i], server_name)) { @@ -188,12 +188,12 @@ static WERROR dcesrv_spoolss_check_server_name(struct dcesrv_call_state *dce_cal /* DNS NAME is ok * TODO: we need to check if aliases are also ok */ - dnsdomain = lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx); + dnsdomain = lpcfg_dnsdomain(dce_call->conn->dce_ctx->lp_ctx); if (dnsdomain != NULL) { char *str; str = talloc_asprintf(mem_ctx, "%s.%s", - lp_netbios_name(dce_call->conn->dce_ctx->lp_ctx), + lpcfg_netbios_name(dce_call->conn->dce_ctx->lp_ctx), dnsdomain); W_ERROR_HAVE_NO_MEMORY(str); @@ -220,7 +220,7 @@ static NTSTATUS dcerpc_spoolss_bind(struct dcesrv_call_state *dce_call, const st struct ntptr_context *ntptr; status = ntptr_init_context(dce_call->context, dce_call->conn->event_ctx, dce_call->conn->dce_ctx->lp_ctx, - lp_ntptr_providor(dce_call->conn->dce_ctx->lp_ctx), &ntptr); + lpcfg_ntptr_providor(dce_call->conn->dce_ctx->lp_ctx), &ntptr); NT_STATUS_NOT_OK_RETURN(status); dce_call->context->private_data = ntptr; @@ -1191,7 +1191,7 @@ static WERROR dcesrv_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct dcesrv_ } ZERO_STRUCT(rop); - rop.in.server_name = lp_netbios_name(dce_call->conn->dce_ctx->lp_ctx); + rop.in.server_name = lpcfg_netbios_name(dce_call->conn->dce_ctx->lp_ctx); W_ERROR_HAVE_NO_MEMORY(rop.in.server_name); rop.in.printer_local = 0; rop.in.type = REG_NONE; diff --git a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c index f86a500a97..cf3651780d 100644 --- a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c +++ b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c @@ -416,7 +416,7 @@ static WERROR dcesrv_srvsvc_NetShareAdd(struct dcesrv_call_state *dce_call, TALL unsigned int count = 8; unsigned int i; - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); + nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -514,7 +514,7 @@ static WERROR dcesrv_srvsvc_NetShareAdd(struct dcesrv_call_state *dce_call, TALL unsigned int count = 10; unsigned int i; - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); + nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -698,7 +698,7 @@ static WERROR dcesrv_srvsvc_NetShareEnumAll(struct dcesrv_call_state *dce_call, /* TODO: - paging of results */ - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); + nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -949,7 +949,7 @@ static WERROR dcesrv_srvsvc_NetShareGetInfo(struct dcesrv_call_state *dce_call, return WERR_INVALID_PARAM; } - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); + nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -1199,7 +1199,7 @@ static WERROR dcesrv_srvsvc_NetShareSetInfo(struct dcesrv_call_state *dce_call, return WERR_INVALID_PARAM; } - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); + nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -1377,7 +1377,7 @@ static WERROR dcesrv_srvsvc_NetShareCheck(struct dcesrv_call_state *dce_call, TA } all_string_sub(device, "\\", "/", 0); - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); + nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -1430,7 +1430,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA struct srvsvc_NetSrvGetInfo *r) { struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx; - struct dcerpc_server_info *server_info = lp_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx); + struct dcerpc_server_info *server_info = lpcfg_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx); ZERO_STRUCTP(r->out.info); @@ -1463,7 +1463,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA info101->version_major = server_info->version_major; info101->version_minor = server_info->version_minor; info101->server_type = dcesrv_common_get_server_type(mem_ctx, dce_call->event_ctx, dce_ctx); - info101->comment = talloc_strdup(mem_ctx, lp_serverstring(dce_ctx->lp_ctx)); + info101->comment = talloc_strdup(mem_ctx, lpcfg_serverstring(dce_ctx->lp_ctx)); W_ERROR_HAVE_NO_MEMORY(info101->comment); r->out.info->info101 = info101; @@ -1483,7 +1483,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA info102->version_major = server_info->version_major; info102->version_minor = server_info->version_minor; info102->server_type = dcesrv_common_get_server_type(mem_ctx, dce_call->event_ctx, dce_ctx); - info102->comment = talloc_strdup(mem_ctx, lp_serverstring(dce_ctx->lp_ctx)); + info102->comment = talloc_strdup(mem_ctx, lpcfg_serverstring(dce_ctx->lp_ctx)); W_ERROR_HAVE_NO_MEMORY(info102->comment); info102->users = dcesrv_common_get_users(mem_ctx, dce_ctx); @@ -1785,7 +1785,7 @@ static WERROR dcesrv_srvsvc_NetShareEnum(struct dcesrv_call_state *dce_call, TAL /* TODO: - paging of results */ - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); + nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -2250,7 +2250,7 @@ static WERROR dcesrv_srvsvc_NetShareDel(struct dcesrv_call_state *dce_call, TALL NTSTATUS nterr; struct share_context *sctx; - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); + nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } diff --git a/source4/rpc_server/srvsvc/srvsvc_ntvfs.c b/source4/rpc_server/srvsvc/srvsvc_ntvfs.c index da1a65047c..7a513d894a 100644 --- a/source4/rpc_server/srvsvc/srvsvc_ntvfs.c +++ b/source4/rpc_server/srvsvc/srvsvc_ntvfs.c @@ -49,7 +49,7 @@ NTSTATUS srvsvc_create_ntvfs_context(struct dcesrv_call_state *dce_call, const struct tsocket_address *local_address; const struct tsocket_address *remote_address; - status = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); + status = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(status)) { return status; } diff --git a/source4/rpc_server/wkssvc/dcesrv_wkssvc.c b/source4/rpc_server/wkssvc/dcesrv_wkssvc.c index f680ee8316..b4fa69c43f 100644 --- a/source4/rpc_server/wkssvc/dcesrv_wkssvc.c +++ b/source4/rpc_server/wkssvc/dcesrv_wkssvc.c @@ -32,7 +32,7 @@ static WERROR dcesrv_wkssvc_NetWkstaGetInfo(struct dcesrv_call_state *dce_call, struct wkssvc_NetWkstaGetInfo *r) { struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx; - struct dcerpc_server_info *server_info = lp_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx); + struct dcerpc_server_info *server_info = lpcfg_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx); /* NOTE: win2k3 ignores r->in.server_name completly so we do --metze */ diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c index b76cf685de..5de024c430 100644 --- a/source4/scripting/python/pyglue.c +++ b/source4/scripting/python/pyglue.c @@ -133,14 +133,14 @@ static PyObject *py_interface_ips(PyObject *self, PyObject *args) tmp_ctx = talloc_new(NULL); - lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ + lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */ if (lp_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "Expected loadparm object"); talloc_free(tmp_ctx); return NULL; } - load_interfaces(tmp_ctx, lp_interfaces(lp_ctx), &ifaces); + load_interfaces(tmp_ctx, lpcfg_interfaces(lp_ctx), &ifaces); count = iface_count(ifaces); diff --git a/source4/smb_server/smb/negprot.c b/source4/smb_server/smb/negprot.c index fe6cd68f6e..656da4df20 100644 --- a/source4/smb_server/smb/negprot.c +++ b/source4/smb_server/smb/negprot.c @@ -88,7 +88,7 @@ this any more it probably doesn't matter ****************************************************************************/ static void reply_coreplus(struct smbsrv_request *req, uint16_t choice) { - uint16_t raw = (lp_readraw(req->smb_conn->lp_ctx)?1:0) | (lp_writeraw(req->smb_conn->lp_ctx)?2:0); + uint16_t raw = (lpcfg_readraw(req->smb_conn->lp_ctx)?1:0) | (lpcfg_writeraw(req->smb_conn->lp_ctx)?2:0); smbsrv_setup_reply(req, 13, 0); @@ -119,13 +119,13 @@ static void reply_coreplus(struct smbsrv_request *req, uint16_t choice) ****************************************************************************/ static void reply_lanman1(struct smbsrv_request *req, uint16_t choice) { - int raw = (lp_readraw(req->smb_conn->lp_ctx)?1:0) | (lp_writeraw(req->smb_conn->lp_ctx)?2:0); + int raw = (lpcfg_readraw(req->smb_conn->lp_ctx)?1:0) | (lpcfg_writeraw(req->smb_conn->lp_ctx)?2:0); int secword=0; time_t t = req->request_time.tv_sec; - req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(req->smb_conn->lp_ctx); + req->smb_conn->negotiate.encrypted_passwords = lpcfg_encrypted_passwords(req->smb_conn->lp_ctx); - if (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE) + if (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE) secword |= NEGOTIATE_SECURITY_USER_LEVEL; if (req->smb_conn->negotiate.encrypted_passwords) @@ -142,7 +142,7 @@ static void reply_lanman1(struct smbsrv_request *req, uint16_t choice) SSVAL(req->out.vwv, VWV(0), choice); SSVAL(req->out.vwv, VWV(1), secword); SSVAL(req->out.vwv, VWV(2), req->smb_conn->negotiate.max_recv); - SSVAL(req->out.vwv, VWV(3), lp_maxmux(req->smb_conn->lp_ctx)); + SSVAL(req->out.vwv, VWV(3), lpcfg_maxmux(req->smb_conn->lp_ctx)); SSVAL(req->out.vwv, VWV(4), 1); SSVAL(req->out.vwv, VWV(5), raw); SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id.id); @@ -177,13 +177,13 @@ static void reply_lanman1(struct smbsrv_request *req, uint16_t choice) ****************************************************************************/ static void reply_lanman2(struct smbsrv_request *req, uint16_t choice) { - int raw = (lp_readraw(req->smb_conn->lp_ctx)?1:0) | (lp_writeraw(req->smb_conn->lp_ctx)?2:0); + int raw = (lpcfg_readraw(req->smb_conn->lp_ctx)?1:0) | (lpcfg_writeraw(req->smb_conn->lp_ctx)?2:0); int secword=0; time_t t = req->request_time.tv_sec; - req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(req->smb_conn->lp_ctx); + req->smb_conn->negotiate.encrypted_passwords = lpcfg_encrypted_passwords(req->smb_conn->lp_ctx); - if (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE) + if (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE) secword |= NEGOTIATE_SECURITY_USER_LEVEL; if (req->smb_conn->negotiate.encrypted_passwords) @@ -196,7 +196,7 @@ static void reply_lanman2(struct smbsrv_request *req, uint16_t choice) SSVAL(req->out.vwv, VWV(0), choice); SSVAL(req->out.vwv, VWV(1), secword); SSVAL(req->out.vwv, VWV(2), req->smb_conn->negotiate.max_recv); - SSVAL(req->out.vwv, VWV(3), lp_maxmux(req->smb_conn->lp_ctx)); + SSVAL(req->out.vwv, VWV(3), lpcfg_maxmux(req->smb_conn->lp_ctx)); SSVAL(req->out.vwv, VWV(4), 1); SSVAL(req->out.vwv, VWV(5), raw); SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id.id); @@ -211,7 +211,7 @@ static void reply_lanman2(struct smbsrv_request *req, uint16_t choice) get_challenge(req->smb_conn, req->out.data); } - req_push_str(req, NULL, lp_workgroup(req->smb_conn->lp_ctx), -1, STR_TERMINATE); + req_push_str(req, NULL, lpcfg_workgroup(req->smb_conn->lp_ctx), -1, STR_TERMINATE); if (req->smb_conn->signing.mandatory_signing) { smbsrv_terminate_connection(req->smb_conn, @@ -233,8 +233,8 @@ static void reply_nt1_orig(struct smbsrv_request *req) req->out.ptr += 8; SCVAL(req->out.vwv+1, VWV(16), 8); } - req_push_str(req, NULL, lp_workgroup(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN); - req_push_str(req, NULL, lp_netbios_name(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN); + req_push_str(req, NULL, lpcfg_workgroup(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN); + req_push_str(req, NULL, lpcfg_netbios_name(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN); DEBUG(3,("not using extended security (SPNEGO or NTLMSSP)\n")); } @@ -257,24 +257,24 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice) CAP_NT_FIND | CAP_LOCK_AND_READ | CAP_LEVEL_II_OPLOCKS | CAP_NT_SMBS | CAP_RPC_REMOTE_APIS; - req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(req->smb_conn->lp_ctx); + req->smb_conn->negotiate.encrypted_passwords = lpcfg_encrypted_passwords(req->smb_conn->lp_ctx); /* do spnego in user level security if the client supports it and we can do encrypted passwords */ if (req->smb_conn->negotiate.encrypted_passwords && - (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE) && - lp_use_spnego(req->smb_conn->lp_ctx) && + (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE) && + lpcfg_use_spnego(req->smb_conn->lp_ctx) && (req->flags2 & FLAGS2_EXTENDED_SECURITY)) { negotiate_spnego = true; capabilities |= CAP_EXTENDED_SECURITY; } - if (lp_unix_extensions(req->smb_conn->lp_ctx)) { + if (lpcfg_unix_extensions(req->smb_conn->lp_ctx)) { capabilities |= CAP_UNIX; } - if (lp_large_readwrite(req->smb_conn->lp_ctx)) { + if (lpcfg_large_readwrite(req->smb_conn->lp_ctx)) { capabilities |= CAP_LARGE_READX | CAP_LARGE_WRITEX | CAP_W2K_SMBS; } @@ -283,25 +283,25 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice) capabilities |= CAP_LARGE_FILES; } - if (lp_readraw(req->smb_conn->lp_ctx) && - lp_writeraw(req->smb_conn->lp_ctx)) { + if (lpcfg_readraw(req->smb_conn->lp_ctx) && + lpcfg_writeraw(req->smb_conn->lp_ctx)) { capabilities |= CAP_RAW_MODE; } /* allow for disabling unicode */ - if (lp_unicode(req->smb_conn->lp_ctx)) { + if (lpcfg_unicode(req->smb_conn->lp_ctx)) { capabilities |= CAP_UNICODE; } - if (lp_nt_status_support(req->smb_conn->lp_ctx)) { + if (lpcfg_nt_status_support(req->smb_conn->lp_ctx)) { capabilities |= CAP_STATUS32; } - if (lp_host_msdfs(req->smb_conn->lp_ctx)) { + if (lpcfg_host_msdfs(req->smb_conn->lp_ctx)) { capabilities |= CAP_DFS; } - if (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE) { + if (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE) { secword |= NEGOTIATE_SECURITY_USER_LEVEL; } @@ -328,7 +328,7 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice) this is the one and only SMB packet that is malformed in the specification - all the command words after the secword are offset by 1 byte */ - SSVAL(req->out.vwv+1, VWV(1), lp_maxmux(req->smb_conn->lp_ctx)); + SSVAL(req->out.vwv+1, VWV(1), lpcfg_maxmux(req->smb_conn->lp_ctx)); SSVAL(req->out.vwv+1, VWV(2), 1); /* num vcs */ SIVAL(req->out.vwv+1, VWV(3), req->smb_conn->negotiate.max_recv); SIVAL(req->out.vwv+1, VWV(5), 0x10000); /* raw size. full 64k */ @@ -518,9 +518,9 @@ void smbsrv_reply_negprot(struct smbsrv_request *req) for (protocol = 0; supported_protocols[protocol].proto_name; protocol++) { int i; - if (supported_protocols[protocol].protocol_level > lp_srv_maxprotocol(req->smb_conn->lp_ctx)) + if (supported_protocols[protocol].protocol_level > lpcfg_srv_maxprotocol(req->smb_conn->lp_ctx)) continue; - if (supported_protocols[protocol].protocol_level < lp_srv_minprotocol(req->smb_conn->lp_ctx)) + if (supported_protocols[protocol].protocol_level < lpcfg_srv_minprotocol(req->smb_conn->lp_ctx)) continue; for (i = 0; i < protos_count; i++) { diff --git a/source4/smb_server/smb/receive.c b/source4/smb_server/smb/receive.c index f58071bf55..c2503efabc 100644 --- a/source4/smb_server/smb/receive.c +++ b/source4/smb_server/smb/receive.c @@ -663,12 +663,12 @@ NTSTATUS smbsrv_init_smb_connection(struct smbsrv_connection *smb_conn, struct l /* this is the size that w2k uses, and it appears to be important for good performance */ - smb_conn->negotiate.max_recv = lp_max_xmit(lp_ctx); + smb_conn->negotiate.max_recv = lpcfg_max_xmit(lp_ctx); smb_conn->negotiate.zone_offset = get_time_zone(time(NULL)); - smb_conn->config.security = lp_security(lp_ctx); - smb_conn->config.nt_status_support = lp_nt_status_support(lp_ctx); + smb_conn->config.security = lpcfg_security(lp_ctx); + smb_conn->config.nt_status_support = lpcfg_nt_status_support(lp_ctx); status = smbsrv_init_sessions(smb_conn, UINT16_MAX); NT_STATUS_NOT_OK_RETURN(status); diff --git a/source4/smb_server/smb/service.c b/source4/smb_server/smb/service.c index 4d5b6ff462..7be21c14bd 100644 --- a/source4/smb_server/smb/service.c +++ b/source4/smb_server/smb/service.c @@ -191,7 +191,7 @@ NTSTATUS smbsrv_tcon_backend(struct smbsrv_request *req, union smb_tcon *con) con->tconx.out.tid = req->tcon->tid; con->tconx.out.options = SMB_SUPPORT_SEARCH_BITS | (share_int_option(req->tcon->ntvfs->config, SHARE_CSC_POLICY, SHARE_CSC_POLICY_DEFAULT) << 2); - if (share_bool_option(req->tcon->ntvfs->config, SHARE_MSDFS_ROOT, SHARE_MSDFS_ROOT_DEFAULT) && lp_host_msdfs(req->smb_conn->lp_ctx)) { + if (share_bool_option(req->tcon->ntvfs->config, SHARE_MSDFS_ROOT, SHARE_MSDFS_ROOT_DEFAULT) && lpcfg_host_msdfs(req->smb_conn->lp_ctx)) { con->tconx.out.options |= SMB_SHARE_IN_DFS; } diff --git a/source4/smb_server/smb/sesssetup.c b/source4/smb_server/smb/sesssetup.c index b61fce0887..7372347e9a 100644 --- a/source4/smb_server/smb/sesssetup.c +++ b/source4/smb_server/smb/sesssetup.c @@ -46,7 +46,7 @@ static void sesssetup_common_strings(struct smbsrv_request *req, (*os) = talloc_asprintf(req, "Unix"); (*lanman) = talloc_asprintf(req, "Samba %s", SAMBA_VERSION_STRING); (*domain) = talloc_asprintf(req, "%s", - lp_workgroup(req->smb_conn->lp_ctx)); + lpcfg_workgroup(req->smb_conn->lp_ctx)); } static void smbsrv_sesssetup_backend_send(struct smbsrv_request *req, diff --git a/source4/smb_server/smb/signing.c b/source4/smb_server/smb/signing.c index 0b5cf56fdb..94ea74681c 100644 --- a/source4/smb_server/smb/signing.c +++ b/source4/smb_server/smb/signing.c @@ -82,7 +82,7 @@ bool smbsrv_init_signing(struct smbsrv_connection *smb_conn) return false; } - switch (lp_server_signing(smb_conn->lp_ctx)) { + switch (lpcfg_server_signing(smb_conn->lp_ctx)) { case SMB_SIGNING_OFF: smb_conn->signing.allow_smb_signing = false; break; @@ -99,7 +99,7 @@ bool smbsrv_init_signing(struct smbsrv_connection *smb_conn) * attacks on communications between us and the * clients */ - if (lp_server_role(smb_conn->lp_ctx) == ROLE_DOMAIN_CONTROLLER) { + if (lpcfg_server_role(smb_conn->lp_ctx) == ROLE_DOMAIN_CONTROLLER) { smb_conn->signing.allow_smb_signing = true; smb_conn->signing.mandatory_signing = true; } else { diff --git a/source4/smb_server/smb/trans2.c b/source4/smb_server/smb/trans2.c index 42a217d19d..38381fd2c1 100644 --- a/source4/smb_server/smb/trans2.c +++ b/source4/smb_server/smb/trans2.c @@ -1215,8 +1215,8 @@ static NTSTATUS dodomain_referral(TALLOC_CTX *ctx, DATA_BLOB outblob; enum ndr_err_code ndr_err; NTSTATUS status; - const char *dns_domain = lp_dnsdomain(lp_ctx); - const char *netbios_domain = lp_workgroup(lp_ctx); + const char *dns_domain = lpcfg_dnsdomain(lp_ctx); + const char *netbios_domain = lpcfg_workgroup(lp_ctx); struct dfs_referral_resp resp; struct dfs_referral_type *tab; struct dfs_referral_type *referral; @@ -1226,7 +1226,7 @@ static NTSTATUS dodomain_referral(TALLOC_CTX *ctx, uint32_t current_pos = 0; TALLOC_CTX *context; - if (lp_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) { + if (lpcfg_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) { DEBUG(10 ,("Received a domain referral request on a non DC\n")); return NT_STATUS_INVALID_PARAMETER; } @@ -1372,8 +1372,8 @@ static NTSTATUS dodc_or_sysvol_referral(TALLOC_CTX *ctx, unsigned int num_domain = 1; enum ndr_err_code ndr_err; const char *requesteddomain; - const char *realm = lp_realm(lp_ctx); - const char *domain = lp_workgroup(lp_ctx); + const char *realm = lpcfg_realm(lp_ctx); + const char *domain = lpcfg_workgroup(lp_ctx); const char *site_name = NULL; /* Name of the site where the client is */ char *share = NULL; bool found = false; @@ -1387,7 +1387,7 @@ static NTSTATUS dodc_or_sysvol_referral(TALLOC_CTX *ctx, char *client_addr = NULL; TALLOC_CTX *context; - if (lp_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) { + if (lpcfg_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) { return NT_STATUS_INVALID_PARAMETER; } @@ -1613,7 +1613,7 @@ static NTSTATUS trans2_getdfsreferral(struct smbsrv_request *req, NTSTATUS status; lp_ctx = req->tcon->ntvfs->lp_ctx; - if (!lp_host_msdfs(lp_ctx)) { + if (!lpcfg_host_msdfs(lp_ctx)) { return NT_STATUS_NOT_IMPLEMENTED; } @@ -1651,8 +1651,8 @@ static NTSTATUS trans2_getdfsreferral(struct smbsrv_request *req, return dodomain_referral(op, &dfsreq, ldb, trans, lp_ctx); } - realm = lp_realm(lp_ctx); - nbname = lp_netbios_name(lp_ctx); + realm = lpcfg_realm(lp_ctx); + nbname = lpcfg_netbios_name(lp_ctx); fqdn = talloc_asprintf(context, "%s.%s", nbname, realm); if ((strncasecmp(requestedname+1, nbname, strlen(nbname)) == 0) || diff --git a/source4/smb_server/smb2/negprot.c b/source4/smb_server/smb2/negprot.c index 260822f2c5..da60676322 100644 --- a/source4/smb_server/smb2/negprot.c +++ b/source4/smb_server/smb2/negprot.c @@ -119,7 +119,7 @@ static NTSTATUS smb2srv_negprot_backend(struct smb2srv_request *req, struct smb2 boot_time = timeval_current(); /* TODO: fix me */ ZERO_STRUCT(io->out); - switch (lp_server_signing(req->smb_conn->lp_ctx)) { + switch (lpcfg_server_signing(req->smb_conn->lp_ctx)) { case SMB_SIGNING_OFF: io->out.security_mode = 0; break; @@ -135,11 +135,11 @@ static NTSTATUS smb2srv_negprot_backend(struct smb2srv_request *req, struct smb2 } io->out.dialect_revision = dialect; io->out.capabilities = 0; - io->out.max_transact_size = lp_parm_ulong(req->smb_conn->lp_ctx, NULL, + io->out.max_transact_size = lpcfg_parm_ulong(req->smb_conn->lp_ctx, NULL, "smb2", "max transaction size", 0x10000); - io->out.max_read_size = lp_parm_ulong(req->smb_conn->lp_ctx, NULL, + io->out.max_read_size = lpcfg_parm_ulong(req->smb_conn->lp_ctx, NULL, "smb2", "max read size", 0x10000); - io->out.max_write_size = lp_parm_ulong(req->smb_conn->lp_ctx, NULL, + io->out.max_write_size = lpcfg_parm_ulong(req->smb_conn->lp_ctx, NULL, "smb2", "max write size", 0x10000); io->out.system_time = timeval_to_nttime(¤t_time); io->out.server_start_time = timeval_to_nttime(&boot_time); diff --git a/source4/smb_server/smb2/receive.c b/source4/smb_server/smb2/receive.c index 26995b71ec..40a57b88f1 100644 --- a/source4/smb_server/smb2/receive.c +++ b/source4/smb_server/smb2/receive.c @@ -659,7 +659,7 @@ NTSTATUS smbsrv_init_smb2_connection(struct smbsrv_connection *smb_conn) /* this is the size that w2k uses, and it appears to be important for good performance */ - smb_conn->negotiate.max_recv = lp_max_xmit(smb_conn->lp_ctx); + smb_conn->negotiate.max_recv = lpcfg_max_xmit(smb_conn->lp_ctx); smb_conn->negotiate.zone_offset = get_time_zone(time(NULL)); diff --git a/source4/smb_server/smb_samba3.c b/source4/smb_server/smb_samba3.c index 10756396f3..5af2ce5042 100644 --- a/source4/smb_server/smb_samba3.c +++ b/source4/smb_server/smb_samba3.c @@ -50,7 +50,7 @@ static void samba3_smb_accept(struct stream_connection *conn) close(i); } - prog = lp_parm_string(conn->lp_ctx, NULL, "samba3", "smbd"); + prog = lpcfg_parm_string(conn->lp_ctx, NULL, "samba3", "smbd"); if (prog == NULL) { argv[0] = talloc_asprintf(conn, "%s/%s", dyn_BINDIR, "smbd3"); @@ -92,7 +92,7 @@ static NTSTATUS samba3_add_socket(struct tevent_context *event_context, const struct model_ops *model_ops, const char *address) { - const char **ports = lp_smb_ports(lp_ctx); + const char **ports = lpcfg_smb_ports(lp_ctx); int i; NTSTATUS status; @@ -102,7 +102,7 @@ static NTSTATUS samba3_add_socket(struct tevent_context *event_context, status = stream_setup_socket(event_context, lp_ctx, model_ops, &samba3_smb_stream_ops, "ip", address, &port, - lp_socket_options(lp_ctx), + lpcfg_socket_options(lp_ctx), NULL); NT_STATUS_NOT_OK_RETURN(status); } @@ -127,13 +127,13 @@ static void samba3_smb_task_init(struct task_server *task) task_server_set_title(task, "task[samba3_smb]"); - if (lp_interfaces(task->lp_ctx) - && lp_bind_interfaces_only(task->lp_ctx)) { + if (lpcfg_interfaces(task->lp_ctx) + && lpcfg_bind_interfaces_only(task->lp_ctx)) { int num_interfaces; int i; struct interface *ifaces; - load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces); + load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces); num_interfaces = iface_count(ifaces); @@ -149,10 +149,10 @@ static void samba3_smb_task_init(struct task_server *task) if (!NT_STATUS_IS_OK(status)) goto failed; } } else { - /* Just bind to lp_socket_address() (usually 0.0.0.0) */ + /* Just bind to lpcfg_socket_address() (usually 0.0.0.0) */ status = samba3_add_socket(task->event_ctx, task->lp_ctx, model_ops, - lp_socket_address(task->lp_ctx)); + lpcfg_socket_address(task->lp_ctx)); if (!NT_STATUS_IS_OK(status)) goto failed; } diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index b0a37adba0..6ebefc6eba 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -63,7 +63,7 @@ static NTSTATUS smbsrv_recv_generic_request(void *private_data, DATA_BLOB blob) packet_set_callback(smb_conn->packet, smbsrv_recv_smb_request); return smbsrv_recv_smb_request(smb_conn, blob); case SMB2_MAGIC: - if (lp_srv_maxprotocol(smb_conn->lp_ctx) < PROTOCOL_SMB2) break; + if (lpcfg_srv_maxprotocol(smb_conn->lp_ctx) < PROTOCOL_SMB2) break; status = smbsrv_init_smb2_connection(smb_conn); NT_STATUS_NOT_OK_RETURN(status); packet_set_callback(smb_conn->packet, smbsrv_recv_smb2_request); @@ -157,7 +157,7 @@ static void smbsrv_accept(struct stream_connection *conn) irpc_add_name(conn->msg_ctx, "smb_server"); - if (!NT_STATUS_IS_OK(share_get_context_by_name(smb_conn, lp_share_backend(smb_conn->lp_ctx), + if (!NT_STATUS_IS_OK(share_get_context_by_name(smb_conn, lpcfg_share_backend(smb_conn->lp_ctx), smb_conn->connection->event.ctx, smb_conn->lp_ctx, &(smb_conn->share_context)))) { smbsrv_terminate_connection(smb_conn, "share_init failed!"); @@ -180,17 +180,17 @@ _PUBLIC_ NTSTATUS smbsrv_add_socket(struct tevent_context *event_context, const struct model_ops *model_ops, const char *address) { - const char **ports = lp_smb_ports(lp_ctx); + const char **ports = lpcfg_smb_ports(lp_ctx); int i; NTSTATUS status; for (i=0;ports[i];i++) { uint16_t port = atoi(ports[i]); if (port == 0) continue; - status = stream_setup_socket(event_context, lp_ctx, + status = stream_setup_socket(event_context, lp_ctx, model_ops, &smb_stream_ops, "ipv4", address, &port, - lp_socket_options(lp_ctx), + lpcfg_socket_options(lp_ctx), NULL); NT_STATUS_NOT_OK_RETURN(status); } @@ -208,12 +208,12 @@ static void smbsrv_task_init(struct task_server *task) task_server_set_title(task, "task[smbsrv]"); - if (lp_interfaces(task->lp_ctx) && lp_bind_interfaces_only(task->lp_ctx)) { + if (lpcfg_interfaces(task->lp_ctx) && lpcfg_bind_interfaces_only(task->lp_ctx)) { int num_interfaces; int i; struct interface *ifaces; - load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces); + load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces); num_interfaces = iface_count(ifaces); @@ -227,9 +227,9 @@ static void smbsrv_task_init(struct task_server *task) if (!NT_STATUS_IS_OK(status)) goto failed; } } else { - /* Just bind to lp_socket_address() (usually 0.0.0.0) */ - status = smbsrv_add_socket(task->event_ctx, task->lp_ctx, task->model_ops, - lp_socket_address(task->lp_ctx)); + /* Just bind to lpcfg_socket_address() (usually 0.0.0.0) */ + status = smbsrv_add_socket(task->event_ctx, task->lp_ctx, task->model_ops, + lpcfg_socket_address(task->lp_ctx)); if (!NT_STATUS_IS_OK(status)) goto failed; } diff --git a/source4/smbd/process_model.h b/source4/smbd/process_model.h index 29f57d9df6..1d3e32eb34 100644 --- a/source4/smbd/process_model.h +++ b/source4/smbd/process_model.h @@ -55,7 +55,7 @@ struct model_ops { /* function to create a task */ void (*new_task)(struct tevent_context *, - struct loadparm_context *lp_ctx, + struct loadparm_context *lp_ctx, const char *service_name, void (*)(struct tevent_context *, struct loadparm_context *, struct server_id, @@ -63,7 +63,7 @@ struct model_ops { void *); /* function to terminate a connection or task */ - void (*terminate)(struct tevent_context *, struct loadparm_context *lp_ctx, + void (*terminate)(struct tevent_context *, struct loadparm_context *lp_ctx, const char *reason); /* function to set a title for the connection or task */ diff --git a/source4/smbd/process_prefork.c b/source4/smbd/process_prefork.c index fd1dc88fb1..cec5665237 100644 --- a/source4/smbd/process_prefork.c +++ b/source4/smbd/process_prefork.c @@ -94,7 +94,7 @@ static void prefork_accept_connection(struct tevent_context *ev, static void prefork_new_task(struct tevent_context *ev, struct loadparm_context *lp_ctx, const char *service_name, - void (*new_task_fn)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *), + void (*new_task_fn)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *), void *private_data) { pid_t pid; @@ -133,7 +133,7 @@ static void prefork_new_task(struct tevent_context *ev, /* setup this new connection: process will bind to it's sockets etc */ new_task_fn(ev2, lp_ctx, cluster_id(pid, 0), private_data); - num_children = lp_parm_int(lp_ctx, NULL, "prefork children", service_name, 0); + num_children = lpcfg_parm_int(lp_ctx, NULL, "prefork children", service_name, 0); if (num_children == 0) { /* We don't want any kids hanging around for this one, diff --git a/source4/smbd/process_single.c b/source4/smbd/process_single.c index ec5f529aa1..688b46e0a0 100644 --- a/source4/smbd/process_single.c +++ b/source4/smbd/process_single.c @@ -71,7 +71,7 @@ static void single_accept_connection(struct tevent_context *ev, /* The cluster_id(0, fd) cannot collide with the incrementing * task below, as the first component is 0, not 1 */ - new_conn(ev, lp_ctx, connected_socket, + new_conn(ev, lp_ctx, connected_socket, cluster_id(0, socket_get_fd(connected_socket)), private_data); } @@ -79,7 +79,7 @@ static void single_accept_connection(struct tevent_context *ev, called to startup a new task */ static void single_new_task(struct tevent_context *ev, - struct loadparm_context *lp_ctx, + struct loadparm_context *lp_ctx, const char *service_name, void (*new_task)(struct tevent_context *, struct loadparm_context *, struct server_id, void *), void *private_data) @@ -97,7 +97,7 @@ static void single_new_task(struct tevent_context *ev, /* called when a task goes down */ -static void single_terminate(struct tevent_context *ev, struct loadparm_context *lp_ctx, const char *reason) +static void single_terminate(struct tevent_context *ev, struct loadparm_context *lp_ctx, const char *reason) { DEBUG(3,("single_terminate: reason[%s]\n",reason)); } diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c index 6a7e8833eb..5ee8e6948d 100644 --- a/source4/smbd/process_standard.c +++ b/source4/smbd/process_standard.c @@ -156,7 +156,7 @@ static void standard_accept_connection(struct tevent_context *ev, static void standard_new_task(struct tevent_context *ev, struct loadparm_context *lp_ctx, const char *service_name, - void (*new_task)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *), + void (*new_task)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *), void *private_data) { pid_t pid; @@ -202,7 +202,7 @@ static void standard_new_task(struct tevent_context *ev, /* called when a task goes down */ -_NORETURN_ static void standard_terminate(struct tevent_context *ev, struct loadparm_context *lp_ctx, +_NORETURN_ static void standard_terminate(struct tevent_context *ev, struct loadparm_context *lp_ctx, const char *reason) { DEBUG(2,("standard_terminate: reason[%s]\n",reason)); diff --git a/source4/smbd/process_thread.c b/source4/smbd/process_thread.c index e17769d34e..8af785dd40 100644 --- a/source4/smbd/process_thread.c +++ b/source4/smbd/process_thread.c @@ -62,7 +62,7 @@ static void *thread_connection_fn(void *thread_parm) called when a listening socket becomes readable */ static void thread_accept_connection(struct tevent_context *ev, - struct loadparm_context *lp_ctx, + struct loadparm_context *lp_ctx, struct socket_context *sock, void (*new_conn)(struct tevent_context *, struct loadparm_context *, @@ -132,7 +132,7 @@ static void *thread_task_fn(void *thread_parm) { struct new_task_state *new_task = talloc_get_type(thread_parm, struct new_task_state); - new_task->new_task(new_task->ev, new_task->lp_ctx, pthread_self(), + new_task->new_task(new_task->ev, new_task->lp_ctx, pthread_self(), new_task->private_data); /* run this connection from here */ @@ -188,7 +188,7 @@ static void thread_new_task(struct tevent_context *ev, } /* called when a task goes down */ -static void thread_terminate(struct tevent_context *event_ctx, struct loadparm_context *lp_ctx, const char *reason) +static void thread_terminate(struct tevent_context *event_ctx, struct loadparm_context *lp_ctx, const char *reason) { DEBUG(10,("thread_terminate: reason[%s]\n",reason)); diff --git a/source4/smbd/server.c b/source4/smbd/server.c index 11415a1424..60269d003e 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -219,7 +219,7 @@ static NTSTATUS setup_parent_messaging(struct tevent_context *event_ctx, NTSTATUS status; msg = messaging_init(talloc_autofree_context(), - lp_messaging_path(event_ctx, lp_ctx), + lpcfg_messaging_path(event_ctx, lp_ctx), cluster_id(0, SAMBA_PARENT_TASKID), event_ctx); NT_STATUS_HAVE_NO_MEMORY(msg); @@ -388,11 +388,11 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ cleanup_tmp_files(cmdline_lp_ctx); - if (!directory_exist(lp_lockdir(cmdline_lp_ctx))) { - mkdir(lp_lockdir(cmdline_lp_ctx), 0755); + if (!directory_exist(lpcfg_lockdir(cmdline_lp_ctx))) { + mkdir(lpcfg_lockdir(cmdline_lp_ctx), 0755); } - pidfile_create(lp_piddir(cmdline_lp_ctx), binary_name); + pidfile_create(lpcfg_piddir(cmdline_lp_ctx), binary_name); /* Do *not* remove this, until you have removed * passdb/secrets.c, and proved that Samba still builds... */ @@ -401,8 +401,8 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ return 1; } - if (lp_server_role(cmdline_lp_ctx) == ROLE_DOMAIN_CONTROLLER) { - if (!open_schannel_session_store(talloc_autofree_context(), lp_private_dir(cmdline_lp_ctx))) { + if (lpcfg_server_role(cmdline_lp_ctx) == ROLE_DOMAIN_CONTROLLER) { + if (!open_schannel_session_store(talloc_autofree_context(), lpcfg_private_dir(cmdline_lp_ctx))) { DEBUG(0,("ERROR: Samba cannot open schannel store for secured NETLOGON operations.\n")); exit(1); } @@ -471,7 +471,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ DEBUG(0,("%s: using '%s' process model\n", binary_name, model)); status = server_service_startup(event_ctx, cmdline_lp_ctx, model, - lp_server_services(cmdline_lp_ctx)); + lpcfg_server_services(cmdline_lp_ctx)); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("Starting Services failed - %s\n", nt_errstr(status))); return 1; diff --git a/source4/smbd/service_named_pipe.c b/source4/smbd/service_named_pipe.c index 81f9878d55..84b490ac2d 100644 --- a/source4/smbd/service_named_pipe.c +++ b/source4/smbd/service_named_pipe.c @@ -312,7 +312,7 @@ NTSTATUS tstream_setup_named_pipe(struct tevent_context *event_context, goto fail; } - dirname = talloc_asprintf(pipe_sock, "%s/np", lp_ncalrpc_dir(lp_ctx)); + dirname = talloc_asprintf(pipe_sock, "%s/np", lpcfg_ncalrpc_dir(lp_ctx)); if (dirname == NULL) { goto fail; } diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c index 8c38f27d74..85efa34339 100644 --- a/source4/smbd/service_stream.c +++ b/source4/smbd/service_stream.c @@ -173,7 +173,7 @@ static void stream_new_connection(struct tevent_context *ev, srv_conn->event.ctx = ev; srv_conn->lp_ctx = lp_ctx; - if (!socket_check_access(sock, "smbd", lp_hostsallow(NULL, lp_default_service(lp_ctx)), lp_hostsdeny(NULL, lp_default_service(lp_ctx)))) { + if (!socket_check_access(sock, "smbd", lpcfg_hostsallow(NULL, lpcfg_default_service(lp_ctx)), lpcfg_hostsdeny(NULL, lpcfg_default_service(lp_ctx)))) { stream_terminate_connection(srv_conn, "denied by access rules"); return; } @@ -187,7 +187,7 @@ static void stream_new_connection(struct tevent_context *ev, /* setup to receive internal messages on this connection */ srv_conn->msg_ctx = messaging_init(srv_conn, - lp_messaging_path(srv_conn, lp_ctx), + lpcfg_messaging_path(srv_conn, lp_ctx), srv_conn->server_id, ev); if (!srv_conn->msg_ctx) { stream_terminate_connection(srv_conn, "messaging_init() failed"); @@ -242,7 +242,7 @@ static void stream_accept_handler(struct tevent_context *ev, struct tevent_fd *f /* ask the process model to create us a process for this new connection. When done, it calls stream_new_connection() with the newly created socket */ - stream_socket->model_ops->accept_connection(ev, stream_socket->lp_ctx, + stream_socket->model_ops->accept_connection(ev, stream_socket->lp_ctx, stream_socket->sock, stream_new_connection, stream_socket); } diff --git a/source4/smbd/service_task.c b/source4/smbd/service_task.c index 55f2fa24b8..f9d15b8bc3 100644 --- a/source4/smbd/service_task.c +++ b/source4/smbd/service_task.c @@ -79,7 +79,7 @@ static void task_server_callback(struct tevent_context *event_ctx, task->lp_ctx = lp_ctx; task->msg_ctx = messaging_init(task, - lp_messaging_path(task, task->lp_ctx), + lpcfg_messaging_path(task, task->lp_ctx), task->server_id, task->event_ctx); if (!task->msg_ctx) { diff --git a/source4/torture/auth/ntlmssp.c b/source4/torture/auth/ntlmssp.c index 6c5bb1d43b..d7639ac9cf 100644 --- a/source4/torture/auth/ntlmssp.c +++ b/source4/torture/auth/ntlmssp.c @@ -35,7 +35,7 @@ static bool torture_ntlmssp_self_check(struct torture_context *tctx) torture_assert_ntstatus_ok(tctx, gensec_client_start(mem_ctx, &gensec_security, - tctx->ev, lp_gensec_settings(tctx, tctx->lp_ctx)), + tctx->ev, lpcfg_gensec_settings(tctx, tctx->lp_ctx)), "gensec client start"); gensec_set_credentials(gensec_security, cmdline_credentials); @@ -92,7 +92,7 @@ static bool torture_ntlmssp_self_check(struct torture_context *tctx) torture_assert_ntstatus_ok(tctx, gensec_client_start(mem_ctx, &gensec_security, - tctx->ev, lp_gensec_settings(tctx, tctx->lp_ctx)), + tctx->ev, lpcfg_gensec_settings(tctx, tctx->lp_ctx)), "Failed to start GENSEC for NTLMSSP"); gensec_set_credentials(gensec_security, cmdline_credentials); diff --git a/source4/torture/auth/pac.c b/source4/torture/auth/pac.c index 2223f39161..4133e75ffa 100644 --- a/source4/torture/auth/pac.c +++ b/source4/torture/auth/pac.c @@ -90,7 +90,7 @@ static bool torture_pac_self_check(struct torture_context *tctx) } /* We need an input, and this one requires no underlying database */ - nt_status = auth_anonymous_server_info(mem_ctx, lp_netbios_name(tctx->lp_ctx), &server_info); + nt_status = auth_anonymous_server_info(mem_ctx, lpcfg_netbios_name(tctx->lp_ctx), &server_info); if (!NT_STATUS_IS_OK(nt_status)) { krb5_free_keyblock_contents(smb_krb5_context->krb5_context, diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index b2d523283a..c9148d1915 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -41,7 +41,7 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx) const char *host = torture_setting_string(tctx, "host", NULL); struct smbcli_options options; - make_nbt_name_client(&calling, lp_netbios_name(tctx->lp_ctx)); + make_nbt_name_client(&calling, lpcfg_netbios_name(tctx->lp_ctx)); nbt_choose_called_name(NULL, &called, host, NBT_NAME_SERVER); @@ -51,11 +51,11 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx) goto failed; } - lp_smbcli_options(tctx->lp_ctx, &options); + lpcfg_smbcli_options(tctx->lp_ctx, &options); - if (!smbcli_socket_connect(cli, host, lp_smb_ports(tctx->lp_ctx), tctx->ev, - lp_resolve_context(tctx->lp_ctx), &options, - lp_socket_options(tctx->lp_ctx))) { + if (!smbcli_socket_connect(cli, host, lpcfg_smb_ports(tctx->lp_ctx), tctx->ev, + lpcfg_resolve_context(tctx->lp_ctx), &options, + lpcfg_socket_options(tctx->lp_ctx))) { torture_comment(tctx, "Failed to connect with %s\n", host); goto failed; } @@ -359,7 +359,7 @@ static bool run_negprot_nowait(struct torture_context *tctx) for (i=0;i<100;i++) { struct smbcli_request *req; - req = smb_raw_negotiate_send(cli->transport, lp_unicode(tctx->lp_ctx), PROTOCOL_NT1); + req = smb_raw_negotiate_send(cli->transport, lpcfg_unicode(tctx->lp_ctx), PROTOCOL_NT1); event_loop_once(cli->transport->socket->event.ctx); if (req->state == SMBCLI_REQUEST_ERROR) { if (i > 0) { @@ -1453,9 +1453,9 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx) union smb_open io; NTSTATUS status; - nt_status_support = lp_nt_status_support(tctx->lp_ctx); + nt_status_support = lpcfg_nt_status_support(tctx->lp_ctx); - if (!lp_set_cmdline(tctx->lp_ctx, "nt status support", "yes")) { + if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support", "yes")) { torture_comment(tctx, "Could not set 'nt status support = yes'\n"); goto fail; } @@ -1464,7 +1464,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx) goto fail; } - if (!lp_set_cmdline(tctx->lp_ctx, "nt status support", "no")) { + if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support", "no")) { torture_comment(tctx, "Could not set 'nt status support = yes'\n"); goto fail; } @@ -1473,7 +1473,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx) goto fail; } - if (!lp_set_cmdline(tctx->lp_ctx, "nt status support", + if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support", nt_status_support ? "yes":"no")) { torture_comment(tctx, "Could not reset 'nt status support = yes'"); goto fail; diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c index 3cfcadcb7a..b4221a75b6 100644 --- a/source4/torture/basic/charset.c +++ b/source4/torture/basic/charset.c @@ -54,7 +54,7 @@ static NTSTATUS unicode_open(struct torture_context *tctx, } SSVAL(ucs_name, i*2, 0); - if (!convert_string_talloc_convenience(ucs_name, lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, &i, false)) { + if (!convert_string_talloc_convenience(ucs_name, lpcfg_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, &i, false)) { torture_comment(tctx, "Failed to convert UCS2 Name into unix - convert_string_talloc() failure\n"); talloc_free(ucs_name); return NT_STATUS_NO_MEMORY; diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c index 24e8e37331..7223272984 100644 --- a/source4/torture/basic/misc.c +++ b/source4/torture/basic/misc.c @@ -485,11 +485,11 @@ struct benchrw_state { unsigned int blocksize; unsigned int writeratio; int num_parallel_requests; - } *lp_params; + } *lpcfg_params; }; /* - init params using lp_parm_xxx + init params using lpcfg_parm_xxx return number of unclist entries */ static int init_benchrw_params(struct torture_context *tctx, @@ -504,7 +504,7 @@ static int init_benchrw_params(struct torture_context *tctx, lpar->writeratio = torture_setting_int(tctx, "writeratio",5); lpar->num_parallel_requests = torture_setting_int( tctx, "parallel_requests", 5); - lpar->workgroup = lp_workgroup(tctx->lp_ctx); + lpar->workgroup = lpcfg_workgroup(tctx->lp_ctx); p = torture_setting_string(tctx, "unclist", NULL); if (p) { @@ -619,7 +619,7 @@ static NTSTATUS benchrw_readwrite(struct torture_context *tctx, union smb_write wr; /* randomize between writes and reads*/ - if (random() % state->lp_params->writeratio == 0) { + if (random() % state->lpcfg_params->writeratio == 0) { torture_comment(tctx, "Callback WRITE file:%d (%d/%d)\n", state->nr,state->completed,torture_numops); wr.generic.level = RAW_WRITE_WRITEX ; @@ -627,7 +627,7 @@ static NTSTATUS benchrw_readwrite(struct torture_context *tctx, wr.writex.in.offset = 0; wr.writex.in.wmode = 0 ; wr.writex.in.remaining = 0; - wr.writex.in.count = state->lp_params->blocksize; + wr.writex.in.count = state->lpcfg_params->blocksize; wr.writex.in.data = state->buffer; state->readcnt=0; req = smb_raw_write_send(state->cli,&wr); @@ -636,16 +636,16 @@ static NTSTATUS benchrw_readwrite(struct torture_context *tctx, torture_comment(tctx, "Callback READ file:%d (%d/%d) Offset:%d\n", state->nr,state->completed,torture_numops, - (state->readcnt*state->lp_params->blocksize)); + (state->readcnt*state->lpcfg_params->blocksize)); rd.generic.level = RAW_READ_READX; rd.readx.in.file.fnum = state->fnum ; - rd.readx.in.offset = state->readcnt*state->lp_params->blocksize; - rd.readx.in.mincnt = state->lp_params->blocksize; + rd.readx.in.offset = state->readcnt*state->lpcfg_params->blocksize; + rd.readx.in.mincnt = state->lpcfg_params->blocksize; rd.readx.in.maxcnt = rd.readx.in.mincnt; rd.readx.in.remaining = 0 ; rd.readx.out.data = state->buffer; rd.readx.in.read_for_execute = false; - if(state->readcnt < state->lp_params->writeblocks){ + if(state->readcnt < state->lpcfg_params->writeblocks){ state->readcnt++; }else{ /*start reading from beginn of file*/ @@ -683,21 +683,21 @@ static NTSTATUS benchrw_open(struct torture_context *tctx, } torture_comment(tctx, "Write initial test file:%d (%d/%d)\n",state->nr, - (state->writecnt+1)*state->lp_params->blocksize, - (state->lp_params->writeblocks*state->lp_params->blocksize)); + (state->writecnt+1)*state->lpcfg_params->blocksize, + (state->lpcfg_params->writeblocks*state->lpcfg_params->blocksize)); wr.generic.level = RAW_WRITE_WRITEX ; wr.writex.in.file.fnum = state->fnum ; wr.writex.in.offset = state->writecnt * - state->lp_params->blocksize; + state->lpcfg_params->blocksize; wr.writex.in.wmode = 0 ; - wr.writex.in.remaining = (state->lp_params->writeblocks * - state->lp_params->blocksize)- + wr.writex.in.remaining = (state->lpcfg_params->writeblocks * + state->lpcfg_params->blocksize)- ((state->writecnt+1)*state-> - lp_params->blocksize); - wr.writex.in.count = state->lp_params->blocksize; + lpcfg_params->blocksize); + wr.writex.in.count = state->lpcfg_params->blocksize; wr.writex.in.data = state->buffer; state->writecnt++; - if(state->writecnt == state->lp_params->writeblocks){ + if(state->writecnt == state->lpcfg_params->writeblocks){ state->mode=READ_WRITE_DATA; } req = smb_raw_write_send(state->cli,&wr); @@ -738,9 +738,9 @@ static NTSTATUS benchrw_mkdir(struct torture_context *tctx, open_parms->openx.in.timeout = 0; open_parms->openx.in.fname = state->fname; - writedata = talloc_size(tctx,state->lp_params->blocksize); + writedata = talloc_size(tctx,state->lpcfg_params->blocksize); NT_STATUS_HAVE_NO_MEMORY(writedata); - generate_random_buffer(writedata,state->lp_params->blocksize); + generate_random_buffer(writedata,state->lpcfg_params->blocksize); state->buffer=writedata; state->writecnt=1; state->readcnt=0; @@ -795,7 +795,7 @@ static void benchrw_callback(struct smbcli_request *req) break; case READ_WRITE_DATA: while (state->num_parallel_requests - < state->lp_params->num_parallel_requests) { + < state->lpcfg_params->num_parallel_requests) { NTSTATUS status; status = benchrw_readwrite(tctx,state); if (!NT_STATUS_IS_OK(status)){ @@ -838,7 +838,7 @@ static void async_open_callback(struct composite_context *con) { struct benchrw_state *state = con->async.private_data; struct torture_context *tctx = state->tctx; - int retry = state->lp_params->retry; + int retry = state->lpcfg_params->retry; if (NT_STATUS_IS_OK(con->status)) { state->cli=((struct smb_composite_connect*) @@ -877,19 +877,19 @@ static struct composite_context *torture_connect_async( torture_comment(tctx, "Open Connection to %s/%s\n",host,share); smb->in.dest_host=talloc_strdup(mem_ctx,host); smb->in.service=talloc_strdup(mem_ctx,share); - smb->in.dest_ports=lp_smb_ports(tctx->lp_ctx); - smb->in.socket_options = lp_socket_options(tctx->lp_ctx); + smb->in.dest_ports=lpcfg_smb_ports(tctx->lp_ctx); + smb->in.socket_options = lpcfg_socket_options(tctx->lp_ctx); smb->in.called_name = strupper_talloc(mem_ctx, host); smb->in.service_type=NULL; smb->in.credentials=cmdline_credentials; smb->in.fallback_to_anonymous=false; - smb->in.gensec_settings = lp_gensec_settings(mem_ctx, tctx->lp_ctx); + smb->in.gensec_settings = lpcfg_gensec_settings(mem_ctx, tctx->lp_ctx); smb->in.workgroup=workgroup; - lp_smbcli_options(tctx->lp_ctx, &smb->in.options); - lp_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options); + lpcfg_smbcli_options(tctx->lp_ctx, &smb->in.options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options); return smb_composite_connect_send(smb,mem_ctx, - lp_resolve_context(tctx->lp_ctx),ev); + lpcfg_resolve_context(tctx->lp_ctx),ev); } bool run_benchrw(struct torture_context *tctx) @@ -915,7 +915,7 @@ bool run_benchrw(struct torture_context *tctx) ev = tctx->ev; state = talloc_array(tctx, struct benchrw_state *, torture_nprocs); - /* init params using lp_parm_xxx */ + /* init params using lpcfg_parm_xxx */ num_unc_names = init_benchrw_params(tctx,&lpparams); /* init private data structs*/ @@ -924,7 +924,7 @@ bool run_benchrw(struct torture_context *tctx) state[i]->tctx = tctx; state[i]->completed=0; state[i]->num_parallel_requests=0; - state[i]->lp_params=&lpparams; + state[i]->lpcfg_params=&lpparams; state[i]->nr=i; state[i]->dname=talloc_asprintf(tctx,"benchrw%d",i); state[i]->fname=talloc_asprintf(tctx,"%s%s", diff --git a/source4/torture/basic/secleak.c b/source4/torture/basic/secleak.c index 363b824b66..92dc3508f3 100644 --- a/source4/torture/basic/secleak.c +++ b/source4/torture/basic/secleak.c @@ -36,14 +36,14 @@ static bool try_failed_login(struct torture_context *tctx, struct smbcli_state * struct smbcli_session *session; struct smbcli_session_options options; - lp_smbcli_session_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &options); session = smbcli_session_init(cli->transport, cli, false, options); setup.in.sesskey = cli->transport->negotiate.sesskey; setup.in.capabilities = cli->transport->negotiate.capabilities; - setup.in.workgroup = lp_workgroup(tctx->lp_ctx); + setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); setup.in.credentials = cli_credentials_init(session); - setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx); + setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); cli_credentials_set_conf(setup.in.credentials, tctx->lp_ctx); cli_credentials_set_domain(setup.in.credentials, "INVALID-DOMAIN", CRED_SPECIFIED); diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index 10a1370b9d..4fc05df3f4 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -215,8 +215,8 @@ static bool connect_servers(struct tevent_context *ev, NTSTATUS status; struct smbcli_options smb_options; struct smbcli_session_options smb_session_options; - lp_smbcli_options(lp_ctx, &smb_options); - lp_smbcli_session_options(lp_ctx, &smb_session_options); + lpcfg_smbcli_options(lp_ctx, &smb_options); + lpcfg_smbcli_session_options(lp_ctx, &smb_session_options); printf("Connecting to \\\\%s\\%s as %s - instance %d\n", servers[i].server_name, servers[i].share_name, @@ -227,27 +227,27 @@ static bool connect_servers(struct tevent_context *ev, if (options.smb2) { status = smb2_connect(NULL, servers[i].server_name, - lp_smb_ports(lp_ctx), + lpcfg_smb_ports(lp_ctx), servers[i].share_name, - lp_resolve_context(lp_ctx), + lpcfg_resolve_context(lp_ctx), servers[i].credentials, &servers[i].smb2_tree[j], ev, &smb_options, - lp_socket_options(lp_ctx), - lp_gensec_settings(lp_ctx, lp_ctx) + lpcfg_socket_options(lp_ctx), + lpcfg_gensec_settings(lp_ctx, lp_ctx) ); } else { status = smbcli_tree_full_connection(NULL, &servers[i].smb_tree[j], servers[i].server_name, - lp_smb_ports(lp_ctx), + lpcfg_smb_ports(lp_ctx), servers[i].share_name, "A:", - lp_socket_options(lp_ctx), + lpcfg_socket_options(lp_ctx), servers[i].credentials, - lp_resolve_context(lp_ctx), ev, + lpcfg_resolve_context(lp_ctx), ev, &smb_options, &smb_session_options, - lp_gensec_settings(lp_ctx, lp_ctx)); + lpcfg_gensec_settings(lp_ctx, lp_ctx)); } if (!NT_STATUS_IS_OK(status)) { printf("Failed to connect to \\\\%s\\%s - %s\n", @@ -3185,7 +3185,7 @@ static bool split_unc_name(const char *unc, char **server, char **share) while((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { case OPT_UNCLIST: - lp_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc)); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc)); break; case 'U': if (username_count == 2) { diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c index 8b6794374b..689e518e77 100644 --- a/source4/torture/ldap/cldap.c +++ b/source4/torture/ldap/cldap.c @@ -50,7 +50,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) ret = tsocket_address_inet_from_strings(tctx, "ip", dest, - lp_cldap_port(tctx->lp_ctx), + lpcfg_cldap_port(tctx->lp_ctx), &dest_addr); CHECK_VAL(ret, 0); @@ -283,7 +283,7 @@ static bool test_cldap_netlogon_flags(struct torture_context *tctx, ret = tsocket_address_inet_from_strings(tctx, "ip", dest, - lp_cldap_port(tctx->lp_ctx), + lpcfg_cldap_port(tctx->lp_ctx), &dest_addr); CHECK_VAL(ret, 0); @@ -403,7 +403,7 @@ static bool test_cldap_netlogon_flag_ds_dns_forest(struct torture_context *tctx, ret = tsocket_address_inet_from_strings(tctx, "ip", dest, - lp_cldap_port(tctx->lp_ctx), + lpcfg_cldap_port(tctx->lp_ctx), &dest_addr); CHECK_VAL(ret, 0); @@ -440,7 +440,7 @@ static bool test_cldap_netlogon_flag_ds_dns_forest(struct torture_context *tctx, "rootDomainNamingContext" */ ZERO_STRUCT(search2); search2.in.dest_address = dest; - search2.in.dest_port = lp_cldap_port(tctx->lp_ctx); + search2.in.dest_port = lpcfg_cldap_port(tctx->lp_ctx); search2.in.timeout = 10; search2.in.retries = 3; search2.in.filter = "(objectclass=*)"; @@ -485,7 +485,7 @@ static bool test_cldap_generic(struct torture_context *tctx, const char *dest) ret = tsocket_address_inet_from_strings(tctx, "ip", dest, - lp_cldap_port(tctx->lp_ctx), + lpcfg_cldap_port(tctx->lp_ctx), &dest_addr); CHECK_VAL(ret, 0); diff --git a/source4/torture/ldap/cldapbench.c b/source4/torture/ldap/cldapbench.c index 27c0746e9a..5c7e56f40b 100644 --- a/source4/torture/ldap/cldapbench.c +++ b/source4/torture/ldap/cldapbench.c @@ -67,7 +67,7 @@ static bool bench_cldap_netlogon(struct torture_context *tctx, const char *addre ret = tsocket_address_inet_from_strings(tctx, "ip", address, - lp_cldap_port(tctx->lp_ctx), + lpcfg_cldap_port(tctx->lp_ctx), &dest_addr); CHECK_VAL(ret, 0); @@ -150,7 +150,7 @@ static bool bench_cldap_rootdse(struct torture_context *tctx, const char *addres ret = tsocket_address_inet_from_strings(tctx, "ip", address, - lp_cldap_port(tctx->lp_ctx), + lpcfg_cldap_port(tctx->lp_ctx), &dest_addr); CHECK_VAL(ret, 0); @@ -215,7 +215,7 @@ bool torture_bench_cldap(struct torture_context *torture) make_nbt_name_server(&name, torture_setting_string(torture, "host", NULL)); /* do an initial name resolution to find its IP */ - status = resolve_name(lp_resolve_context(torture->lp_ctx), &name, torture, &address, torture->ev); + status = resolve_name(lpcfg_resolve_context(torture->lp_ctx), &name, torture, &address, torture->ev); if (!NT_STATUS_IS_OK(status)) { printf("Failed to resolve %s - %s\n", name.name, nt_errstr(status)); diff --git a/source4/torture/libnet/domain.c b/source4/torture/libnet/domain.c index 11a006e42d..c523eeeab4 100644 --- a/source4/torture/libnet/domain.c +++ b/source4/torture/libnet/domain.c @@ -91,7 +91,7 @@ bool torture_domainopen(struct torture_context *torture) return false; } - name.string = lp_workgroup(torture->lp_ctx); + name.string = lpcfg_workgroup(torture->lp_ctx); /* * Testing synchronous version diff --git a/source4/torture/libnet/groupinfo.c b/source4/torture/libnet/groupinfo.c index 772427c323..0858d291e0 100644 --- a/source4/torture/libnet/groupinfo.c +++ b/source4/torture/libnet/groupinfo.c @@ -94,7 +94,7 @@ bool torture_groupinfo(struct torture_context *torture) } b = p->binding_handle; - name.string = lp_workgroup(torture->lp_ctx); + name.string = lpcfg_workgroup(torture->lp_ctx); /* * Testing synchronous version diff --git a/source4/torture/libnet/groupman.c b/source4/torture/libnet/groupman.c index 02a94a81d7..9ee3dc26fb 100644 --- a/source4/torture/libnet/groupman.c +++ b/source4/torture/libnet/groupman.c @@ -71,7 +71,7 @@ bool torture_groupadd(struct torture_context *torture) torture_assert_ntstatus_ok(torture, status, "RPC connection"); b = p->binding_handle; - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); if (!test_domain_open(torture, b, &domain_name, mem_ctx, &h, &sid)) { ret = false; goto done; diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c index 1d095fbf5f..87d646cf92 100644 --- a/source4/torture/libnet/libnet_BecomeDC.c +++ b/source4/torture/libnet/libnet_BecomeDC.c @@ -59,7 +59,7 @@ bool torture_net_become_dc(struct torture_context *torture) torture_assert_ntstatus_ok(torture, torture_temp_dir(torture, "libnet_BecomeDC", &location), "torture_temp_dir should return NT_STATUS_OK" ); - netbios_name = lp_parm_string(torture->lp_ctx, NULL, "become dc", "smbtorture dc"); + netbios_name = lpcfg_parm_string(torture->lp_ctx, NULL, "become dc", "smbtorture dc"); if (!netbios_name || !netbios_name[0]) { netbios_name = "smbtorturedc"; } @@ -67,7 +67,7 @@ bool torture_net_become_dc(struct torture_context *torture) make_nbt_name_server(&name, torture_setting_string(torture, "host", NULL)); /* do an initial name resolution to find its IP */ - status = resolve_name(lp_resolve_context(torture->lp_ctx), + status = resolve_name(lpcfg_resolve_context(torture->lp_ctx), &name, torture, &address, torture->ev); torture_assert_ntstatus_ok(torture, status, talloc_asprintf(torture, "Failed to resolve %s - %s\n", @@ -157,7 +157,7 @@ bool torture_net_become_dc(struct torture_context *torture) "Failed to get loaded dsdb_schema\n"); /* Make sure we get this from the command line */ - if (lp_parm_bool(torture->lp_ctx, NULL, "become dc", "do not unjoin", false)) { + if (lpcfg_parm_bool(torture->lp_ctx, NULL, "become dc", "do not unjoin", false)) { talloc_free(s); return ret; } diff --git a/source4/torture/libnet/libnet_domain.c b/source4/torture/libnet/libnet_domain.c index 5b747b06da..8cce172192 100644 --- a/source4/torture/libnet/libnet_domain.c +++ b/source4/torture/libnet/libnet_domain.c @@ -132,7 +132,7 @@ bool torture_domain_open_lsa(struct torture_context *torture) /* we're accessing domain controller so the domain name should be passed (it's going to be resolved to dc name and address) instead of specific server name. */ - domain_name = lp_workgroup(torture->lp_ctx); + domain_name = lpcfg_workgroup(torture->lp_ctx); ctx = libnet_context_init(torture->ev, torture->lp_ctx); if (ctx == NULL) { @@ -206,7 +206,7 @@ bool torture_domain_close_lsa(struct torture_context *torture) goto done; } - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); if (!test_opendomain_lsa(torture, p->binding_handle, torture, &h, &domain_name, &access_mask)) { torture_comment(torture, "failed to open domain on lsa service\n"); @@ -258,7 +258,7 @@ bool torture_domain_open_samr(struct torture_context *torture) /* we're accessing domain controller so the domain name should be passed (it's going to be resolved to dc name and address) instead of specific server name. */ - domain_name = lp_workgroup(torture->lp_ctx); + domain_name = lpcfg_workgroup(torture->lp_ctx); /* * Testing synchronous version @@ -334,7 +334,7 @@ bool torture_domain_close_samr(struct torture_context *torture) goto done; } - domain_name.string = talloc_strdup(mem_ctx, lp_workgroup(torture->lp_ctx)); + domain_name.string = talloc_strdup(mem_ctx, lpcfg_workgroup(torture->lp_ctx)); if (!test_opendomain_samr(torture, p->binding_handle, torture, &h, &domain_name, &access_mask, &sid)) { torture_comment(torture, "failed to open domain on samr service\n"); diff --git a/source4/torture/libnet/libnet_group.c b/source4/torture/libnet/libnet_group.c index 6acb3d2f60..f76587c108 100644 --- a/source4/torture/libnet/libnet_group.c +++ b/source4/torture/libnet/libnet_group.c @@ -53,7 +53,7 @@ bool torture_groupinfo_api(struct torture_context *torture) return false; } - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); if (!test_domain_open(torture, p->binding_handle, &domain_name, prep_mem_ctx, &h, NULL)) { ret = false; goto done; @@ -116,7 +116,7 @@ bool torture_grouplist(struct torture_context *torture) ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); mem_ctx = talloc_init("torture group list"); ZERO_STRUCT(req); @@ -180,7 +180,7 @@ bool torture_creategroup(struct torture_context *torture) ctx->cred = cmdline_credentials; req.in.group_name = TEST_GROUPNAME; - req.in.domain_name = lp_workgroup(torture->lp_ctx); + req.in.domain_name = lpcfg_workgroup(torture->lp_ctx); req.out.error_string = NULL; status = libnet_CreateGroup(ctx, mem_ctx, &req); diff --git a/source4/torture/libnet/libnet_lookup.c b/source4/torture/libnet/libnet_lookup.c index 128442a070..807e578e83 100644 --- a/source4/torture/libnet/libnet_lookup.c +++ b/source4/torture/libnet/libnet_lookup.c @@ -135,7 +135,7 @@ bool torture_lookup_pdc(struct torture_context *torture) goto done; } - lookup->in.domain_name = lp_workgroup(torture->lp_ctx); + lookup->in.domain_name = lpcfg_workgroup(torture->lp_ctx); lookup->in.name_type = NBT_NAME_PDC; status = libnet_LookupDCs(ctx, mem_ctx, lookup); @@ -175,7 +175,7 @@ bool torture_lookup_sam_name(struct torture_context *torture) if (mem_ctx == NULL) return false; r.in.name = "Administrator"; - r.in.domain_name = lp_workgroup(torture->lp_ctx); + r.in.domain_name = lpcfg_workgroup(torture->lp_ctx); status = libnet_LookupName(ctx, mem_ctx, &r); diff --git a/source4/torture/libnet/libnet_rpc.c b/source4/torture/libnet/libnet_rpc.c index 5403394740..ca64d62c43 100644 --- a/source4/torture/libnet/libnet_rpc.c +++ b/source4/torture/libnet/libnet_rpc.c @@ -163,7 +163,7 @@ bool torture_rpc_connect_pdc(struct torture_context *torture) /* we're accessing domain controller so the domain name should be passed (it's going to be resolved to dc name and address) instead of specific server name. */ - domain_name = lp_workgroup(torture->lp_ctx); + domain_name = lpcfg_workgroup(torture->lp_ctx); return torture_rpc_connect(torture, level, NULL, domain_name); } @@ -183,7 +183,7 @@ bool torture_rpc_connect_dc(struct torture_context *torture) /* we're accessing domain controller so the domain name should be passed (it's going to be resolved to dc name and address) instead of specific server name. */ - domain_name = lp_workgroup(torture->lp_ctx); + domain_name = lpcfg_workgroup(torture->lp_ctx); return torture_rpc_connect(torture, level, NULL, domain_name); } @@ -203,7 +203,7 @@ bool torture_rpc_connect_dc_info(struct torture_context *torture) /* we're accessing domain controller so the domain name should be passed (it's going to be resolved to dc name and address) instead of specific server name. */ - domain_name = lp_workgroup(torture->lp_ctx); + domain_name = lpcfg_workgroup(torture->lp_ctx); return torture_rpc_connect(torture, level, NULL, domain_name); } diff --git a/source4/torture/libnet/libnet_user.c b/source4/torture/libnet/libnet_user.c index 9dfb1b0ac4..c5af5ed1ab 100644 --- a/source4/torture/libnet/libnet_user.c +++ b/source4/torture/libnet/libnet_user.c @@ -46,7 +46,7 @@ bool torture_createuser(struct torture_context *torture) } req.in.user_name = TEST_USERNAME; - req.in.domain_name = lp_workgroup(torture->lp_ctx); + req.in.domain_name = lpcfg_workgroup(torture->lp_ctx); req.out.error_string = NULL; status = libnet_CreateUser(ctx, mem_ctx, &req); @@ -91,7 +91,7 @@ bool torture_deleteuser(struct torture_context *torture) prep_mem_ctx = talloc_init("prepare test_deleteuser"); req.in.user_name = TEST_USERNAME; - req.in.domain_name = lp_workgroup(torture->lp_ctx); + req.in.domain_name = lpcfg_workgroup(torture->lp_ctx); status = torture_rpc_connection(torture, &p, @@ -101,7 +101,7 @@ bool torture_deleteuser(struct torture_context *torture) goto done; } - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); if (!test_domain_open(torture, p->binding_handle, &domain_name, prep_mem_ctx, &h, NULL)) { ret = false; goto done; @@ -298,7 +298,7 @@ bool torture_modifyuser(struct torture_context *torture) name = talloc_strdup(prep_mem_ctx, TEST_USERNAME); - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); if (!test_domain_open(torture, b, &domain_name, prep_mem_ctx, &h, NULL)) { ret = false; goto done; @@ -317,7 +317,7 @@ bool torture_modifyuser(struct torture_context *torture) for (fld = USER_FIELD_FIRST; fld <= USER_FIELD_LAST; fld++) { ZERO_STRUCT(req); - req.in.domain_name = lp_workgroup(torture->lp_ctx); + req.in.domain_name = lpcfg_workgroup(torture->lp_ctx); req.in.user_name = name; set_test_changes(torture, torture, &req, 1, &name, fld); @@ -330,7 +330,7 @@ bool torture_modifyuser(struct torture_context *torture) } ZERO_STRUCT(user_req); - user_req.in.domain_name = lp_workgroup(torture->lp_ctx); + user_req.in.domain_name = lpcfg_workgroup(torture->lp_ctx); user_req.in.data.user_name = name; user_req.in.level = USER_INFO_BY_NAME; @@ -411,7 +411,7 @@ bool torture_userinfo_api(struct torture_context *torture) } b = p->binding_handle; - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); if (!test_domain_open(torture, b, &domain_name, prep_mem_ctx, &h, NULL)) { ret = false; goto done; @@ -474,7 +474,7 @@ bool torture_userlist(struct torture_context *torture) ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); mem_ctx = talloc_init("torture user list"); ZERO_STRUCT(req); diff --git a/source4/torture/libnet/userinfo.c b/source4/torture/libnet/userinfo.c index 686f1f13f3..042212f4aa 100644 --- a/source4/torture/libnet/userinfo.c +++ b/source4/torture/libnet/userinfo.c @@ -133,7 +133,7 @@ bool torture_userinfo(struct torture_context *torture) } b = p->binding_handle; - name.string = lp_workgroup(torture->lp_ctx); + name.string = lpcfg_workgroup(torture->lp_ctx); /* * Testing synchronous version diff --git a/source4/torture/libnet/userman.c b/source4/torture/libnet/userman.c index 42664a3ae4..13fc98dd48 100644 --- a/source4/torture/libnet/userman.c +++ b/source4/torture/libnet/userman.c @@ -325,7 +325,7 @@ bool torture_useradd(struct torture_context *torture) torture_assert_ntstatus_ok(torture, status, "RPC connect failed"); b = p->binding_handle; - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); if (!test_domain_open(torture, b, &domain_name, mem_ctx, &h, &sid)) { ret = false; goto done; @@ -386,7 +386,7 @@ bool torture_userdel(struct torture_context *torture) } b = p->binding_handle; - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); if (!test_domain_open(torture, b, &domain_name, mem_ctx, &h, &sid)) { ret = false; goto done; @@ -431,7 +431,7 @@ bool torture_usermod(struct torture_context *torture) torture_assert_ntstatus_ok(torture, status, "RPC connect"); b = p->binding_handle; - domain_name.string = lp_workgroup(torture->lp_ctx); + domain_name.string = lpcfg_workgroup(torture->lp_ctx); name = talloc_strdup(mem_ctx, TEST_USERNAME); if (!test_domain_open(torture, b, &domain_name, mem_ctx, &h, &sid)) { diff --git a/source4/torture/local/dbspeed.c b/source4/torture/local/dbspeed.c index dabf083bff..f66688dd54 100644 --- a/source4/torture/local/dbspeed.c +++ b/source4/torture/local/dbspeed.c @@ -177,7 +177,7 @@ static bool test_ldb_speed(struct torture_context *torture, const void *_data) torture_comment(torture, "Testing ldb speed for sidmap\n"); - ldb = ldb_wrap_connect(tmp_ctx, torture->ev, torture->lp_ctx, "tdb://test.ldb", + ldb = ldb_wrap_connect(tmp_ctx, torture->ev, torture->lp_ctx, "tdb://test.ldb", NULL, NULL, LDB_FLG_NOSYNC); if (!ldb) { torture_result(torture, TORTURE_FAIL, "Failed to open test.ldb"); diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index a09b54cfd6..7a236be463 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -118,8 +118,8 @@ static struct smbcli_state *connect_one(struct tevent_context *ev, struct smbcli_options options; struct smbcli_session_options session_options; - lp_smbcli_options(lp_ctx, &options); - lp_smbcli_session_options(lp_ctx, &session_options); + lpcfg_smbcli_options(lp_ctx, &options); + lpcfg_smbcli_session_options(lp_ctx, &session_options); printf("connect_one(%s, %d, %d)\n", share, snum, conn); @@ -133,7 +133,7 @@ static struct smbcli_state *connect_one(struct tevent_context *ev, char **unc_list = NULL; int num_unc_names; const char *p; - p = lp_parm_string(lp_ctx, NULL, "torture", "unclist"); + p = lpcfg_parm_string(lp_ctx, NULL, "torture", "unclist"); if (p) { char *h, *s; unc_list = file_lines_load(p, &num_unc_names, 0, NULL); @@ -161,13 +161,13 @@ static struct smbcli_state *connect_one(struct tevent_context *ev, printf("\\\\%s\\%s\n", server, share); status = smbcli_full_connection(NULL, &c, server, - lp_smb_ports(lp_ctx), + lpcfg_smb_ports(lp_ctx), share, NULL, - lp_socket_options(lp_ctx), + lpcfg_socket_options(lp_ctx), servers[snum], - lp_resolve_context(lp_ctx), + lpcfg_resolve_context(lp_ctx), ev, &options, &session_options, - lp_gensec_settings(mem_ctx, lp_ctx)); + lpcfg_gensec_settings(mem_ctx, lp_ctx)); if (!NT_STATUS_IS_OK(status)) { sleep(2); } @@ -200,7 +200,7 @@ static void reconnect(struct tevent_context *ev, } talloc_free(cli[server][conn]); } - cli[server][conn] = connect_one(ev, lp_ctx, mem_ctx, share[server], + cli[server][conn] = connect_one(ev, lp_ctx, mem_ctx, share[server], server, conn); if (!cli[server][conn]) { DEBUG(0,("Failed to connect to %s\n", share[server])); @@ -598,7 +598,7 @@ static void usage(poptContext pc) while((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { case OPT_UNCLIST: - lp_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc)); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc)); break; case 'U': if (username_count == 2) { diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c index 2cf28c3554..7364d6df2f 100644 --- a/source4/torture/locktest2.c +++ b/source4/torture/locktest2.c @@ -173,7 +173,7 @@ static struct smbcli_state *connect_one(TALLOC_CTX *mem_ctx, nt_status = smbcli_full_connection(NULL, &c, myname, server_n, ports, share, NULL, - username, lp_workgroup(), password, ev, + username, lpcfg_workgroup(), password, ev, options, session_options, gensec_settings); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(0, ("smbcli_full_connection failed with error %s\n", nt_errstr(nt_status))); @@ -513,7 +513,7 @@ static void usage(void) argv += 4; lp_ctx = loadparm_init(mem_ctx); - lp_load(lp_ctx, dyn_CONFIGFILE); + lpcfg_load(lp_ctx, dyn_CONFIGFILE); if (getenv("USER")) { username = talloc_strdup(mem_ctx, getenv("USER")); @@ -568,11 +568,11 @@ static void usage(void) ev = s4_event_context_init(mem_ctx); locking_init(1); - lp_smbcli_options(lp_ctx, &options); - lp_smbcli_session_options(lp_ctx, &session_options); + lpcfg_smbcli_options(lp_ctx, &options); + lpcfg_smbcli_session_options(lp_ctx, &session_options); test_locks(mem_ctx, share1, share2, nfspath1, nfspath2, - lp_smb_ports(lp_ctx), - &options, &session_options, lp_gensec_settings(lp_ctx), ev); + lpcfg_smb_ports(lp_ctx), + &options, &session_options, lpcfg_gensec_settings(lp_ctx), ev); return(0); } diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c index e61eb868a4..9c66291087 100644 --- a/source4/torture/masktest.c +++ b/source4/torture/masktest.c @@ -331,7 +331,7 @@ static void usage(poptContext pc) while((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { case OPT_UNCLIST: - lp_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc)); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc)); break; } } @@ -364,13 +364,13 @@ static void usage(poptContext pc) gensec_init(lp_ctx); - lp_smbcli_options(lp_ctx, &options); - lp_smbcli_session_options(lp_ctx, &session_options); + lpcfg_smbcli_options(lp_ctx, &options); + lpcfg_smbcli_session_options(lp_ctx, &session_options); - cli = connect_one(lp_resolve_context(lp_ctx), ev, mem_ctx, share, - lp_smb_ports(lp_ctx), lp_socket_options(lp_ctx), + cli = connect_one(lpcfg_resolve_context(lp_ctx), ev, mem_ctx, share, + lpcfg_smb_ports(lp_ctx), lpcfg_socket_options(lp_ctx), &options, &session_options, - lp_gensec_settings(mem_ctx, lp_ctx)); + lpcfg_gensec_settings(mem_ctx, lp_ctx)); if (!cli) { DEBUG(0,("Failed to connect to %s\n", share)); exit(1); diff --git a/source4/torture/nbt/browse.c b/source4/torture/nbt/browse.c index a0e7b7d9ca..dcf96ba3ef 100644 --- a/source4/torture/nbt/browse.c +++ b/source4/torture/nbt/browse.c @@ -35,7 +35,7 @@ bool torture_nbt_browse(struct torture_context *torture) NTSTATUS status; bool ret = true; - name.name = lp_workgroup(); + name.name = lpcfg_workgroup(); name.type = NBT_NAME_BROWSER; name.scope = NULL; diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c index 7d1199ec2a..4c0fe4bd77 100644 --- a/source4/torture/nbt/dgram.c +++ b/source4/torture/nbt/dgram.c @@ -80,21 +80,21 @@ static bool nbt_test_netlogon(struct torture_context *tctx) struct interface *ifaces; - name.name = lp_workgroup(tctx->lp_ctx); + name.name = lpcfg_workgroup(tctx->lp_ctx); name.type = NBT_NAME_LOGON; name.scope = NULL; /* do an initial name resolution to find its IP */ torture_assert_ntstatus_ok(tctx, - resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev), + resolve_name(lpcfg_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev), talloc_asprintf(tctx, "Failed to resolve %s", name.name)); - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address)); socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - myaddress, lp_dgram_port(tctx->lp_ctx)); + myaddress, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, socket_address != NULL, "Error getting address"); /* try receiving replies on port 138 first, which will only @@ -127,7 +127,7 @@ static bool nbt_test_netlogon(struct torture_context *tctx) make_nbt_name_client(&myname, TEST_NAME); dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - address, lp_dgram_port(tctx->lp_ctx)); + address, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, dest != NULL, "Error getting address"); status = dgram_mailslot_netlogon_send(dgmsock, &name, dest, @@ -173,20 +173,20 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) struct cli_credentials *machine_credentials; const struct dom_sid *dom_sid; - name.name = lp_workgroup(tctx->lp_ctx); + name.name = lpcfg_workgroup(tctx->lp_ctx); name.type = NBT_NAME_LOGON; name.scope = NULL; /* do an initial name resolution to find its IP */ torture_assert_ntstatus_ok(tctx, - resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev), + resolve_name(lpcfg_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev), talloc_asprintf(tctx, "Failed to resolve %s", name.name)); - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address)); socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - myaddress, lp_dgram_port(tctx->lp_ctx)); + myaddress, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, socket_address != NULL, "Error getting address"); /* try receiving replies on port 138 first, which will only @@ -221,7 +221,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) make_nbt_name_client(&myname, TEST_NAME); dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - address, lp_dgram_port(tctx->lp_ctx)); + address, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, dest != NULL, "Error getting address"); status = dgram_mailslot_netlogon_send(dgmsock, &name, dest, @@ -260,7 +260,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) make_nbt_name_client(&myname, TEST_NAME); dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - address, lp_dgram_port(tctx->lp_ctx)); + address, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, dest != NULL, "Error getting address"); status = dgram_mailslot_netlogon_send(dgmsock, &name, dest, @@ -288,7 +288,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) torture_assert(tctx, join_ctx != NULL, talloc_asprintf(tctx, "Failed to join domain %s as %s\n", - lp_workgroup(tctx->lp_ctx), TEST_NAME)); + lpcfg_workgroup(tctx->lp_ctx), TEST_NAME)); dom_sid = torture_join_sid(join_ctx); @@ -310,7 +310,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) make_nbt_name_client(&myname, TEST_NAME); dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - address, lp_dgram_port(tctx->lp_ctx)); + address, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, dest != NULL, "Error getting address"); status = dgram_mailslot_netlogon_send(dgmsock, &name, dest, @@ -353,7 +353,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) make_nbt_name_client(&myname, TEST_NAME); dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - address, lp_dgram_port(tctx->lp_ctx)); + address, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, dest != NULL, "Error getting address"); status = dgram_mailslot_netlogon_send(dgmsock, &name, dest, @@ -392,7 +392,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) make_nbt_name_client(&myname, TEST_NAME); dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - address, lp_dgram_port(tctx->lp_ctx)); + address, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, dest != NULL, "Error getting address"); status = dgram_mailslot_netlogon_send(dgmsock, &name, dest, @@ -442,20 +442,20 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) struct interface *ifaces; - name.name = lp_workgroup(tctx->lp_ctx); + name.name = lpcfg_workgroup(tctx->lp_ctx); name.type = NBT_NAME_LOGON; name.scope = NULL; /* do an initial name resolution to find its IP */ torture_assert_ntstatus_ok(tctx, - resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev), + resolve_name(lpcfg_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev), talloc_asprintf(tctx, "Failed to resolve %s", name.name)); - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address)); socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - myaddress, lp_dgram_port(tctx->lp_ctx)); + myaddress, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, socket_address != NULL, "Error getting address"); /* try receiving replies on port 138 first, which will only @@ -478,7 +478,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) torture_assert(tctx, join_ctx != NULL, talloc_asprintf(tctx, "Failed to join domain %s as %s\n", - lp_workgroup(tctx->lp_ctx), TEST_NAME)); + lpcfg_workgroup(tctx->lp_ctx), TEST_NAME)); /* setup a temporary mailslot listener for replies */ dgmslot = dgram_mailslot_temp(dgmsock, NBT_MAILSLOT_GETDC, @@ -501,7 +501,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) make_nbt_name_client(&myname, TEST_NAME); dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - address, lp_dgram_port(tctx->lp_ctx)); + address, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, dest != NULL, "Error getting address"); status = dgram_mailslot_netlogon_send(dgmsock, &name, dest, @@ -545,7 +545,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) make_nbt_name_client(&myname, TEST_NAME); dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - address, lp_dgram_port(tctx->lp_ctx)); + address, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, dest != NULL, "Error getting address"); status = dgram_mailslot_netlogon_send(dgmsock, &name, dest, @@ -585,7 +585,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) make_nbt_name_client(&myname, TEST_NAME); dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - address, lp_dgram_port(tctx->lp_ctx)); + address, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, dest != NULL, "Error getting address"); status = dgram_mailslot_netlogon_send(dgmsock, &name, dest, @@ -622,7 +622,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) make_nbt_name_client(&myname, TEST_NAME); dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, - address, lp_dgram_port(tctx->lp_ctx)); + address, lpcfg_dgram_port(tctx->lp_ctx)); torture_assert(tctx, dest != NULL, "Error getting address"); status = dgram_mailslot_netlogon_send(dgmsock, &name, dest, diff --git a/source4/torture/nbt/nbt.c b/source4/torture/nbt/nbt.c index 1dcfa563df..6ea31dae86 100644 --- a/source4/torture/nbt/nbt.c +++ b/source4/torture/nbt/nbt.c @@ -39,7 +39,7 @@ bool torture_nbt_get_name(struct torture_context *tctx, /* do an initial name resolution to find its IP */ torture_assert_ntstatus_ok(tctx, - resolve_name(lp_resolve_context(tctx->lp_ctx), name, tctx, address, tctx->ev), + resolve_name(lpcfg_resolve_context(tctx->lp_ctx), name, tctx, address, tctx->ev), talloc_asprintf(tctx, "Failed to resolve %s", name->name)); diff --git a/source4/torture/nbt/query.c b/source4/torture/nbt/query.c index b1b703a3c2..a05e34c0e6 100644 --- a/source4/torture/nbt/query.c +++ b/source4/torture/nbt/query.c @@ -62,7 +62,7 @@ static bool bench_namequery(struct torture_context *tctx) io.in.name = name; io.in.dest_addr = address; - io.in.dest_port = lp_nbt_port(tctx->lp_ctx); + io.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); io.in.broadcast = false; io.in.wins_lookup = false; io.in.timeout = 1; diff --git a/source4/torture/nbt/register.c b/source4/torture/nbt/register.c index 8ddea4096e..eadee9b44d 100644 --- a/source4/torture/nbt/register.c +++ b/source4/torture/nbt/register.c @@ -54,7 +54,7 @@ static bool nbt_register_own(struct torture_context *tctx) if (!torture_nbt_get_name(tctx, &name, &address)) return false; - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); myaddress = iface_best_ip(ifaces, address); @@ -70,7 +70,7 @@ static bool nbt_register_own(struct torture_context *tctx) io.in.name = name; io.in.dest_addr = address; - io.in.dest_port = lp_nbt_port(tctx->lp_ctx); + io.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); io.in.address = myaddress; io.in.nb_flags = NBT_NODE_B | NBT_NM_ACTIVE; io.in.register_demand = false; @@ -123,7 +123,7 @@ static bool nbt_refresh_own(struct torture_context *tctx) if (!torture_nbt_get_name(tctx, &name, &address)) return false; - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); myaddress = iface_best_ip(ifaces, address); @@ -140,7 +140,7 @@ static bool nbt_refresh_own(struct torture_context *tctx) io.in.name = name; io.in.dest_addr = address; - io.in.dest_port = lp_nbt_port(tctx->lp_ctx); + io.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); io.in.address = myaddress; io.in.nb_flags = NBT_NODE_B | NBT_NM_ACTIVE; io.in.broadcast = false; diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c index b372de8a55..fd8463a936 100644 --- a/source4/torture/nbt/wins.c +++ b/source4/torture/nbt/wins.c @@ -65,13 +65,13 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address struct interface *ifaces; bool low_port = try_low_port; - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); myaddress = talloc_strdup(tctx, iface_best_ip(ifaces, address)); socket_address = socket_address_from_strings(tctx, nbtsock->sock->backend_name, - myaddress, lp_nbt_port(tctx->lp_ctx)); + myaddress, lpcfg_nbt_port(tctx->lp_ctx)); torture_assert(tctx, socket_address != NULL, "Error getting address"); @@ -98,7 +98,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address torture_comment(tctx, "release the name\n"); release.in.name = *name; - release.in.dest_port = lp_nbt_port(tctx->lp_ctx); + release.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); release.in.dest_addr = address; release.in.address = myaddress; release.in.nb_flags = nb_flags; @@ -117,7 +117,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address } else { torture_comment(tctx, "register the name with a wrong address (makes the next request slow!)\n"); io.in.name = *name; - io.in.wins_port = lp_nbt_port(tctx->lp_ctx); + io.in.wins_port = lpcfg_nbt_port(tctx->lp_ctx); io.in.wins_servers = const_str_list( str_list_make_single(tctx, address)); io.in.addresses = const_str_list( @@ -140,7 +140,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address torture_comment(tctx, "register the name correct address\n"); name_register.in.name = *name; - name_register.in.dest_port = lp_nbt_port(tctx->lp_ctx); + name_register.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); name_register.in.dest_addr = address; name_register.in.address = myaddress; name_register.in.nb_flags = nb_flags; @@ -191,7 +191,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address torture_comment(tctx, "register the name correct address\n"); io.in.name = *name; - io.in.wins_port = lp_nbt_port(tctx->lp_ctx); + io.in.wins_port = lpcfg_nbt_port(tctx->lp_ctx); io.in.wins_servers = (const char **)str_list_make_single(tctx, address); io.in.addresses = (const char **)str_list_make_single(tctx, myaddress); io.in.nb_flags = nb_flags; @@ -222,7 +222,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address torture_comment(tctx, "query the name to make sure its there\n"); query.in.name = *name; query.in.dest_addr = address; - query.in.dest_port = lp_nbt_port(tctx->lp_ctx); + query.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); query.in.broadcast = false; query.in.wins_lookup = true; query.in.timeout = 3; @@ -268,7 +268,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address torture_comment(tctx, "refresh the name\n"); refresh.in.name = *name; - refresh.in.wins_port = lp_nbt_port(tctx->lp_ctx); + refresh.in.wins_port = lpcfg_nbt_port(tctx->lp_ctx); refresh.in.wins_servers = (const char **)str_list_make_single(tctx, address); refresh.in.addresses = (const char **)str_list_make_single(tctx, myaddress); refresh.in.nb_flags = nb_flags; @@ -289,7 +289,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address printf("release the name\n"); release.in.name = *name; - release.in.dest_port = lp_nbt_port(tctx->lp_ctx); + release.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); release.in.dest_addr = address; release.in.address = myaddress; release.in.nb_flags = nb_flags; @@ -317,7 +317,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address } else { torture_comment(tctx, "register the name with a wrong address (makes the next request slow!)\n"); io.in.name = *name; - io.in.wins_port = lp_nbt_port(tctx->lp_ctx); + io.in.wins_port = lpcfg_nbt_port(tctx->lp_ctx); io.in.wins_servers = const_str_list( str_list_make_single(tctx, address)); io.in.addresses = const_str_list( @@ -341,7 +341,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address torture_comment(tctx, "refresh the name with the correct address\n"); refresh.in.name = *name; - refresh.in.wins_port = lp_nbt_port(tctx->lp_ctx); + refresh.in.wins_port = lpcfg_nbt_port(tctx->lp_ctx); refresh.in.wins_servers = const_str_list( str_list_make_single(tctx, address)); refresh.in.addresses = const_str_list( @@ -364,7 +364,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address torture_comment(tctx, "release the name\n"); release.in.name = *name; - release.in.dest_port = lp_nbt_port(tctx->lp_ctx); + release.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); release.in.dest_addr = address; release.in.address = myaddress; release.in.nb_flags = nb_flags; diff --git a/source4/torture/nbt/winsbench.c b/source4/torture/nbt/winsbench.c index 226f388f35..c77c63544c 100644 --- a/source4/torture/nbt/winsbench.c +++ b/source4/torture/nbt/winsbench.c @@ -245,8 +245,8 @@ static bool bench_wins(struct torture_context *tctx) state->num_names = torture_entries; state->registered = talloc_zero_array(state, bool, state->num_names); state->wins_server = address; - state->wins_port = lp_nbt_port(tctx->lp_ctx); - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + state->wins_port = lpcfg_nbt_port(tctx->lp_ctx); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); state->my_ip = talloc_strdup(tctx, iface_best_ip(ifaces, address)); state->ttl = timelimit; diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index b8152f79d6..a0d4c23ae7 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -615,7 +615,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev); if (!ctx->nbtsock) return NULL; - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(ifaces, address), 0); if (!ctx->myaddr) return NULL; @@ -634,7 +634,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( if (!ctx->nbtsock_srv) return NULL; /* Make a port 137 version of ctx->myaddr */ - nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port(tctx->lp_ctx)); + nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lpcfg_nbt_port(tctx->lp_ctx)); if (!nbt_srv_addr) return NULL; /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */ @@ -660,7 +660,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr2->addr, - lp_nbt_port(tctx->lp_ctx)); + lpcfg_nbt_port(tctx->lp_ctx)); if (!nbt_srv_addr) return NULL; /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */ @@ -6587,7 +6587,7 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx */ name_register->in.name = records[i].name; name_register->in.dest_addr = ctx->address; - name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx); + name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); name_register->in.address = records[i].wins.ips[0].ip; name_register->in.nb_flags = records[i].wins.nb_flags; name_register->in.register_demand= false; @@ -6616,7 +6616,7 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx /* release the record */ release->in.name = records[i].name; - release->in.dest_port = lp_nbt_port(tctx->lp_ctx); + release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); release->in.dest_addr = ctx->address; release->in.address = records[i].wins.ips[0].ip; release->in.nb_flags = records[i].wins.nb_flags; @@ -6672,7 +6672,7 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx } else { release->in.name = records[i].name; release->in.dest_addr = ctx->address; - release->in.dest_port = lp_nbt_port(tctx->lp_ctx); + release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); release->in.address = records[i].wins.ips[0].ip; release->in.nb_flags = records[i].wins.nb_flags; release->in.broadcast = false; @@ -9213,7 +9213,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, if (!ctx->nbtsock_srv) { torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n", - lp_nbt_port(tctx->lp_ctx)); + lpcfg_nbt_port(tctx->lp_ctx)); return true; } @@ -9275,7 +9275,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, name_register->in.name = records[i].name; name_register->in.dest_addr = ctx->address; - name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx); + name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); name_register->in.address = records[i].wins.ips[j].ip; name_register->in.nb_flags = records[i].wins.nb_flags; name_register->in.register_demand= false; @@ -9422,7 +9422,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, release->in.name = records[i].name; release->in.dest_addr = ctx->address; - release->in.dest_port = lp_nbt_port(tctx->lp_ctx); + release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx); release->in.address = records[i].wins.ips[j].ip; release->in.nb_flags = records[i].wins.nb_flags; release->in.broadcast = false; diff --git a/source4/torture/ntp/ntp_signd.c b/source4/torture/ntp/ntp_signd.c index 9b4b9c3a4e..ca5fb14c6e 100644 --- a/source4/torture/ntp/ntp_signd.c +++ b/source4/torture/ntp/ntp_signd.c @@ -154,7 +154,7 @@ static bool test_ntp_signd(struct torture_context *tctx, unix_address = talloc_asprintf(signd_client, "%s/socket", - lp_ntp_signd_socket_directory(tctx->lp_ctx)); + lpcfg_ntp_signd_socket_directory(tctx->lp_ctx)); rc = tsocket_address_unix_from_path(mem_ctx, unix_address, &signd_client->remote_address); diff --git a/source4/torture/rap/sam.c b/source4/torture/rap/sam.c index 144abaabf2..34e8742068 100644 --- a/source4/torture/rap/sam.c +++ b/source4/torture/rap/sam.c @@ -61,7 +61,7 @@ static bool test_userpasswordset2_args(struct torture_context *tctx, torture_comment(tctx, "Testing rap_NetUserPasswordSet2(%s)\n", r.in.UserName); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netuserpasswordset2(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netuserpasswordset2(cli->tree, lpcfg_iconv_convenience(tctx->lp_ctx), tctx, &r), "smbcli_rap_netuserpasswordset2 failed"); if (!W_ERROR_IS_OK(W_ERROR(r.out.status))) { torture_warning(tctx, "RAP NetUserPasswordSet2 gave: %s\n", @@ -92,7 +92,7 @@ static bool test_userpasswordset2_crypt_args(struct torture_context *tctx, torture_comment(tctx, "Testing rap_NetUserPasswordSet2(%s)\n", r.in.UserName); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netuserpasswordset2(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netuserpasswordset2(cli->tree, lpcfg_iconv_convenience(tctx->lp_ctx), tctx, &r), "smbcli_rap_netuserpasswordset2 failed"); if (!W_ERROR_IS_OK(W_ERROR(r.out.status))) { torture_warning(tctx, "RAP NetUserPasswordSet2 gave: %s\n", @@ -151,7 +151,7 @@ static bool test_oemchangepassword_args(struct torture_context *tctx, torture_comment(tctx, "Testing rap_NetOEMChangePassword(%s)\n", r.in.UserName); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netoemchangepassword(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netoemchangepassword(cli->tree, lpcfg_iconv_convenience(tctx->lp_ctx), tctx, &r), "smbcli_rap_netoemchangepassword failed"); if (!W_ERROR_IS_OK(W_ERROR(r.out.status))) { torture_warning(tctx, "RAP NetOEMChangePassword gave: %s\n", diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index bcc030b5ab..3a828d868a 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -154,18 +154,18 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct } io2.in.dest_host = torture_setting_string(tctx, "host", NULL); - io2.in.ports = lp_smb_ports(tctx->lp_ctx); + io2.in.ports = lpcfg_smb_ports(tctx->lp_ctx); io2.in.called_name = torture_setting_string(tctx, "host", NULL); io2.in.service = torture_setting_string(tctx, "share", NULL); io2.in.service_type = "A:"; io2.in.credentials = cmdline_credentials; - io2.in.workgroup = lp_workgroup(tctx->lp_ctx); + io2.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); io2.in.filename = fname; - io2.in.resolve_ctx = lp_resolve_context(tctx->lp_ctx); - io2.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx); - lp_smbcli_options(tctx->lp_ctx, &io2.in.options); - lp_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options); + io2.in.resolve_ctx = lpcfg_resolve_context(tctx->lp_ctx); + io2.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); + lpcfg_smbcli_options(tctx->lp_ctx, &io2.in.options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options); printf("Testing parallel fetchfile with %d ops\n", torture_numops); @@ -346,15 +346,15 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx) bool ret = true; io1.in.dest_host = torture_setting_string(tctx, "host", NULL); - io1.in.dest_ports = lp_smb_ports(tctx->lp_ctx); - io1.in.socket_options = lp_socket_options(tctx->lp_ctx); + io1.in.dest_ports = lpcfg_smb_ports(tctx->lp_ctx); + io1.in.socket_options = lpcfg_socket_options(tctx->lp_ctx); io1.in.called_name = torture_setting_string(tctx, "host", NULL); io1.in.service = torture_setting_string(tctx, "share", NULL); io1.in.service_type = "A:"; io1.in.credentials = cmdline_credentials; - io1.in.workgroup = lp_workgroup(tctx->lp_ctx); + io1.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); io1.in.level = RAW_QFS_OBJECTID_INFORMATION; - io1.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx); + io1.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); printf("Testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops); @@ -363,7 +363,7 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx) c = talloc_array(tctx, struct composite_context *, torture_numops); for (i=0; itree, &io1, lp_resolve_context(tctx->lp_ctx)); + c[i] = smb_composite_fsinfo_send(cli->tree, &io1, lpcfg_resolve_context(tctx->lp_ctx)); c[i]->async.fn = loadfile_complete; c[i]->async.private_data = count; } diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c index 1335b7d461..cda8b15d8d 100644 --- a/source4/torture/raw/context.c +++ b/source4/torture/raw/context.c @@ -89,14 +89,14 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx) printf("create a second security context on the same transport\n"); - lp_smbcli_session_options(tctx->lp_ctx, &options); - gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx); + lpcfg_smbcli_session_options(tctx->lp_ctx, &options); + gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); session = smbcli_session_init(cli->transport, tctx, false, options); setup.in.sesskey = cli->transport->negotiate.sesskey; setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */ - setup.in.workgroup = lp_workgroup(tctx->lp_ctx); + setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); setup.in.credentials = cmdline_credentials; setup.in.gensec_settings = gensec_settings; @@ -112,7 +112,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx) session2->vuid = session->vuid; setup.in.sesskey = cli->transport->negotiate.sesskey; setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */ - setup.in.workgroup = lp_workgroup(tctx->lp_ctx); + setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); setup.in.credentials = cmdline_credentials; @@ -139,7 +139,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx) session3->vuid = session->vuid; setup.in.sesskey = cli->transport->negotiate.sesskey; setup.in.capabilities &= ~CAP_EXTENDED_SECURITY; /* force a non extended security login (should fail) */ - setup.in.workgroup = lp_workgroup(tctx->lp_ctx); + setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); setup.in.credentials = cmdline_credentials; @@ -152,7 +152,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx) session4->vuid = session->vuid; setup.in.sesskey = cli->transport->negotiate.sesskey; setup.in.capabilities &= ~CAP_EXTENDED_SECURITY; /* force a non extended security login (should fail) */ - setup.in.workgroup = lp_workgroup(tctx->lp_ctx); + setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); anon_creds = cli_credentials_init(tctx); cli_credentials_set_conf(anon_creds, tctx->lp_ctx); @@ -229,7 +229,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx) for (i=0; i transport->negotiate.sesskey; setups[i].in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */ - setups[i].in.workgroup = lp_workgroup(tctx->lp_ctx); + setups[i].in.workgroup = lpcfg_workgroup(tctx->lp_ctx); setups[i].in.credentials = cmdline_credentials; setups[i].in.gensec_settings = gensec_settings; @@ -394,15 +394,15 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context * share = torture_setting_string(tctx, "share", NULL); host = torture_setting_string(tctx, "host", NULL); - lp_smbcli_session_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &options); printf("create the first new sessions\n"); session1 = smbcli_session_init(cli->transport, tctx, false, options); setup.in.sesskey = cli->transport->negotiate.sesskey; setup.in.capabilities = cli->transport->negotiate.capabilities; - setup.in.workgroup = lp_workgroup(tctx->lp_ctx); + setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); setup.in.credentials = cmdline_credentials; - setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx); + setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); status = smb_composite_sesssetup(session1, &setup); CHECK_STATUS(status, NT_STATUS_OK); session1->vuid = setup.out.vuid; @@ -457,9 +457,9 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context * session2 = smbcli_session_init(cli->transport, tctx, false, options); setup.in.sesskey = cli->transport->negotiate.sesskey; setup.in.capabilities = cli->transport->negotiate.capabilities; - setup.in.workgroup = lp_workgroup(tctx->lp_ctx); + setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); setup.in.credentials = cmdline_credentials; - setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx); + setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); status = smb_composite_sesssetup(session2, &setup); CHECK_STATUS(status, NT_STATUS_OK); session2->vuid = setup.out.vuid; @@ -651,16 +651,16 @@ static bool test_pid_2sess(struct smbcli_state *cli, struct torture_context *tct return false; } - lp_smbcli_session_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &options); printf("create a second security context on the same transport\n"); session = smbcli_session_init(cli->transport, tctx, false, options); setup.in.sesskey = cli->transport->negotiate.sesskey; setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */ - setup.in.workgroup = lp_workgroup(tctx->lp_ctx); + setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); setup.in.credentials = cmdline_credentials; - setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx); + setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); status = smb_composite_sesssetup(session, &setup); CHECK_STATUS(status, NT_STATUS_OK); @@ -903,9 +903,9 @@ bool torture_raw_context(struct torture_context *torture, struct smbcli_state *cli) { bool ret = true; - if (lp_use_spnego(torture->lp_ctx)) { + if (lpcfg_use_spnego(torture->lp_ctx)) { ret &= torture_raw_context_int(torture, cli); - lp_set_cmdline(torture->lp_ctx, "use spnego", "False"); + lpcfg_set_cmdline(torture->lp_ctx, "use spnego", "False"); } ret &= torture_raw_context_int(torture, cli); diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c index 02076dfbb8..1d25fb4b3a 100644 --- a/source4/torture/raw/lock.c +++ b/source4/torture/raw/lock.c @@ -513,7 +513,7 @@ static bool test_async(struct torture_context *tctx, return false; } - lp_smbcli_session_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &options); torture_comment(tctx, "Testing LOCKING_ANDX_CANCEL_LOCK\n"); io.generic.level = RAW_LOCK_LOCKX; @@ -802,9 +802,9 @@ static bool test_async(struct torture_context *tctx, session = smbcli_session_init(cli->transport, tctx, false, options); setup.in.sesskey = cli->transport->negotiate.sesskey; setup.in.capabilities = cli->transport->negotiate.capabilities; - setup.in.workgroup = lp_workgroup(tctx->lp_ctx); + setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); setup.in.credentials = cmdline_credentials; - setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx); + setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); status = smb_composite_sesssetup(session, &setup); CHECK_STATUS(status, NT_STATUS_OK); session->vuid = setup.out.vuid; diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c index 315e4241f9..91ce67dbd3 100644 --- a/source4/torture/raw/lockbench.c +++ b/source4/torture/raw/lockbench.c @@ -187,23 +187,23 @@ static void reopen_connection(struct tevent_context *ev, struct tevent_timer *te io->in.dest_host = state->dest_host; io->in.dest_ports = state->dest_ports; - io->in.gensec_settings = lp_gensec_settings(state->mem_ctx, state->tctx->lp_ctx); - io->in.socket_options = lp_socket_options(state->tctx->lp_ctx); + io->in.gensec_settings = lpcfg_gensec_settings(state->mem_ctx, state->tctx->lp_ctx); + io->in.socket_options = lpcfg_socket_options(state->tctx->lp_ctx); io->in.called_name = state->called_name; io->in.service = share; io->in.service_type = state->service_type; io->in.credentials = cmdline_credentials; io->in.fallback_to_anonymous = false; - io->in.workgroup = lp_workgroup(state->tctx->lp_ctx); - lp_smbcli_options(state->tctx->lp_ctx, &io->in.options); - lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options); + io->in.workgroup = lpcfg_workgroup(state->tctx->lp_ctx); + lpcfg_smbcli_options(state->tctx->lp_ctx, &io->in.options); + lpcfg_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options); /* kill off the remnants of the old connection */ talloc_free(state->tree); state->tree = NULL; ctx = smb_composite_connect_send(io, state->mem_ctx, - lp_resolve_context(state->tctx->lp_ctx), + lpcfg_resolve_context(state->tctx->lp_ctx), state->ev); if (ctx == NULL) { DEBUG(0,("Failed to setup async reconnect\n")); diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c index 837b7c345a..749d157c31 100644 --- a/source4/torture/raw/openbench.c +++ b/source4/torture/raw/openbench.c @@ -130,16 +130,16 @@ static void reopen_connection(struct tevent_context *ev, struct tevent_timer *te io->in.dest_host = state->dest_host; io->in.dest_ports = state->dest_ports; - io->in.socket_options = lp_socket_options(state->tctx->lp_ctx); + io->in.socket_options = lpcfg_socket_options(state->tctx->lp_ctx); io->in.called_name = state->called_name; io->in.service = share; io->in.service_type = state->service_type; io->in.credentials = cmdline_credentials; io->in.fallback_to_anonymous = false; - io->in.workgroup = lp_workgroup(state->tctx->lp_ctx); - io->in.gensec_settings = lp_gensec_settings(state->mem_ctx, state->tctx->lp_ctx); - lp_smbcli_options(state->tctx->lp_ctx, &io->in.options); - lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options); + io->in.workgroup = lpcfg_workgroup(state->tctx->lp_ctx); + io->in.gensec_settings = lpcfg_gensec_settings(state->mem_ctx, state->tctx->lp_ctx); + lpcfg_smbcli_options(state->tctx->lp_ctx, &io->in.options); + lpcfg_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options); /* kill off the remnants of the old connection */ talloc_free(state->tree); @@ -148,7 +148,7 @@ static void reopen_connection(struct tevent_context *ev, struct tevent_timer *te state->close_fnum = -1; ctx = smb_composite_connect_send(io, state->mem_ctx, - lp_resolve_context(state->tctx->lp_ctx), + lpcfg_resolve_context(state->tctx->lp_ctx), state->ev); if (ctx == NULL) { DEBUG(0,("Failed to setup async reconnect\n")); diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c index 2a1d8e5ace..835a1b27b6 100644 --- a/source4/torture/raw/oplock.c +++ b/source4/torture/raw/oplock.c @@ -176,19 +176,19 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx, struct smbcli_options options; struct smbcli_session_options session_options; - lp_smbcli_options(tctx->lp_ctx, &options); - lp_smbcli_session_options(tctx->lp_ctx, &session_options); + lpcfg_smbcli_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options); options.use_level2_oplocks = false; status = smbcli_full_connection(tctx, c, torture_setting_string(tctx, "host", NULL), - lp_smb_ports(tctx->lp_ctx), + lpcfg_smb_ports(tctx->lp_ctx), torture_setting_string(tctx, "share", NULL), - NULL, lp_socket_options(tctx->lp_ctx), cmdline_credentials, - lp_resolve_context(tctx->lp_ctx), + NULL, lpcfg_socket_options(tctx->lp_ctx), cmdline_credentials, + lpcfg_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, - lp_gensec_settings(tctx, tctx->lp_ctx)); + lpcfg_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_comment(tctx, "Failed to open connection - %s\n", nt_errstr(status)); diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c index ca2254b634..603c9f6f03 100644 --- a/source4/torture/raw/samba3misc.c +++ b/source4/torture/raw/samba3misc.c @@ -346,9 +346,9 @@ bool torture_samba3_badpath(struct torture_context *torture) return false; } - nt_status_support = lp_nt_status_support(torture->lp_ctx); + nt_status_support = lpcfg_nt_status_support(torture->lp_ctx); - if (!lp_set_cmdline(torture->lp_ctx, "nt status support", "yes")) { + if (!lpcfg_set_cmdline(torture->lp_ctx, "nt status support", "yes")) { printf("Could not set 'nt status support = yes'\n"); goto fail; } @@ -357,7 +357,7 @@ bool torture_samba3_badpath(struct torture_context *torture) goto fail; } - if (!lp_set_cmdline(torture->lp_ctx, "nt status support", "no")) { + if (!lpcfg_set_cmdline(torture->lp_ctx, "nt status support", "no")) { printf("Could not set 'nt status support = yes'\n"); goto fail; } @@ -366,7 +366,7 @@ bool torture_samba3_badpath(struct torture_context *torture) goto fail; } - if (!lp_set_cmdline(torture->lp_ctx, "nt status support", + if (!lpcfg_set_cmdline(torture->lp_ctx, "nt status support", nt_status_support ? "yes":"no")) { printf("Could not reset 'nt status support = yes'"); goto fail; diff --git a/source4/torture/raw/tconrate.c b/source4/torture/raw/tconrate.c index 66fc3c01d6..7202943969 100644 --- a/source4/torture/raw/tconrate.c +++ b/source4/torture/raw/tconrate.c @@ -70,8 +70,8 @@ static int fork_tcon_client(struct torture_context *tctx, struct smbcli_options options; struct smbcli_session_options session_options; - lp_smbcli_options(tctx->lp_ctx, &options); - lp_smbcli_session_options(tctx->lp_ctx, &session_options); + lpcfg_smbcli_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options); child = fork(); if (child == -1) { @@ -98,11 +98,11 @@ static int fork_tcon_client(struct torture_context *tctx, NTSTATUS status; status = smbcli_full_connection(NULL, &cli, - host, lp_smb_ports(tctx->lp_ctx), share, - NULL, lp_socket_options(tctx->lp_ctx), cmdline_credentials, - lp_resolve_context(tctx->lp_ctx), + host, lpcfg_smb_ports(tctx->lp_ctx), share, + NULL, lpcfg_socket_options(tctx->lp_ctx), cmdline_credentials, + lpcfg_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, - lp_gensec_settings(tctx, tctx->lp_ctx)); + lpcfg_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", diff --git a/source4/torture/rpc/countcalls.c b/source4/torture/rpc/countcalls.c index 7d3c9d7b86..7f3735105c 100644 --- a/source4/torture/rpc/countcalls.c +++ b/source4/torture/rpc/countcalls.c @@ -101,7 +101,7 @@ bool torture_rpc_countcalls(struct torture_context *torture) const char *iface_name; bool ret = true; const struct ndr_interface_list *l; - iface_name = lp_parm_string(torture->lp_ctx, NULL, "countcalls", "interface"); + iface_name = lpcfg_parm_string(torture->lp_ctx, NULL, "countcalls", "interface"); if (iface_name != NULL) { iface = ndr_table_by_name(iface_name); if (!iface) { diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c index 105af1cab2..49202a6382 100644 --- a/source4/torture/rpc/drsuapi.c +++ b/source4/torture/rpc/drsuapi.c @@ -575,7 +575,7 @@ static bool test_DsGetNCChanges(struct torture_context *tctx, r.in.req->req5.highwatermark.highest_usn = 0; r.in.req->req5.uptodateness_vector = NULL; r.in.req->req5.replica_flags = 0; - if (lp_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "compression", false)) { + if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "compression", false)) { r.in.req->req5.replica_flags |= DRSUAPI_DRS_USE_COMPRESSION; } r.in.req->req5.max_object_count = 0; @@ -598,10 +598,10 @@ static bool test_DsGetNCChanges(struct torture_context *tctx, r.in.req->req8.highwatermark.highest_usn = 0; r.in.req->req8.uptodateness_vector = NULL; r.in.req->req8.replica_flags = 0; - if (lp_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "compression", false)) { + if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "compression", false)) { r.in.req->req8.replica_flags |= DRSUAPI_DRS_USE_COMPRESSION; } - if (lp_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "neighbour_writeable", true)) { + if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "neighbour_writeable", true)) { r.in.req->req8.replica_flags |= DRSUAPI_DRS_WRIT_REP; } r.in.req->req8.replica_flags |= DRSUAPI_DRS_INIT_SYNC diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c index 49400bc105..5e5929f734 100644 --- a/source4/torture/rpc/dssync.c +++ b/source4/torture/rpc/dssync.c @@ -104,7 +104,7 @@ static struct DsSyncTest *test_create_context(struct torture_context *tctx) make_nbt_name_server(&name, ctx->drsuapi_binding->host); /* do an initial name resolution to find its IP */ - status = resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, + status = resolve_name(lpcfg_resolve_context(tctx->lp_ctx), &name, tctx, &ctx->dest_address, tctx->ev); if (!NT_STATUS_IS_OK(status)) { printf("Failed to resolve %s - %s\n", @@ -164,7 +164,7 @@ static struct DsSyncTest *test_create_context(struct torture_context *tctx) our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3; our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7; our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT; - if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "xpress", false)) { + if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "xpress", false)) { our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS; } our_bind_info28->site_guid = GUID_zero(); @@ -272,7 +272,7 @@ static bool test_LDAPBind(struct torture_context *tctx, struct DsSyncTest *ctx, ldb_set_modules_dir(ldb, talloc_asprintf(ldb, "%s/ldb", - lp_modulesdir(tctx->lp_ctx))); + lpcfg_modulesdir(tctx->lp_ctx))); if (ldb_set_opaque(ldb, "credentials", credentials)) { talloc_free(ldb); @@ -311,11 +311,11 @@ static bool test_GetInfo(struct torture_context *tctx, struct DsSyncTest *ctx) ret2 = tsocket_address_inet_from_strings(tctx, "ip", ctx->dest_address, - lp_cldap_port(tctx->lp_ctx), + lpcfg_cldap_port(tctx->lp_ctx), &dest_addr); if (ret2 != 0) { printf("failed to create tsocket_address for '%s' port %u - %s\n", - ctx->drsuapi_binding->host, lp_cldap_port(tctx->lp_ctx), + ctx->drsuapi_binding->host, lpcfg_cldap_port(tctx->lp_ctx), strerror(errno)); return false; } @@ -337,7 +337,7 @@ static bool test_GetInfo(struct torture_context *tctx, struct DsSyncTest *ctx) r.in.req->req1.format_flags = DRSUAPI_DS_NAME_FLAG_NO_FLAGS; r.in.req->req1.format_offered = DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT; r.in.req->req1.format_desired = DRSUAPI_DS_NAME_FORMAT_FQDN_1779; - names[0].str = talloc_asprintf(ctx, "%s\\", lp_workgroup(tctx->lp_ctx)); + names[0].str = talloc_asprintf(ctx, "%s\\", lpcfg_workgroup(tctx->lp_ctx)); r.out.level_out = &level_out; r.out.ctr = &ctr; @@ -600,12 +600,12 @@ static bool test_analyse_objects(struct torture_context *tctx, talloc_free(search_req); } - if (!lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) { + if (!lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) { talloc_free(objs); return true; } - save_values_dir = lp_parm_string(tctx->lp_ctx, NULL, "dssync", "save_pwd_blobs_dir"); + save_values_dir = lpcfg_parm_string(tctx->lp_ctx, NULL, "dssync", "save_pwd_blobs_dir"); for (cur = first_object; cur; cur = cur->next_object) { const char *dn; @@ -773,17 +773,17 @@ static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx) ZERO_STRUCT(null_guid); ZERO_STRUCT(null_sid); - partition = lp_parm_string(tctx->lp_ctx, NULL, "dssync", "partition"); + partition = lpcfg_parm_string(tctx->lp_ctx, NULL, "dssync", "partition"); if (partition == NULL) { partition = ctx->domain_dn; printf("dssync:partition not specified, defaulting to %s.\n", ctx->domain_dn); } - highest_usn = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "highest_usn", 0); + highest_usn = lpcfg_parm_int(tctx->lp_ctx, NULL, "dssync", "highest_usn", 0); - array[0].level = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "get_nc_changes_level", array[0].level); + array[0].level = lpcfg_parm_int(tctx->lp_ctx, NULL, "dssync", "get_nc_changes_level", array[0].level); - if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) { + if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) { const struct samr_Password *nthash; nthash = cli_credentials_get_nt_hash(ctx->new_dc.credentials, ctx); if (nthash) { @@ -819,10 +819,10 @@ static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx) r.in.req->req5.highwatermark.highest_usn = highest_usn; r.in.req->req5.uptodateness_vector = NULL; r.in.req->req5.replica_flags = 0; - if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) { + if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) { r.in.req->req5.replica_flags |= DRSUAPI_DRS_USE_COMPRESSION; } - if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "neighbour_writeable", true)) { + if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "neighbour_writeable", true)) { r.in.req->req5.replica_flags |= DRSUAPI_DRS_WRIT_REP; } r.in.req->req5.replica_flags |= DRSUAPI_DRS_INIT_SYNC @@ -851,10 +851,10 @@ static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx) r.in.req->req8.highwatermark.highest_usn = highest_usn; r.in.req->req8.uptodateness_vector = NULL; r.in.req->req8.replica_flags = 0; - if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) { + if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) { r.in.req->req8.replica_flags |= DRSUAPI_DRS_USE_COMPRESSION; } - if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "neighbour_writeable", true)) { + if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "neighbour_writeable", true)) { r.in.req->req8.replica_flags |= DRSUAPI_DRS_WRIT_REP; } r.in.req->req8.replica_flags |= DRSUAPI_DRS_INIT_SYNC @@ -996,11 +996,11 @@ static bool test_FetchNT4Data(struct torture_context *tctx, r.out.info = &info; r.out.level_out = &level_out; - req.req1.flags = lp_parm_int(tctx->lp_ctx, NULL, + req.req1.flags = lpcfg_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4changelog_flags", DRSUAPI_NT4_CHANGELOG_GET_CHANGELOG | DRSUAPI_NT4_CHANGELOG_GET_SERIAL_NUMBERS); - req.req1.preferred_maximum_length = lp_parm_int(tctx->lp_ctx, NULL, + req.req1.preferred_maximum_length = lpcfg_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4changelog_preferred_len", 0x00004000); diff --git a/source4/torture/rpc/frsapi.c b/source4/torture/rpc/frsapi.c index e56dd5822b..bb2c9d8a1e 100644 --- a/source4/torture/rpc/frsapi.c +++ b/source4/torture/rpc/frsapi.c @@ -194,7 +194,7 @@ static bool test_ForceReplication(struct torture_context *tctx, r.in.replica_set_guid = NULL; r.in.connection_guid = NULL; - r.in.replica_set_name = lp_dnsdomain(tctx->lp_ctx); + r.in.replica_set_name = lpcfg_dnsdomain(tctx->lp_ctx); r.in.partner_dns_name = dcerpc_server_name(p); torture_assert_ntstatus_ok(tctx, diff --git a/source4/torture/rpc/join.c b/source4/torture/rpc/join.c index 09519d03a5..6e0afcac28 100644 --- a/source4/torture/rpc/join.c +++ b/source4/torture/rpc/join.c @@ -31,17 +31,17 @@ bool torture_rpc_join(struct torture_context *torture) return false; } - lp_smbcli_options(torture->lp_ctx, &options); - lp_smbcli_session_options(torture->lp_ctx, &session_options); + lpcfg_smbcli_options(torture->lp_ctx, &options); + lpcfg_smbcli_session_options(torture->lp_ctx, &session_options); status = smbcli_full_connection(tj, &cli, host, - lp_smb_ports(torture->lp_ctx), + lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, - lp_socket_options(torture->lp_ctx), + lpcfg_socket_options(torture->lp_ctx), machine_account, - lp_resolve_context(torture->lp_ctx), + lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_gensec_settings(torture, torture->lp_ctx)); + lpcfg_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n", TORTURE_NETBIOS_NAME)); @@ -63,13 +63,13 @@ bool torture_rpc_join(struct torture_context *torture) } status = smbcli_full_connection(tj, &cli, host, - lp_smb_ports(torture->lp_ctx), + lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, - lp_socket_options(torture->lp_ctx), + lpcfg_socket_options(torture->lp_ctx), machine_account, - lp_resolve_context(torture->lp_ctx), + lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_gensec_settings(torture, torture->lp_ctx)); + lpcfg_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n", TORTURE_NETBIOS_NAME)); diff --git a/source4/torture/rpc/mgmt.c b/source4/torture/rpc/mgmt.c index fa30ee154f..1b60832568 100644 --- a/source4/torture/rpc/mgmt.c +++ b/source4/torture/rpc/mgmt.c @@ -230,7 +230,7 @@ bool torture_rpc_mgmt(struct torture_context *torture) continue; } - lp_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(loop_ctx, b)); + lpcfg_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(loop_ctx, b)); status = torture_rpc_connection(torture, &p, &ndr_table_mgmt); if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 32c16f94e6..1ebce03d80 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -698,11 +698,11 @@ static bool test_netlogon_ops_args(struct dcerpc_pipe *p, struct torture_context int i; struct dcerpc_binding_handle *b = p->binding_handle; int flags = CLI_CRED_NTLM_AUTH; - if (lp_client_lanman_auth(tctx->lp_ctx)) { + if (lpcfg_client_lanman_auth(tctx->lp_ctx)) { flags |= CLI_CRED_LANMAN_AUTH; } - if (lp_client_ntlmv2_auth(tctx->lp_ctx)) { + if (lpcfg_client_ntlmv2_auth(tctx->lp_ctx)) { flags |= CLI_CRED_NTLMv2_AUTH; } @@ -1602,7 +1602,7 @@ static bool test_GetDcName(struct torture_context *tctx, struct dcerpc_binding_handle *b = p->binding_handle; r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); - r.in.domainname = lp_workgroup(tctx->lp_ctx); + r.in.domainname = lpcfg_workgroup(tctx->lp_ctx); r.out.dcname = &dcname; torture_assert_ntstatus_ok(tctx, dcerpc_netr_GetDcName_r(b, tctx, &r), @@ -1787,7 +1787,7 @@ static bool test_GetAnyDCName(struct torture_context *tctx, const char *dcname = NULL; struct dcerpc_binding_handle *b = p->binding_handle; - r.in.domainname = lp_workgroup(tctx->lp_ctx); + r.in.domainname = lpcfg_workgroup(tctx->lp_ctx); r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); r.out.dcname = &dcname; @@ -1839,7 +1839,7 @@ static bool test_LogonControl2(struct torture_context *tctx, int i; struct dcerpc_binding_handle *b = p->binding_handle; - data.domain = lp_workgroup(tctx->lp_ctx); + data.domain = lpcfg_workgroup(tctx->lp_ctx); r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); @@ -1857,7 +1857,7 @@ static bool test_LogonControl2(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "LogonControl"); } - data.domain = lp_workgroup(tctx->lp_ctx); + data.domain = lpcfg_workgroup(tctx->lp_ctx); r.in.function_code = NETLOGON_CONTROL_TC_QUERY; r.in.data = &data; @@ -1872,7 +1872,7 @@ static bool test_LogonControl2(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "LogonControl"); } - data.domain = lp_workgroup(tctx->lp_ctx); + data.domain = lpcfg_workgroup(tctx->lp_ctx); r.in.function_code = NETLOGON_CONTROL_TRANSPORT_NOTIFY; r.in.data = &data; @@ -1991,7 +1991,7 @@ static bool test_LogonControl2Ex(struct torture_context *tctx, int i; struct dcerpc_binding_handle *b = p->binding_handle; - data.domain = lp_workgroup(tctx->lp_ctx); + data.domain = lpcfg_workgroup(tctx->lp_ctx); r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); @@ -2009,7 +2009,7 @@ static bool test_LogonControl2Ex(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "LogonControl"); } - data.domain = lp_workgroup(tctx->lp_ctx); + data.domain = lpcfg_workgroup(tctx->lp_ctx); r.in.function_code = NETLOGON_CONTROL_TC_QUERY; r.in.data = &data; @@ -2024,7 +2024,7 @@ static bool test_LogonControl2Ex(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "LogonControl"); } - data.domain = lp_workgroup(tctx->lp_ctx); + data.domain = lpcfg_workgroup(tctx->lp_ctx); r.in.function_code = NETLOGON_CONTROL_TRANSPORT_NOTIFY; r.in.data = &data; @@ -2249,7 +2249,7 @@ static bool test_netr_DsRGetDCName(struct torture_context *tctx, struct dcerpc_binding_handle *b = p->binding_handle; r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); - r.in.domain_name = lp_dnsdomain(tctx->lp_ctx); + r.in.domain_name = lpcfg_dnsdomain(tctx->lp_ctx); r.in.domain_guid = NULL; r.in.site_guid = NULL; r.in.flags = DS_RETURN_DNS_NAME; @@ -2259,7 +2259,7 @@ static bool test_netr_DsRGetDCName(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "DsRGetDCName"); torture_assert_werr_ok(tctx, r.out.result, "DsRGetDCName"); - r.in.domain_name = lp_workgroup(tctx->lp_ctx); + r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx); status = dcerpc_netr_DsRGetDCName_r(b, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "DsRGetDCName"); @@ -2282,7 +2282,7 @@ static bool test_netr_DsRGetDCNameEx(struct torture_context *tctx, struct dcerpc_binding_handle *b = p->binding_handle; r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); - r.in.domain_name = lp_dnsdomain(tctx->lp_ctx); + r.in.domain_name = lpcfg_dnsdomain(tctx->lp_ctx); r.in.domain_guid = NULL; r.in.site_name = NULL; r.in.flags = DS_RETURN_DNS_NAME; @@ -2292,7 +2292,7 @@ static bool test_netr_DsRGetDCNameEx(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "netr_DsRGetDCNameEx"); torture_assert_werr_ok(tctx, r.out.result, "netr_DsRGetDCNameEx"); - r.in.domain_name = lp_workgroup(tctx->lp_ctx); + r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx); status = dcerpc_netr_DsRGetDCNameEx_r(b, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "netr_DsRGetDCNameEx"); @@ -2325,7 +2325,7 @@ static bool test_netr_DsRGetDCNameEx2(struct torture_context *tctx, r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); r.in.client_account = NULL; r.in.mask = 0x00000000; - r.in.domain_name = lp_dnsdomain(tctx->lp_ctx); + r.in.domain_name = lpcfg_dnsdomain(tctx->lp_ctx); r.in.domain_guid = NULL; r.in.site_name = NULL; r.in.flags = DS_RETURN_DNS_NAME; @@ -2337,7 +2337,7 @@ static bool test_netr_DsRGetDCNameEx2(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "netr_DsRGetDCNameEx2"); torture_assert_werr_ok(tctx, r.out.result, "netr_DsRGetDCNameEx2"); - r.in.domain_name = lp_workgroup(tctx->lp_ctx); + r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx); status = dcerpc_netr_DsRGetDCNameEx2_r(b, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "netr_DsRGetDCNameEx2"); @@ -2875,7 +2875,7 @@ static bool test_GetDomainInfo(struct torture_context *tctx, ZERO_STRUCT(q1); q1.dns_hostname = talloc_asprintf(tctx, "%s.%s", TEST_MACHINE_NAME, - lp_dnsdomain(tctx->lp_ctx)); + lpcfg_dnsdomain(tctx->lp_ctx)); q1.sitename = "Default-First-Site-Name"; q1.os_version.os = &os; q1.os_name.string = talloc_asprintf(tctx, @@ -2988,7 +2988,7 @@ static bool test_GetDomainInfo(struct torture_context *tctx, /* Change also the DNS hostname to test differences in behaviour */ talloc_free(discard_const_p(char, q1.dns_hostname)); q1.dns_hostname = talloc_asprintf(tctx, "%s2.%s", TEST_MACHINE_NAME, - lp_dnsdomain(tctx->lp_ctx)); + lpcfg_dnsdomain(tctx->lp_ctx)); /* The workstation handles the "servicePrincipalName" and DNS hostname updates */ @@ -3062,7 +3062,7 @@ static bool test_GetDomainInfo(struct torture_context *tctx, /* Change also the DNS hostname to test differences in behaviour */ talloc_free(discard_const_p(char, q1.dns_hostname)); q1.dns_hostname = talloc_asprintf(tctx, "%s2.%s", TEST_MACHINE_NAME, - lp_dnsdomain(tctx->lp_ctx)); + lpcfg_dnsdomain(tctx->lp_ctx)); /* Wipe out the osVersion, and prove which values still 'stick' */ q1.os_version.os = NULL; @@ -3136,7 +3136,7 @@ static bool test_GetDomainInfo(struct torture_context *tctx, /* Put the DNS hostname back */ talloc_free(discard_const_p(char, q1.dns_hostname)); q1.dns_hostname = talloc_asprintf(tctx, "%s.%s", TEST_MACHINE_NAME, - lp_dnsdomain(tctx->lp_ctx)); + lpcfg_dnsdomain(tctx->lp_ctx)); /* The workstation handles the "servicePrincipalName" and DNS hostname updates */ @@ -3251,7 +3251,7 @@ static bool test_GetDomainInfo_async(struct torture_context *tctx, ZERO_STRUCT(q1); q1.dns_hostname = talloc_asprintf(tctx, "%s.%s", TEST_MACHINE_NAME, - lp_dnsdomain(tctx->lp_ctx)); + lpcfg_dnsdomain(tctx->lp_ctx)); q1.sitename = "Default-First-Site-Name"; q1.os_name.string = "UNIX/Linux or similar"; diff --git a/source4/torture/rpc/remote_pac.c b/source4/torture/rpc/remote_pac.c index 8e610a14bf..28ab750e9c 100644 --- a/source4/torture/rpc/remote_pac.c +++ b/source4/torture/rpc/remote_pac.c @@ -86,7 +86,7 @@ static bool test_PACVerify(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "torture_temp_dir failed"); status = gensec_client_start(tctx, &gensec_client_context, tctx->ev, - lp_gensec_settings(tctx, tctx->lp_ctx)); + lpcfg_gensec_settings(tctx, tctx->lp_ctx)); torture_assert_ntstatus_ok(tctx, status, "gensec_client_start (client) failed"); status = gensec_set_target_hostname(gensec_client_context, test_machine_name); @@ -98,7 +98,7 @@ static bool test_PACVerify(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "gensec_start_mech_by_sasl_name (client) failed"); status = gensec_server_start(tctx, tctx->ev, - lp_gensec_settings(tctx, tctx->lp_ctx), + lpcfg_gensec_settings(tctx, tctx->lp_ctx), NULL, &gensec_server_context); torture_assert_ntstatus_ok(tctx, status, "gensec_server_start (server) failed"); @@ -395,7 +395,7 @@ static bool test_S2U4Self(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "torture_temp_dir failed"); status = gensec_client_start(tctx, &gensec_client_context, tctx->ev, - lp_gensec_settings(tctx, tctx->lp_ctx)); + lpcfg_gensec_settings(tctx, tctx->lp_ctx)); torture_assert_ntstatus_ok(tctx, status, "gensec_client_start (client) failed"); status = gensec_set_target_hostname(gensec_client_context, test_machine_name); @@ -407,7 +407,7 @@ static bool test_S2U4Self(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "gensec_start_mech_by_sasl_name (client) failed"); status = gensec_server_start(tctx, tctx->ev, - lp_gensec_settings(tctx, tctx->lp_ctx), + lpcfg_gensec_settings(tctx, tctx->lp_ctx), NULL, &gensec_server_context); torture_assert_ntstatus_ok(tctx, status, "gensec_server_start (server) failed"); @@ -450,7 +450,7 @@ static bool test_S2U4Self(struct torture_context *tctx, cli_credentials_set_impersonate_principal(credentials, cli_credentials_get_principal(cmdline_credentials, tmp_ctx)); status = gensec_client_start(tctx, &gensec_client_context, tctx->ev, - lp_gensec_settings(tctx, tctx->lp_ctx)); + lpcfg_gensec_settings(tctx, tctx->lp_ctx)); torture_assert_ntstatus_ok(tctx, status, "gensec_client_start (client) failed"); status = gensec_set_target_hostname(gensec_client_context, test_machine_name); @@ -463,7 +463,7 @@ static bool test_S2U4Self(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "gensec_start_mech_by_sasl_name (client) failed"); status = gensec_server_start(tctx, tctx->ev, - lp_gensec_settings(tctx, tctx->lp_ctx), + lpcfg_gensec_settings(tctx, tctx->lp_ctx), NULL, &gensec_server_context); torture_assert_ntstatus_ok(tctx, status, "gensec_server_start (server) failed"); diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index d09e80283a..06b5c8c0ef 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -73,18 +73,18 @@ bool torture_bind_authcontext(struct torture_context *torture) return false; } - lp_smbcli_options(torture->lp_ctx, &options); - lp_smbcli_session_options(torture->lp_ctx, &session_options); + lpcfg_smbcli_options(torture->lp_ctx, &options); + lpcfg_smbcli_session_options(torture->lp_ctx, &session_options); status = smbcli_full_connection(mem_ctx, &cli, torture_setting_string(torture, "host", NULL), - lp_smb_ports(torture->lp_ctx), + lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, - lp_socket_options(torture->lp_ctx), + lpcfg_socket_options(torture->lp_ctx), cmdline_credentials, - lp_resolve_context(torture->lp_ctx), + lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_gensec_settings(torture, torture->lp_ctx)); + lpcfg_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_comment(torture, "smbcli_full_connection failed: %s\n", nt_errstr(status)); @@ -162,7 +162,7 @@ bool torture_bind_authcontext(struct torture_context *torture) setup.in.capabilities = cli->transport->negotiate.capabilities; setup.in.workgroup = ""; setup.in.credentials = anon_creds; - setup.in.gensec_settings = lp_gensec_settings(torture, torture->lp_ctx); + setup.in.gensec_settings = lpcfg_gensec_settings(torture, torture->lp_ctx); status = smb_composite_sesssetup(session2, &setup); if (!NT_STATUS_IS_OK(status)) { @@ -237,7 +237,7 @@ static bool bindtest(struct torture_context *tctx, } status = dcerpc_bind_auth(lsa_pipe, &ndr_table_lsarpc, - credentials, lp_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), auth_type, auth_level, + credentials, lpcfg_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), auth_type, auth_level, NULL); if (!NT_STATUS_IS_OK(status)) { torture_comment(tctx, "dcerpc_bind_auth failed: %s\n", nt_errstr(status)); @@ -322,18 +322,18 @@ static bool torture_bind_samba3(struct torture_context *torture) return false; } - lp_smbcli_options(torture->lp_ctx, &options); - lp_smbcli_session_options(torture->lp_ctx, &session_options); + lpcfg_smbcli_options(torture->lp_ctx, &options); + lpcfg_smbcli_session_options(torture->lp_ctx, &session_options); status = smbcli_full_connection(mem_ctx, &cli, torture_setting_string(torture, "host", NULL), - lp_smb_ports(torture->lp_ctx), + lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, - lp_socket_options(torture->lp_ctx), + lpcfg_socket_options(torture->lp_ctx), cmdline_credentials, - lp_resolve_context(torture->lp_ctx), + lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_gensec_settings(torture, torture->lp_ctx)); + lpcfg_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_comment(torture, "smbcli_full_connection failed: %s\n", nt_errstr(status)); @@ -405,7 +405,7 @@ static bool get_usr_handle(struct torture_context *tctx, if (admin_creds != NULL) { torture_assert_ntstatus_ok(tctx, dcerpc_bind_auth(samr_pipe, &ndr_table_samr, - admin_creds, lp_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), auth_type, auth_level, + admin_creds, lpcfg_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), auth_type, auth_level, NULL), "dcerpc_bind_auth failed"); } else { @@ -1085,7 +1085,7 @@ static bool schan(struct torture_context *tctx, #if 1 net_pipe->conn->flags |= (DCERPC_SIGN | DCERPC_SEAL); status = dcerpc_bind_auth(net_pipe, &ndr_table_netlogon, - wks_creds, lp_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), DCERPC_AUTH_TYPE_SCHANNEL, + wks_creds, lpcfg_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), DCERPC_AUTH_TYPE_SCHANNEL, DCERPC_AUTH_LEVEL_PRIVACY, NULL); #else @@ -1324,18 +1324,18 @@ static bool torture_netlogon_samba3(struct torture_context *torture) goto done; } - lp_smbcli_options(torture->lp_ctx, &options); - lp_smbcli_session_options(torture->lp_ctx, &session_options); + lpcfg_smbcli_options(torture->lp_ctx, &options); + lpcfg_smbcli_session_options(torture->lp_ctx, &session_options); status = smbcli_full_connection(mem_ctx, &cli, torture_setting_string(torture, "host", NULL), - lp_smb_ports(torture->lp_ctx), + lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, - lp_socket_options(torture->lp_ctx), + lpcfg_socket_options(torture->lp_ctx), anon_creds, - lp_resolve_context(torture->lp_ctx), + lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_gensec_settings(torture, torture->lp_ctx)); + lpcfg_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_comment(torture, "smbcli_full_connection failed: %s\n", nt_errstr(status)); @@ -1415,16 +1415,16 @@ static bool test_join3(struct torture_context *tctx, struct smbcli_options options; struct smbcli_session_options session_options; - lp_smbcli_options(tctx->lp_ctx, &options); - lp_smbcli_session_options(tctx->lp_ctx, &session_options); + lpcfg_smbcli_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options); status = smbcli_full_connection(tctx, &cli, torture_setting_string(tctx, "host", NULL), - lp_smb_ports(tctx->lp_ctx), - "IPC$", NULL, lp_socket_options(tctx->lp_ctx), - smb_creds, lp_resolve_context(tctx->lp_ctx), + lpcfg_smb_ports(tctx->lp_ctx), + "IPC$", NULL, lpcfg_socket_options(tctx->lp_ctx), + smb_creds, lpcfg_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, - lp_gensec_settings(tctx, tctx->lp_ctx)); + lpcfg_gensec_settings(tctx, tctx->lp_ctx)); torture_assert_ntstatus_ok(tctx, status, "smbcli_full_connection failed"); @@ -1792,15 +1792,15 @@ static bool torture_samba3_rpc_getusername(struct torture_context *torture) return false; } - lp_smbcli_options(torture->lp_ctx, &options); - lp_smbcli_session_options(torture->lp_ctx, &session_options); + lpcfg_smbcli_options(torture->lp_ctx, &options); + lpcfg_smbcli_session_options(torture->lp_ctx, &session_options); status = smbcli_full_connection( mem_ctx, &cli, torture_setting_string(torture, "host", NULL), - lp_smb_ports(torture->lp_ctx), - "IPC$", NULL, lp_socket_options(torture->lp_ctx), cmdline_credentials, - lp_resolve_context(torture->lp_ctx), torture->ev, &options, - &session_options, lp_gensec_settings(torture, torture->lp_ctx)); + lpcfg_smb_ports(torture->lp_ctx), + "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), cmdline_credentials, + lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options, + &session_options, lpcfg_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_warning(torture, "smbcli_full_connection failed: %s\n", nt_errstr(status)); @@ -1823,11 +1823,11 @@ static bool torture_samba3_rpc_getusername(struct torture_context *torture) status = smbcli_full_connection( mem_ctx, &cli, torture_setting_string(torture, "host", NULL), - lp_smb_ports(torture->lp_ctx), "IPC$", NULL, - lp_socket_options(torture->lp_ctx), anon_creds, - lp_resolve_context(torture->lp_ctx), + lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, + lpcfg_socket_options(torture->lp_ctx), anon_creds, + lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_gensec_settings(torture, torture->lp_ctx)); + lpcfg_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_warning(torture, "anon smbcli_full_connection failed: %s\n", nt_errstr(status)); @@ -1889,7 +1889,7 @@ static bool torture_samba3_rpc_getusername(struct torture_context *torture) setup.in.capabilities = cli->transport->negotiate.capabilities; setup.in.workgroup = ""; setup.in.credentials = user_creds; - setup.in.gensec_settings = lp_gensec_settings(torture, torture->lp_ctx); + setup.in.gensec_settings = lpcfg_gensec_settings(torture, torture->lp_ctx); status = smb_composite_sesssetup(session2, &setup); if (!NT_STATUS_IS_OK(status)) { @@ -2756,7 +2756,7 @@ static bool torture_samba3_rpc_spoolss(struct torture_context *torture) ZERO_STRUCT(userlevel1); userlevel1.client = talloc_asprintf( - torture, "\\\\%s", lp_netbios_name(torture->lp_ctx)); + torture, "\\\\%s", lpcfg_netbios_name(torture->lp_ctx)); userlevel1.user = cli_credentials_get_username(cmdline_credentials); userlevel1.build = 2600; userlevel1.major = 3; diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c index cbe1f44f37..0ba0d2633f 100644 --- a/source4/torture/rpc/samlogon.c +++ b/source4/torture/rpc/samlogon.c @@ -1362,8 +1362,8 @@ static bool test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, samlogon_state.account_name = account_name; samlogon_state.account_domain = account_domain; samlogon_state.password = plain_pass; - samlogon_state.workgroup = lp_workgroup(tctx->lp_ctx); - samlogon_state.netbios_name = lp_netbios_name(tctx->lp_ctx); + samlogon_state.workgroup = lpcfg_workgroup(tctx->lp_ctx); + samlogon_state.netbios_name = lpcfg_netbios_name(tctx->lp_ctx); samlogon_state.p = p; samlogon_state.creds = creds; samlogon_state.expected_error = expected_error; @@ -1568,7 +1568,7 @@ static bool handle_minPwdAge(struct torture_context *torture, ld_r.in.connect_handle = &connect_handle; ld_r.in.domain_name = &domName; - ld_r.in.domain_name->string = lp_workgroup(torture->lp_ctx); + ld_r.in.domain_name->string = lpcfg_workgroup(torture->lp_ctx); ld_r.out.sid = &domSid; torture_assert_ntstatus_ok(torture, @@ -1670,7 +1670,7 @@ bool torture_rpc_samlogon(struct torture_context *torture) return false; } - userdomain = torture_setting_string(torture, "userdomain", lp_workgroup(torture->lp_ctx)); + userdomain = torture_setting_string(torture, "userdomain", lpcfg_workgroup(torture->lp_ctx)); user_ctx = torture_create_testuser(torture, TEST_USER_NAME, @@ -1906,7 +1906,7 @@ bool torture_rpc_samlogon(struct torture_context *torture) .username = talloc_asprintf(mem_ctx, "%s@%s", TEST_USER_NAME, - lp_realm(torture->lp_ctx)), + lpcfg_realm(torture->lp_ctx)), .password = user_password, .network_login = true, .expected_interactive_error = NT_STATUS_OK, diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 59f020d164..a34ef4092c 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -2859,11 +2859,11 @@ static bool test_SamLogon(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, dcerpc_schannel_creds(p->conn->security_state.generic_state, tctx, &creds), ""); - if (lp_client_lanman_auth(tctx->lp_ctx)) { + if (lpcfg_client_lanman_auth(tctx->lp_ctx)) { flags |= CLI_CRED_LANMAN_AUTH; } - if (lp_client_ntlmv2_auth(tctx->lp_ctx)) { + if (lpcfg_client_ntlmv2_auth(tctx->lp_ctx)) { flags |= CLI_CRED_NTLMv2_AUTH; } diff --git a/source4/torture/rpc/samr_accessmask.c b/source4/torture/rpc/samr_accessmask.c index 1bdfe22783..63f99f9005 100644 --- a/source4/torture/rpc/samr_accessmask.c +++ b/source4/torture/rpc/samr_accessmask.c @@ -446,7 +446,7 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx, ld.in.connect_handle = &ch; ld.in.domain_name = &dn; ld.out.sid = &sid; - dn.string = lp_workgroup(tctx->lp_ctx); + dn.string = lpcfg_workgroup(tctx->lp_ctx); torture_assert_ntstatus_ok(tctx, dcerpc_samr_LookupDomain_r(b, tctx, &ld), "LookupDomain failed"); @@ -472,7 +472,7 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx, ld.in.connect_handle = &ch; ld.in.domain_name = &dn; ld.out.sid = &sid; - dn.string = lp_workgroup(tctx->lp_ctx); + dn.string = lpcfg_workgroup(tctx->lp_ctx); torture_assert_ntstatus_ok(tctx, dcerpc_samr_LookupDomain_r(b, tctx, &ld), "LookupDomain failed"); @@ -528,7 +528,7 @@ static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx, ld.in.connect_handle = &ch; ld.in.domain_name = &dn; ld.out.sid = &sid; - dn.string = lp_workgroup(tctx->lp_ctx); + dn.string = lpcfg_workgroup(tctx->lp_ctx); torture_assert_ntstatus_ok(tctx, dcerpc_samr_LookupDomain_r(b, tctx, &ld), "LookupDomain failed"); if (!NT_STATUS_IS_OK(ld.out.result)) { @@ -616,7 +616,7 @@ static bool test_samr_connect(struct torture_context *tctx, } /* create a test user */ - testuser = torture_create_testuser(tctx, TEST_USER_NAME, lp_workgroup(tctx->lp_ctx), + testuser = torture_create_testuser(tctx, TEST_USER_NAME, lpcfg_workgroup(tctx->lp_ctx), ACB_NORMAL, &testuser_passwd); if (!testuser) { printf("Failed to create test user\n"); @@ -624,7 +624,7 @@ static bool test_samr_connect(struct torture_context *tctx, } test_credentials = cli_credentials_init(tctx); cli_credentials_set_workstation(test_credentials, "localhost", CRED_SPECIFIED); - cli_credentials_set_domain(test_credentials, lp_workgroup(tctx->lp_ctx), + cli_credentials_set_domain(test_credentials, lpcfg_workgroup(tctx->lp_ctx), CRED_SPECIFIED); cli_credentials_set_username(test_credentials, TEST_USER_NAME, CRED_SPECIFIED); cli_credentials_set_password(test_credentials, testuser_passwd, CRED_SPECIFIED); @@ -1145,7 +1145,7 @@ static bool torture_rpc_samr_workstation_query(struct torture_context *tctx, torture_assert(tctx, test_samr_domain(tctx, b, SEC_FLAG_MAXIMUM_ALLOWED, - lp_workgroup(tctx->lp_ctx), + lpcfg_workgroup(tctx->lp_ctx), &connect_handle, &domain_handle), "failed to test domain"); diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c index 6e0d9471d1..90c451429a 100644 --- a/source4/torture/rpc/samsync.c +++ b/source4/torture/rpc/samsync.c @@ -1548,7 +1548,7 @@ bool torture_rpc_samsync(struct torture_context *torture) test_machine_account = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME); join_ctx = torture_create_testuser(torture, test_machine_account, - lp_workgroup(torture->lp_ctx), ACB_SVRTRUST, + lpcfg_workgroup(torture->lp_ctx), ACB_SVRTRUST, &machine_password); if (!join_ctx) { talloc_free(mem_ctx); @@ -1557,7 +1557,7 @@ bool torture_rpc_samsync(struct torture_context *torture) } test_wksta_machine_account = talloc_asprintf(mem_ctx, "%s$", TEST_WKSTA_MACHINE_NAME); - join_ctx2 = torture_create_testuser(torture, test_wksta_machine_account, lp_workgroup(torture->lp_ctx), ACB_WSTRUST, &wksta_machine_password); + join_ctx2 = torture_create_testuser(torture, test_wksta_machine_account, lpcfg_workgroup(torture->lp_ctx), ACB_WSTRUST, &wksta_machine_password); if (!join_ctx2) { talloc_free(mem_ctx); torture_comment(torture, "Failed to join as member\n"); @@ -1565,7 +1565,7 @@ bool torture_rpc_samsync(struct torture_context *torture) } user_ctx = torture_create_testuser(torture, TEST_USER_NAME, - lp_workgroup(torture->lp_ctx), + lpcfg_workgroup(torture->lp_ctx), ACB_NORMAL, NULL); if (!user_ctx) { talloc_free(mem_ctx); @@ -1591,7 +1591,7 @@ bool torture_rpc_samsync(struct torture_context *torture) ret, failed, "samr_Connect failed"); - domain_policy = samsync_open_domain(torture, mem_ctx, samsync_state, lp_workgroup(torture->lp_ctx), NULL); + domain_policy = samsync_open_domain(torture, mem_ctx, samsync_state, lpcfg_workgroup(torture->lp_ctx), NULL); if (!domain_policy) { torture_comment(torture, "samrsync_open_domain failed\n"); ret = false; @@ -1667,7 +1667,7 @@ bool torture_rpc_samsync(struct torture_context *torture) credentials = cli_credentials_init(mem_ctx); cli_credentials_set_workstation(credentials, TEST_MACHINE_NAME, CRED_SPECIFIED); - cli_credentials_set_domain(credentials, lp_workgroup(torture->lp_ctx), CRED_SPECIFIED); + cli_credentials_set_domain(credentials, lpcfg_workgroup(torture->lp_ctx), CRED_SPECIFIED); cli_credentials_set_username(credentials, test_machine_account, CRED_SPECIFIED); cli_credentials_set_password(credentials, machine_password, CRED_SPECIFIED); cli_credentials_set_secure_channel_type(credentials, @@ -1705,7 +1705,7 @@ bool torture_rpc_samsync(struct torture_context *torture) credentials_wksta = cli_credentials_init(mem_ctx); cli_credentials_set_workstation(credentials_wksta, TEST_WKSTA_MACHINE_NAME, CRED_SPECIFIED); - cli_credentials_set_domain(credentials_wksta, lp_workgroup(torture->lp_ctx), CRED_SPECIFIED); + cli_credentials_set_domain(credentials_wksta, lpcfg_workgroup(torture->lp_ctx), CRED_SPECIFIED); cli_credentials_set_username(credentials_wksta, test_wksta_machine_account, CRED_SPECIFIED); cli_credentials_set_password(credentials_wksta, wksta_machine_password, CRED_SPECIFIED); cli_credentials_set_secure_channel_type(credentials_wksta, diff --git a/source4/torture/rpc/scanner.c b/source4/torture/rpc/scanner.c index c07846cc27..e434da2615 100644 --- a/source4/torture/rpc/scanner.c +++ b/source4/torture/rpc/scanner.c @@ -128,7 +128,7 @@ bool torture_rpc_scanner(struct torture_context *torture) b->endpoint = talloc_strdup(b, l->table->name); } - lp_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(torture, b)); + lpcfg_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(torture, b)); status = torture_rpc_connection(torture, &p, &ndr_table_mgmt); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c index ce903bd7b3..c76231c991 100644 --- a/source4/torture/rpc/schannel.c +++ b/source4/torture/rpc/schannel.c @@ -57,11 +57,11 @@ bool test_netlogon_ex_ops(struct dcerpc_pipe *p, struct torture_context *tctx, int flags = CLI_CRED_NTLM_AUTH; struct dcerpc_binding_handle *b = p->binding_handle; - if (lp_client_lanman_auth(tctx->lp_ctx)) { + if (lpcfg_client_lanman_auth(tctx->lp_ctx)) { flags |= CLI_CRED_LANMAN_AUTH; } - if (lp_client_ntlmv2_auth(tctx->lp_ctx)) { + if (lpcfg_client_ntlmv2_auth(tctx->lp_ctx)) { flags |= CLI_CRED_NTLMv2_AUTH; } @@ -138,7 +138,7 @@ static bool test_samr_ops(struct torture_context *tctx, struct policy_handle handle; struct policy_handle domain_handle; - name.string = lp_workgroup(tctx->lp_ctx); + name.string = lpcfg_workgroup(tctx->lp_ctx); r.in.domain_name = &name; r.out.info = &info; @@ -304,7 +304,7 @@ static bool test_schannel(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "seconday connection"); status = dcerpc_bind_auth(p_netlogon, &ndr_table_netlogon, - credentials, lp_gensec_settings(tctx, tctx->lp_ctx), + credentials, lpcfg_gensec_settings(tctx, tctx->lp_ctx), DCERPC_AUTH_TYPE_SCHANNEL, dcerpc_auth_level(p->conn), NULL); @@ -331,7 +331,7 @@ static bool test_schannel(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "seconday connection"); status = dcerpc_bind_auth(p_lsa, &ndr_table_lsarpc, - credentials, lp_gensec_settings(tctx, tctx->lp_ctx), + credentials, lpcfg_gensec_settings(tctx, tctx->lp_ctx), DCERPC_AUTH_TYPE_SCHANNEL, dcerpc_auth_level(p->conn), NULL); @@ -372,7 +372,7 @@ static bool test_schannel(struct torture_context *tctx, /* and now setup an SCHANNEL bind on netlogon */ status = dcerpc_bind_auth(p_netlogon2, &ndr_table_netlogon, - credentials, lp_gensec_settings(tctx, tctx->lp_ctx), + credentials, lpcfg_gensec_settings(tctx, tctx->lp_ctx), DCERPC_AUTH_TYPE_SCHANNEL, dcerpc_auth_level(p_samr2->conn), NULL); @@ -575,11 +575,11 @@ static bool torture_schannel_bench_start(struct torture_schannel_bench_conn *con user_creds = s->user2_creds; } - if (lp_client_lanman_auth(s->tctx->lp_ctx)) { + if (lpcfg_client_lanman_auth(s->tctx->lp_ctx)) { flags |= CLI_CRED_LANMAN_AUTH; } - if (lp_client_ntlmv2_auth(s->tctx->lp_ctx)) { + if (lpcfg_client_ntlmv2_auth(s->tctx->lp_ctx)) { flags |= CLI_CRED_NTLMv2_AUTH; } diff --git a/source4/torture/rpc/session_key.c b/source4/torture/rpc/session_key.c index 7335c40df3..b7c90e4b4e 100644 --- a/source4/torture/rpc/session_key.c +++ b/source4/torture/rpc/session_key.c @@ -156,9 +156,9 @@ static bool test_secrets(struct torture_context *torture, const void *_data) NTSTATUS status; struct dcerpc_binding_handle *b; - lp_set_cmdline(torture->lp_ctx, "ntlmssp client:keyexchange", settings->keyexchange?"True":"False"); - lp_set_cmdline(torture->lp_ctx, "ntlmssp_client:ntlm2", settings->ntlm2?"True":"False"); - lp_set_cmdline(torture->lp_ctx, "ntlmssp_client:lm_key", settings->lm_key?"True":"False"); + lpcfg_set_cmdline(torture->lp_ctx, "ntlmssp client:keyexchange", settings->keyexchange?"True":"False"); + lpcfg_set_cmdline(torture->lp_ctx, "ntlmssp_client:ntlm2", settings->ntlm2?"True":"False"); + lpcfg_set_cmdline(torture->lp_ctx, "ntlmssp_client:lm_key", settings->lm_key?"True":"False"); torture_assert_ntstatus_ok(torture, torture_rpc_binding(torture, &binding), "Getting bindoptions"); diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 7e1572861d..12dc8240cf 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -8242,20 +8242,20 @@ static bool connect_printer_driver_share(struct torture_context *tctx, torture_comment(tctx, "Connecting printer driver share '%s' on '%s'\n", share_name, server_name); - lp_smbcli_options(tctx->lp_ctx, &smb_options); - lp_smbcli_session_options(tctx->lp_ctx, &smb_session_options); + lpcfg_smbcli_options(tctx->lp_ctx, &smb_options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &smb_session_options); torture_assert_ntstatus_ok(tctx, smbcli_full_connection(tctx, cli, server_name, - lp_smb_ports(tctx->lp_ctx), + lpcfg_smb_ports(tctx->lp_ctx), share_name, NULL, - lp_socket_options(tctx->lp_ctx), + lpcfg_socket_options(tctx->lp_ctx), cmdline_credentials, - lp_resolve_context(tctx->lp_ctx), + lpcfg_resolve_context(tctx->lp_ctx), tctx->ev, &smb_options, &smb_session_options, - lp_gensec_settings(tctx, tctx->lp_ctx)), + lpcfg_gensec_settings(tctx, tctx->lp_ctx)), "failed to open driver share"); return true; diff --git a/source4/torture/rpc/spoolss_access.c b/source4/torture/rpc/spoolss_access.c index f38082c120..08d1375f63 100644 --- a/source4/torture/rpc/spoolss_access.c +++ b/source4/torture/rpc/spoolss_access.c @@ -449,7 +449,7 @@ static bool torture_rpc_spoolss_access_setup_common(struct torture_context *tctx test_credentials = cli_credentials_init(tctx); cli_credentials_set_workstation(test_credentials, "localhost", CRED_SPECIFIED); - cli_credentials_set_domain(test_credentials, lp_workgroup(tctx->lp_ctx), + cli_credentials_set_domain(test_credentials, lpcfg_workgroup(tctx->lp_ctx), CRED_SPECIFIED); cli_credentials_set_username(test_credentials, t->user.username, CRED_SPECIFIED); cli_credentials_set_password(test_credentials, testuser_passwd, CRED_SPECIFIED); diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c index 26faf0abc8..8e23637442 100644 --- a/source4/torture/rpc/spoolss_notify.c +++ b/source4/torture/rpc/spoolss_notify.c @@ -453,9 +453,9 @@ static bool test_start_dcerpc_server(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, dcerpc_register_ep_server(&ep_server), "unable to register spoolss server"); - lp_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss"); + lpcfg_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss"); - load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); address = iface_n_ip(ifaces, 0); torture_comment(tctx, "Listening for callbacks on %s\n", address); diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c index 0e61960fec..c4ab0e43ad 100644 --- a/source4/torture/rpc/testjoin.c +++ b/source4/torture/rpc/testjoin.c @@ -368,7 +368,7 @@ again: u.info21.description.string = talloc_asprintf(join, "Samba4 torture account created by host %s: %s", - lp_netbios_name(torture->lp_ctx), + lpcfg_netbios_name(torture->lp_ctx), timestring(join, time(NULL))); printf("Resetting ACB flags, force pw change time\n"); @@ -425,7 +425,7 @@ _PUBLIC_ struct test_join *torture_join_domain(struct torture_context *tctx, return NULL; } - libnet_ctx = libnet_context_init(tctx->ev, tctx->lp_ctx); + libnet_ctx = libnet_context_init(tctx->ev, tctx->lp_ctx); if (!libnet_ctx) { talloc_free(tj); return NULL; @@ -489,7 +489,7 @@ _PUBLIC_ struct test_join *torture_join_domain(struct torture_context *tctx, u.info21.description.string = talloc_asprintf(tj, "Samba4 torture account created by host %s: %s", - lp_netbios_name(tctx->lp_ctx), timestring(tj, time(NULL))); + lpcfg_netbios_name(tctx->lp_ctx), timestring(tj, time(NULL))); status = dcerpc_samr_SetUserInfo_r(tj->p->binding_handle, tj, &s); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c index a8556c58cf..3121213fca 100644 --- a/source4/torture/rpc/wkssvc.c +++ b/source4/torture/rpc/wkssvc.c @@ -217,7 +217,7 @@ static bool test_NetrWkstaUserGetInfo(struct torture_context *tctx, NTSTATUS status; struct wkssvc_NetrWkstaUserGetInfo r; union wkssvc_NetrWkstaUserInfo info; - const char *dom = lp_workgroup(tctx->lp_ctx); + const char *dom = lpcfg_workgroup(tctx->lp_ctx); struct cli_credentials *creds = cmdline_credentials; const char *user = cli_credentials_get_username(creds); int i; @@ -495,7 +495,7 @@ static bool test_NetrLogonDomainNameAdd(struct torture_context *tctx, struct wkssvc_NetrLogonDomainNameAdd r; struct dcerpc_binding_handle *b = p->binding_handle; - r.in.domain_name = lp_workgroup(tctx->lp_ctx); + r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx); torture_comment(tctx, "Testing NetrLogonDomainNameAdd\n"); @@ -514,7 +514,7 @@ static bool test_NetrLogonDomainNameDel(struct torture_context *tctx, struct wkssvc_NetrLogonDomainNameDel r; struct dcerpc_binding_handle *b = p->binding_handle; - r.in.domain_name = lp_workgroup(tctx->lp_ctx); + r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx); torture_comment(tctx, "Testing NetrLogonDomainNameDel\n"); @@ -610,7 +610,7 @@ static bool test_NetrValidateName(struct torture_context *tctx, for (i=0; ilp_ctx); + r.in.name = lpcfg_workgroup(tctx->lp_ctx); r.in.Account = NULL; r.in.Password = NULL; r.in.name_type = levels[i]; @@ -641,7 +641,7 @@ static bool test_NetrValidateName2(struct torture_context *tctx, for (i=0; ilp_ctx); + r.in.name = lpcfg_workgroup(tctx->lp_ctx); r.in.Account = NULL; r.in.EncryptedPassword = NULL; r.in.name_type = levels[i]; @@ -1075,7 +1075,7 @@ static bool test_NetrGetJoinableOus(struct torture_context *tctx, struct dcerpc_binding_handle *b = p->binding_handle; r.in.server_name = dcerpc_server_name(p); - r.in.domain_name = lp_workgroup(tctx->lp_ctx); + r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx); r.in.Account = NULL; r.in.unknown = NULL; r.in.num_ous = r.out.num_ous = &num_ous; @@ -1102,7 +1102,7 @@ static bool test_NetrGetJoinableOus2(struct torture_context *tctx, struct dcerpc_binding_handle *b = p->binding_handle; r.in.server_name = dcerpc_server_name(p); - r.in.domain_name = lp_workgroup(tctx->lp_ctx); + r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx); r.in.Account = NULL; r.in.EncryptedPassword = NULL; r.in.num_ous = r.out.num_ous = &num_ous; @@ -1130,7 +1130,7 @@ static bool test_NetrUnjoinDomain(struct torture_context *tctx, struct dcerpc_binding_handle *b = p->binding_handle; admin_account = talloc_asprintf(tctx, "%s\\%s", - lp_workgroup(tctx->lp_ctx), + lpcfg_workgroup(tctx->lp_ctx), user); r.in.server_name = dcerpc_server_name(p); @@ -1159,11 +1159,11 @@ static bool test_NetrJoinDomain(struct torture_context *tctx, struct dcerpc_binding_handle *b = p->binding_handle; admin_account = talloc_asprintf(tctx, "%s\\%s", - lp_workgroup(tctx->lp_ctx), + lpcfg_workgroup(tctx->lp_ctx), user); r.in.server_name = dcerpc_server_name(p); - r.in.domain_name = lp_dnsdomain(tctx->lp_ctx); + r.in.domain_name = lpcfg_dnsdomain(tctx->lp_ctx); r.in.account_ou = NULL; r.in.Account = admin_account; r.in.password = NULL; diff --git a/source4/torture/shell.c b/source4/torture/shell.c index 3f48075dba..7c313af178 100644 --- a/source4/torture/shell.c +++ b/source4/torture/shell.c @@ -179,14 +179,14 @@ static void shell_set(const struct shell_command *command, switch (argc) { case 0: - lp_dump(tctx->lp_ctx, stdout, + lpcfg_dump(tctx->lp_ctx, stdout, false /* show_defaults */, 0 /* skip services */); break; case 2: name = talloc_asprintf(NULL, "torture:%s", argv[0]); - lp_set_cmdline(tctx->lp_ctx, name, argv[1]); + lpcfg_set_cmdline(tctx->lp_ctx, name, argv[1]); talloc_free(name); break; diff --git a/source4/torture/smb2/oplock.c b/source4/torture/smb2/oplock.c index 12f16cb166..aa0b92dc80 100644 --- a/source4/torture/smb2/oplock.c +++ b/source4/torture/smb2/oplock.c @@ -284,15 +284,15 @@ static bool open_smb2_connection_no_level2_oplocks(struct torture_context *tctx, struct cli_credentials *credentials = cmdline_credentials; struct smbcli_options options; - lp_smbcli_options(tctx->lp_ctx, &options); + lpcfg_smbcli_options(tctx->lp_ctx, &options); options.use_level2_oplocks = false; status = smb2_connect(tctx, host, - lp_smb_ports(tctx->lp_ctx), share, - lp_resolve_context(tctx->lp_ctx), + lpcfg_smb_ports(tctx->lp_ctx), share, + lpcfg_resolve_context(tctx->lp_ctx), credentials, tree, tctx->ev, &options, - lp_socket_options(tctx->lp_ctx), - lp_gensec_settings(tctx, tctx->lp_ctx)); + lpcfg_socket_options(tctx->lp_ctx), + lpcfg_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_comment(tctx, "Failed to connect to SMB2 share " "\\\\%s\\%s - %s\n", host, share, diff --git a/source4/torture/smb2/scan.c b/source4/torture/smb2/scan.c index a173c6debb..3b132ab8a4 100644 --- a/source4/torture/smb2/scan.c +++ b/source4/torture/smb2/scan.c @@ -201,15 +201,15 @@ bool torture_smb2_scan(struct torture_context *torture) struct smb2_request *req; struct smbcli_options options; - lp_smbcli_options(torture->lp_ctx, &options); + lpcfg_smbcli_options(torture->lp_ctx, &options); status = smb2_connect(mem_ctx, host, - lp_smb_ports(torture->lp_ctx), + lpcfg_smb_ports(torture->lp_ctx), share, - lp_resolve_context(torture->lp_ctx), + lpcfg_resolve_context(torture->lp_ctx), credentials, &tree, torture->ev, &options, - lp_socket_options(torture->lp_ctx), - lp_gensec_settings(torture, torture->lp_ctx)); + lpcfg_socket_options(torture->lp_ctx), + lpcfg_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("Connection failed - %s\n", nt_errstr(status)); return false; @@ -224,12 +224,12 @@ bool torture_smb2_scan(struct torture_context *torture) if (!smb2_request_receive(req)) { talloc_free(tree); status = smb2_connect(mem_ctx, host, - lp_smb_ports(torture->lp_ctx), + lpcfg_smb_ports(torture->lp_ctx), share, - lp_resolve_context(torture->lp_ctx), + lpcfg_resolve_context(torture->lp_ctx), credentials, &tree, torture->ev, &options, - lp_socket_options(torture->lp_ctx), - lp_gensec_settings(mem_ctx, torture->lp_ctx)); + lpcfg_socket_options(torture->lp_ctx), + lpcfg_gensec_settings(mem_ctx, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("Connection failed - %s\n", nt_errstr(status)); return false; diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c index 1dc8fca2b0..96981125c2 100644 --- a/source4/torture/smb2/util.c +++ b/source4/torture/smb2/util.c @@ -270,16 +270,16 @@ bool torture_smb2_connection(struct torture_context *tctx, struct smb2_tree **tr struct cli_credentials *credentials = cmdline_credentials; struct smbcli_options options; - lp_smbcli_options(tctx->lp_ctx, &options); + lpcfg_smbcli_options(tctx->lp_ctx, &options); status = smb2_connect(tctx, host, - lp_smb_ports(tctx->lp_ctx), + lpcfg_smb_ports(tctx->lp_ctx), share, - lp_resolve_context(tctx->lp_ctx), + lpcfg_resolve_context(tctx->lp_ctx), credentials, tree, tctx->ev, &options, - lp_socket_options(tctx->lp_ctx), - lp_gensec_settings(tctx, tctx->lp_ctx) + lpcfg_socket_options(tctx->lp_ctx), + lpcfg_gensec_settings(tctx, tctx->lp_ctx) ); if (!NT_STATUS_IS_OK(status)) { printf("Failed to connect to SMB2 share \\\\%s\\%s - %s\n", diff --git a/source4/torture/smbiconv.c b/source4/torture/smbiconv.c index 173f37175b..f1a7d899a5 100644 --- a/source4/torture/smbiconv.c +++ b/source4/torture/smbiconv.c @@ -205,7 +205,7 @@ int main(int argc, char *argv[]) } } - cd = smb_iconv_open_ex(tctx, to, from, lp_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true)); + cd = smb_iconv_open_ex(tctx, to, from, lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true)); if((int)cd == -1) { DEBUG(0,("unable to find from or to encoding, exiting...\n")); if (out != stdout) fclose(out); diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index 978659990e..a4d206b5bc 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -135,14 +135,14 @@ bool torture_parse_target(struct loadparm_context *lp_ctx, const char *target) d_printf("Invalid option: %s is not a valid torture target (share or binding string)\n\n", target); return false; } - lp_set_cmdline(lp_ctx, "torture:host", binding_struct->host); - if (lp_parm_string(lp_ctx, NULL, "torture", "share") == NULL) - lp_set_cmdline(lp_ctx, "torture:share", "IPC$"); - lp_set_cmdline(lp_ctx, "torture:binding", target); + lpcfg_set_cmdline(lp_ctx, "torture:host", binding_struct->host); + if (lpcfg_parm_string(lp_ctx, NULL, "torture", "share") == NULL) + lpcfg_set_cmdline(lp_ctx, "torture:share", "IPC$"); + lpcfg_set_cmdline(lp_ctx, "torture:binding", target); } else { - lp_set_cmdline(lp_ctx, "torture:host", host); - lp_set_cmdline(lp_ctx, "torture:share", share); - lp_set_cmdline(lp_ctx, "torture:binding", host); + lpcfg_set_cmdline(lp_ctx, "torture:host", host); + lpcfg_set_cmdline(lp_ctx, "torture:share", share); + lpcfg_set_cmdline(lp_ctx, "torture:binding", host); } return true; @@ -156,33 +156,33 @@ static void parse_dns(struct loadparm_context *lp_ctx, const char *dns) /* retrievieng the userdn */ p = strchr_m(dns, '#'); if (!p) { - lp_set_cmdline(lp_ctx, "torture:ldap_userdn", ""); - lp_set_cmdline(lp_ctx, "torture:ldap_basedn", ""); - lp_set_cmdline(lp_ctx, "torture:ldap_secret", ""); + lpcfg_set_cmdline(lp_ctx, "torture:ldap_userdn", ""); + lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", ""); + lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", ""); return; } userdn = strndup(dns, p - dns); - lp_set_cmdline(lp_ctx, "torture:ldap_userdn", userdn); + lpcfg_set_cmdline(lp_ctx, "torture:ldap_userdn", userdn); /* retrieve the basedn */ d = p + 1; p = strchr_m(d, '#'); if (!p) { - lp_set_cmdline(lp_ctx, "torture:ldap_basedn", ""); - lp_set_cmdline(lp_ctx, "torture:ldap_secret", ""); + lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", ""); + lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", ""); return; } basedn = strndup(d, p - d); - lp_set_cmdline(lp_ctx, "torture:ldap_basedn", basedn); + lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", basedn); /* retrieve the secret */ p = p + 1; if (!p) { - lp_set_cmdline(lp_ctx, "torture:ldap_secret", ""); + lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", ""); return; } secret = strdup(p); - lp_set_cmdline(lp_ctx, "torture:ldap_secret", secret); + lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", secret); printf ("%s - %s - %s\n", userdn, basedn, secret); @@ -465,35 +465,35 @@ int main(int argc,char *argv[]) while((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { case OPT_LOADFILE: - lp_set_cmdline(cmdline_lp_ctx, "torture:loadfile", poptGetOptArg(pc)); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:loadfile", poptGetOptArg(pc)); break; case OPT_UNCLIST: - lp_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc)); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc)); break; case OPT_TIMELIMIT: - lp_set_cmdline(cmdline_lp_ctx, "torture:timelimit", poptGetOptArg(pc)); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:timelimit", poptGetOptArg(pc)); break; case OPT_NUMPROGS: - lp_set_cmdline(cmdline_lp_ctx, "torture:nprocs", poptGetOptArg(pc)); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:nprocs", poptGetOptArg(pc)); break; case OPT_DNS: parse_dns(cmdline_lp_ctx, poptGetOptArg(pc)); break; case OPT_DANGEROUS: - lp_set_cmdline(cmdline_lp_ctx, "torture:dangerous", "Yes"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:dangerous", "Yes"); break; case OPT_ASYNC: - lp_set_cmdline(cmdline_lp_ctx, "torture:async", "Yes"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:async", "Yes"); break; case OPT_SMB_PORTS: - lp_set_cmdline(cmdline_lp_ctx, "smb ports", poptGetOptArg(pc)); + lpcfg_set_cmdline(cmdline_lp_ctx, "smb ports", poptGetOptArg(pc)); break; case OPT_EXTRA_USER: { char *option = talloc_asprintf(NULL, "torture:extra_user%u", ++num_extra_users); const char *value = poptGetOptArg(pc); - lp_set_cmdline(cmdline_lp_ctx, option, value); + lpcfg_set_cmdline(cmdline_lp_ctx, option, value); talloc_free(option); } break; @@ -515,51 +515,51 @@ int main(int argc,char *argv[]) } if (strcmp(target, "samba3") == 0) { - lp_set_cmdline(cmdline_lp_ctx, "torture:samba3", "true"); - lp_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba3", "true"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false"); } else if (strcmp(target, "samba4") == 0) { - lp_set_cmdline(cmdline_lp_ctx, "torture:samba4", "true"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba4", "true"); } else if (strcmp(target, "winxp") == 0) { - lp_set_cmdline(cmdline_lp_ctx, "torture:winxp", "true"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:winxp", "true"); } else if (strcmp(target, "w2k3") == 0) { - lp_set_cmdline(cmdline_lp_ctx, "torture:w2k3", "true"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:w2k3", "true"); } else if (strcmp(target, "w2k8") == 0) { - lp_set_cmdline(cmdline_lp_ctx, "torture:w2k8", "true"); - lp_set_cmdline(cmdline_lp_ctx, + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:w2k8", "true"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:invalid_lock_range_support", "false"); } else if (strcmp(target, "win7") == 0) { - lp_set_cmdline(cmdline_lp_ctx, "torture:win7", "true"); - lp_set_cmdline(cmdline_lp_ctx, "torture:cn_max_buffer_size", + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:win7", "true"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:cn_max_buffer_size", "0x00010000"); - lp_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false"); /* RAW-SEARCH for fails for inexplicable reasons against win7 */ - lp_set_cmdline(cmdline_lp_ctx, "torture:search_ea_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:search_ea_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:hide_on_access_denied", + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:hide_on_access_denied", "true"); } else if (strcmp(target, "onefs") == 0) { - lp_set_cmdline(cmdline_lp_ctx, "torture:onefs", "true"); - lp_set_cmdline(cmdline_lp_ctx, "torture:openx_deny_dos_support", + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:onefs", "true"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:openx_deny_dos_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:range_not_locked_on_file_close", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:sacl_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:ea_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:smbexit_pdu_support", + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:range_not_locked_on_file_close", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:sacl_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:ea_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:smbexit_pdu_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:smblock_pdu_support", + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:smblock_pdu_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:2_step_break_to_none", + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:2_step_break_to_none", "true"); - lp_set_cmdline(cmdline_lp_ctx, "torture:deny_dos_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:deny_fcb_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:read_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:writeclose_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:raw_search_search", "false"); - lp_set_cmdline(cmdline_lp_ctx, "torture:search_ea_size", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:deny_dos_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:deny_fcb_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:read_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:writeclose_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:raw_search_search", "false"); + lpcfg_set_cmdline(cmdline_lp_ctx, "torture:search_ea_size", "false"); } if (max_runtime) { diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 32cc9ac487..4322d851e4 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -53,16 +53,16 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx) struct smbcli_options options; struct smbcli_session_options session_options; - lp_smbcli_options(tctx->lp_ctx, &options); - lp_smbcli_session_options(tctx->lp_ctx, &session_options); + lpcfg_smbcli_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options); status = smbcli_full_connection(tctx, &cli, host, - lp_smb_ports(tctx->lp_ctx), - share, NULL, lp_socket_options(tctx->lp_ctx), + lpcfg_smb_ports(tctx->lp_ctx), + share, NULL, lpcfg_socket_options(tctx->lp_ctx), cmdline_credentials, - lp_resolve_context(tctx->lp_ctx), + lpcfg_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, - lp_gensec_settings(tctx, tctx->lp_ctx)); + lpcfg_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index f87f13f248..45b2775646 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -77,15 +77,15 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx, struct smbcli_options options; struct smbcli_session_options session_options; - lp_smbcli_options(tctx->lp_ctx, &options); - lp_smbcli_session_options(tctx->lp_ctx, &session_options); + lpcfg_smbcli_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options); status = smbcli_full_connection(tctx, &cli, host, - lp_smb_ports(tctx->lp_ctx), - share, NULL, lp_socket_options(tctx->lp_ctx), - creds, lp_resolve_context(tctx->lp_ctx), + lpcfg_smb_ports(tctx->lp_ctx), + share, NULL, lpcfg_socket_options(tctx->lp_ctx), + creds, lpcfg_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, - lp_gensec_settings(tctx, tctx->lp_ctx)); + lpcfg_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c index 708055096b..8d5accd2dc 100644 --- a/source4/torture/util_smb.c +++ b/source4/torture/util_smb.c @@ -502,20 +502,20 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx, struct smbcli_options options; struct smbcli_session_options session_options; - lp_smbcli_options(tctx->lp_ctx, &options); - lp_smbcli_session_options(tctx->lp_ctx, &session_options); + lpcfg_smbcli_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options); options.use_oplocks = torture_setting_bool(tctx, "use_oplocks", true); options.use_level2_oplocks = torture_setting_bool(tctx, "use_level2_oplocks", true); status = smbcli_full_connection(mem_ctx, c, hostname, - lp_smb_ports(tctx->lp_ctx), + lpcfg_smb_ports(tctx->lp_ctx), sharename, NULL, - lp_socket_options(tctx->lp_ctx), + lpcfg_socket_options(tctx->lp_ctx), cmdline_credentials, - lp_resolve_context(tctx->lp_ctx), + lpcfg_resolve_context(tctx->lp_ctx), ev, &options, &session_options, - lp_gensec_settings(tctx, tctx->lp_ctx)); + lpcfg_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("Failed to open connection - %s\n", nt_errstr(status)); return false; @@ -687,7 +687,7 @@ double torture_create_procs(struct torture_context *tctx, printf("asprintf failed\n"); return -1; } - lp_set_cmdline(tctx->lp_ctx, "netbios name", myname); + lpcfg_set_cmdline(tctx->lp_ctx, "netbios name", myname); free(myname); diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c index 99b0828319..1603280e48 100644 --- a/source4/torture/winbind/struct_based.c +++ b/source4/torture/winbind/struct_based.c @@ -123,7 +123,7 @@ static bool torture_winbind_struct_info(struct torture_context *torture) separator = torture_setting_string(torture, "winbindd_separator", - lp_winbind_separator(torture->lp_ctx)); + lpcfg_winbind_separator(torture->lp_ctx)); torture_assert_int_equal(torture, rep.data.info.winbind_separator, @@ -168,7 +168,7 @@ static bool torture_winbind_struct_netbios_name(struct torture_context *torture) expected = torture_setting_string(torture, "winbindd_netbios_name", - lp_netbios_name(torture->lp_ctx)); + lpcfg_netbios_name(torture->lp_ctx)); expected = strupper_talloc(torture, expected); torture_assert_str_equal(torture, @@ -201,7 +201,7 @@ static bool torture_winbind_struct_domain_name(struct torture_context *torture) expected = torture_setting_string(torture, "winbindd_netbios_domain", - lp_workgroup(torture->lp_ctx)); + lpcfg_workgroup(torture->lp_ctx)); get_winbind_domain(torture, &domain); @@ -476,7 +476,7 @@ static bool torture_winbind_struct_getdcname(struct torture_context *torture) bool strict = torture_setting_bool(torture, "strict mode", false); const char *domain_name = torture_setting_string(torture, "winbindd_netbios_domain", - lp_workgroup(torture->lp_ctx)); + lpcfg_workgroup(torture->lp_ctx)); struct torture_trust_domain *listd = NULL; uint32_t i, count = 0; @@ -929,7 +929,7 @@ static bool lookup_name_sid_list(struct torture_context *torture, char **list) char *name; const char *domain_name = torture_setting_string(torture, "winbindd_netbios_domain", - lp_workgroup(torture->lp_ctx)); + lpcfg_workgroup(torture->lp_ctx)); ZERO_STRUCT(req); ZERO_STRUCT(rep); diff --git a/source4/utils/net/net_gpo.c b/source4/utils/net/net_gpo.c index 971e88c5dd..6cddd97508 100644 --- a/source4/utils/net/net_gpo.c +++ b/source4/utils/net/net_gpo.c @@ -254,8 +254,8 @@ static int net_gpo_list(struct net_context *ctx, int argc, const char **argv) * user, needed for a token */ status = authsam_make_server_info(gp_ctx, gp_ctx->ldb_ctx, - lp_netbios_name(gp_ctx->lp_ctx), - lp_sam_name(gp_ctx->lp_ctx), + lpcfg_netbios_name(gp_ctx->lp_ctx), + lpcfg_sam_name(gp_ctx->lp_ctx), ldb_get_default_basedn(gp_ctx->ldb_ctx), result->msgs[0], dummy, diff --git a/source4/utils/net/net_join.c b/source4/utils/net/net_join.c index 316bc129f1..df75ff737a 100644 --- a/source4/utils/net/net_join.c +++ b/source4/utils/net/net_join.c @@ -68,7 +68,7 @@ int net_join(struct net_context *ctx, int argc, const char **argv) return -1; } /* prepare parameters for the join */ - r->in.netbios_name = lp_netbios_name(ctx->lp_ctx); + r->in.netbios_name = lpcfg_netbios_name(ctx->lp_ctx); r->in.domain_name = domain_name; r->in.join_type = secure_channel_type; r->in.level = LIBNET_JOIN_AUTOMATIC; diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c index 9c6d3d321b..7d4349ff52 100644 --- a/source4/utils/ntlm_auth.c +++ b/source4/utils/ntlm_auth.c @@ -211,8 +211,8 @@ static NTSTATUS local_pw_check_specified(struct loadparm_context *lp_ctx, nt_status = ntlm_password_check(mem_ctx, - lp_lanman_auth(lp_ctx), - lp_ntlm_auth(lp_ctx), + lpcfg_lanman_auth(lp_ctx), + lpcfg_ntlm_auth(lp_ctx), MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT | MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT, challenge, @@ -226,7 +226,7 @@ static NTSTATUS local_pw_check_specified(struct loadparm_context *lp_ctx, if (NT_STATUS_IS_OK(nt_status)) { if (unix_name) { if (asprintf(unix_name, "%s%c%s", domain, - *lp_winbind_separator(lp_ctx), + *lpcfg_winbind_separator(lp_ctx), username) < 0) { nt_status = NT_STATUS_NO_MEMORY; } @@ -477,7 +477,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode, /* setup the client side */ nt_status = gensec_client_start(NULL, &state->gensec_state, ev, - lp_gensec_settings(NULL, lp_ctx)); + lpcfg_gensec_settings(NULL, lp_ctx)); if (!NT_STATUS_IS_OK(nt_status)) { talloc_free(mem_ctx); exit(1); @@ -490,7 +490,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode, const char *winbind_method[] = { "winbind", NULL }; struct auth_context *auth_context; - msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx), ev); + msg = messaging_client_init(state, lpcfg_messaging_path(state, lp_ctx), ev); if (!msg) { talloc_free(mem_ctx); exit(1); @@ -509,7 +509,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode, } if (!NT_STATUS_IS_OK(gensec_server_start(state, ev, - lp_gensec_settings(state, lp_ctx), + lpcfg_gensec_settings(state, lp_ctx), auth_context, &state->gensec_state))) { talloc_free(mem_ctx); exit(1); @@ -708,7 +708,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode, reply_code = "AF"; reply_arg = talloc_asprintf(state->gensec_state, "%s%s%s", session_info->server_info->domain_name, - lp_winbind_separator(lp_ctx), session_info->server_info->account_name); + lpcfg_winbind_separator(lp_ctx), session_info->server_info->account_name); talloc_free(session_info); } } else if (state->gensec_state->gensec_role == GENSEC_CLIENT) { @@ -760,7 +760,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod } else if (plaintext_password) { /* handle this request as plaintext */ if (!full_username) { - if (asprintf(&full_username, "%s%c%s", domain, *lp_winbind_separator(lp_ctx), username) < 0) { + if (asprintf(&full_username, "%s%c%s", domain, *lpcfg_winbind_separator(lp_ctx), username) < 0) { mux_printf(mux_id, "Error: Out of memory in asprintf!\n.\n"); return; } @@ -785,14 +785,14 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod SAFE_FREE(domain); if (!parse_ntlm_auth_domain_user(full_username, &username, &domain, - *lp_winbind_separator(lp_ctx))) { + *lpcfg_winbind_separator(lp_ctx))) { /* username might be 'tainted', don't print into our new-line deleimianted stream */ mux_printf(mux_id, "Error: Could not parse into domain and username\n"); } } if (!domain) { - domain = smb_xstrdup(lp_workgroup(lp_ctx)); + domain = smb_xstrdup(lpcfg_workgroup(lp_ctx)); } if (ntlm_server_1_lm_session_key) @@ -805,7 +805,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod local_pw_check_specified(lp_ctx, username, domain, - lp_netbios_name(lp_ctx), + lpcfg_netbios_name(lp_ctx), &challenge, &lm_response, &nt_response, @@ -933,7 +933,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod } } -static void manage_squid_request(struct loadparm_context *lp_ctx, enum stdio_helper_mode helper_mode, +static void manage_squid_request(struct loadparm_context *lp_ctx, enum stdio_helper_mode helper_mode, stdio_helper_function fn, void **private2) { char *buf; @@ -1040,7 +1040,7 @@ static void manage_squid_request(struct loadparm_context *lp_ctx, enum stdio_hel talloc_free(buf); } -static void squid_stream(struct loadparm_context *lp_ctx, +static void squid_stream(struct loadparm_context *lp_ctx, enum stdio_helper_mode stdio_mode, stdio_helper_function fn) { /* initialize FDescs */ @@ -1133,7 +1133,7 @@ int main(int argc, const char **argv) gensec_init(cmdline_lp_ctx); if (opt_domain == NULL) { - opt_domain = lp_workgroup(cmdline_lp_ctx); + opt_domain = lpcfg_workgroup(cmdline_lp_ctx); } if (helper_protocol) { @@ -1160,7 +1160,7 @@ int main(int argc, const char **argv) } if (opt_workstation == NULL) { - opt_workstation = lp_netbios_name(cmdline_lp_ctx); + opt_workstation = lpcfg_netbios_name(cmdline_lp_ctx); } if (!opt_password) { @@ -1171,7 +1171,7 @@ int main(int argc, const char **argv) char *user; if (asprintf(&user, "%s%c%s", opt_domain, - *lp_winbind_separator(cmdline_lp_ctx), + *lpcfg_winbind_separator(cmdline_lp_ctx), opt_username) < 0) { return 1; } diff --git a/source4/web_server/web_server.c b/source4/web_server/web_server.c index af11def5a5..f40f0a625b 100644 --- a/source4/web_server/web_server.c +++ b/source4/web_server/web_server.c @@ -300,7 +300,7 @@ static const struct stream_server_ops web_stream_ops = { static void websrv_task_init(struct task_server *task) { NTSTATUS status; - uint16_t port = lp_web_port(task->lp_ctx); + uint16_t port = lpcfg_web_port(task->lp_ctx); const struct model_ops *model_ops; struct web_server_data *wdata; @@ -310,21 +310,21 @@ static void websrv_task_init(struct task_server *task) model_ops = process_model_startup(task->event_ctx, "single"); if (!model_ops) goto failed; - if (lp_interfaces(task->lp_ctx) && lp_bind_interfaces_only(task->lp_ctx)) { + if (lpcfg_interfaces(task->lp_ctx) && lpcfg_bind_interfaces_only(task->lp_ctx)) { int num_interfaces; int i; struct interface *ifaces; - load_interfaces(NULL, lp_interfaces(task->lp_ctx), &ifaces); + load_interfaces(NULL, lpcfg_interfaces(task->lp_ctx), &ifaces); num_interfaces = iface_count(ifaces); for(i = 0; i < num_interfaces; i++) { const char *address = iface_n_ip(ifaces, i); status = stream_setup_socket(task->event_ctx, - task->lp_ctx, model_ops, + task->lp_ctx, model_ops, &web_stream_ops, "ipv4", address, - &port, lp_socket_options(task->lp_ctx), + &port, lpcfg_socket_options(task->lp_ctx), task); if (!NT_STATUS_IS_OK(status)) goto failed; } @@ -333,8 +333,8 @@ static void websrv_task_init(struct task_server *task) } else { status = stream_setup_socket(task->event_ctx, task->lp_ctx, model_ops, &web_stream_ops, - "ipv4", lp_socket_address(task->lp_ctx), - &port, lp_socket_options(task->lp_ctx), task); + "ipv4", lpcfg_socket_address(task->lp_ctx), + &port, lpcfg_socket_options(task->lp_ctx), task); if (!NT_STATUS_IS_OK(status)) goto failed; } diff --git a/source4/winbind/idmap.c b/source4/winbind/idmap.c index ede2485e6a..be679db1cc 100644 --- a/source4/winbind/idmap.c +++ b/source4/winbind/idmap.c @@ -164,7 +164,7 @@ struct idmap_context *idmap_init(TALLOC_CTX *mem_ctx, idmap_ctx->lp_ctx = lp_ctx; idmap_ctx->ldb_ctx = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, - lp_idmap_url(lp_ctx), + lpcfg_idmap_url(lp_ctx), system_session(lp_ctx), NULL, 0); if (idmap_ctx->ldb_ctx == NULL) { @@ -279,7 +279,7 @@ failed: * * If no mapping exists, a new mapping will be created. * - * \todo Check if SIDs can be resolved if lp_idmap_trusted_only() == true + * \todo Check if SIDs can be resolved if lpcfg_idmap_trusted_only() == true * \todo Fix backwards compatibility for Samba3 * * \param idmap_ctx idmap context to use @@ -398,7 +398,7 @@ static NTSTATUS idmap_sid_to_xid(struct idmap_context *idmap_ctx, goto failed; } - /*FIXME: if lp_idmap_trusted_only() == true, check if SID can be + /*FIXME: if lpcfg_idmap_trusted_only() == true, check if SID can be * resolved here. */ ret = idmap_get_bounds(idmap_ctx, &low, &high); diff --git a/source4/winbind/wb_cmd_getpwnam.c b/source4/winbind/wb_cmd_getpwnam.c index a82387bd63..ac723593d2 100644 --- a/source4/winbind/wb_cmd_getpwnam.c +++ b/source4/winbind/wb_cmd_getpwnam.c @@ -124,13 +124,13 @@ static void cmd_getpwnam_recv_user_info(struct composite_context *ctx) WBSRV_SAMBA3_SET_STRING(pw->pw_passwd, "*"); WBSRV_SAMBA3_SET_STRING(pw->pw_gecos, user_info->out.full_name); WBSRV_SAMBA3_SET_STRING(pw->pw_dir, - lp_template_homedir(state->service->task->lp_ctx)); + lpcfg_template_homedir(state->service->task->lp_ctx)); all_string_sub(pw->pw_dir, "%WORKGROUP%", state->workgroup_name, sizeof(fstring) - 1); all_string_sub(pw->pw_dir, "%ACCOUNTNAME%", user_info->out.account_name, sizeof(fstring) - 1); WBSRV_SAMBA3_SET_STRING(pw->pw_shell, - lp_template_shell(state->service->task->lp_ctx)); + lpcfg_template_shell(state->service->task->lp_ctx)); state->group_sid = dom_sid_dup(state, user_info->out.primary_group_sid); if(composite_nomem(state->group_sid, state->ctx)) return; diff --git a/source4/winbind/wb_cmd_getpwuid.c b/source4/winbind/wb_cmd_getpwuid.c index f5e7f6b4b1..f6f3cb282e 100644 --- a/source4/winbind/wb_cmd_getpwuid.c +++ b/source4/winbind/wb_cmd_getpwuid.c @@ -145,13 +145,13 @@ static void cmd_getpwuid_recv_user_info(struct composite_context *ctx) WBSRV_SAMBA3_SET_STRING(pw->pw_passwd, "*"); WBSRV_SAMBA3_SET_STRING(pw->pw_gecos, user_info->out.full_name); WBSRV_SAMBA3_SET_STRING(pw->pw_dir, - lp_template_homedir(state->service->task->lp_ctx)); + lpcfg_template_homedir(state->service->task->lp_ctx)); all_string_sub(pw->pw_dir, "%WORKGROUP%", state->workgroup, sizeof(fstring) - 1); all_string_sub(pw->pw_dir, "%ACCOUNTNAME%", user_info->out.account_name, sizeof(fstring) - 1); WBSRV_SAMBA3_SET_STRING(pw->pw_shell, - lp_template_shell(state->service->task->lp_ctx)); + lpcfg_template_shell(state->service->task->lp_ctx)); pw->pw_uid = state->uid; diff --git a/source4/winbind/wb_dom_info.c b/source4/winbind/wb_dom_info.c index b6ec7dd67f..8e4d238390 100644 --- a/source4/winbind/wb_dom_info.c +++ b/source4/winbind/wb_dom_info.c @@ -64,11 +64,11 @@ struct composite_context *wb_get_dom_info_send(TALLOC_CTX *mem_ctx, dom_sid = dom_sid_dup(mem_ctx, sid); if (dom_sid == NULL) goto failed; - ctx = finddcs_send(mem_ctx, lp_netbios_name(service->task->lp_ctx), - lp_nbt_port(service->task->lp_ctx), + ctx = finddcs_send(mem_ctx, lpcfg_netbios_name(service->task->lp_ctx), + lpcfg_nbt_port(service->task->lp_ctx), domain_name, NBT_NAME_LOGON, dom_sid, - lp_resolve_context(service->task->lp_ctx), + lpcfg_resolve_context(service->task->lp_ctx), service->task->event_ctx, service->task->msg_ctx); if (ctx == NULL) goto failed; diff --git a/source4/winbind/wb_dom_info_trusted.c b/source4/winbind/wb_dom_info_trusted.c index eebabaee44..8086714a6e 100644 --- a/source4/winbind/wb_dom_info_trusted.c +++ b/source4/winbind/wb_dom_info_trusted.c @@ -199,7 +199,7 @@ static void trusted_dom_info_recv_dcname(struct tevent_req *subreq) if (*state->info->dcs[0].name == '\\') state->info->dcs[0].name++; make_nbt_name(&name, state->info->dcs[0].name, 0x20); - ctx = resolve_name_send(lp_resolve_context(state->service->task->lp_ctx), state, + ctx = resolve_name_send(lpcfg_resolve_context(state->service->task->lp_ctx), state, &name, state->service->task->event_ctx); composite_continue(state->ctx, ctx, trusted_dom_info_recv_dcaddr, diff --git a/source4/winbind/wb_init_domain.c b/source4/winbind/wb_init_domain.c index 03a2c9a9c0..f07d17a64e 100644 --- a/source4/winbind/wb_init_domain.c +++ b/source4/winbind/wb_init_domain.c @@ -158,14 +158,14 @@ struct composite_context *wb_init_domain_send(TALLOC_CTX *mem_ctx, state->domain->netlogon_pipe = NULL; if ((!cli_credentials_is_anonymous(state->domain->libnet_ctx->cred)) && - ((lp_server_role(service->task->lp_ctx) == ROLE_DOMAIN_MEMBER) || - (lp_server_role(service->task->lp_ctx) == ROLE_DOMAIN_CONTROLLER)) && + ((lpcfg_server_role(service->task->lp_ctx) == ROLE_DOMAIN_MEMBER) || + (lpcfg_server_role(service->task->lp_ctx) == ROLE_DOMAIN_CONTROLLER)) && (dom_sid_equal(state->domain->info->sid, state->service->primary_sid))) { state->domain->netlogon_binding->flags |= DCERPC_SCHANNEL; /* For debugging, it can be a real pain if all the traffic is encrypted */ - if (lp_winbind_sealed_pipes(service->task->lp_ctx)) { + if (lpcfg_winbind_sealed_pipes(service->task->lp_ctx)) { state->domain->netlogon_binding->flags |= (DCERPC_SIGN | DCERPC_SEAL ); } else { state->domain->netlogon_binding->flags |= (DCERPC_SIGN); @@ -211,7 +211,7 @@ static void init_domain_recv_netlogonpipe(struct composite_context *ctx) state->domain->lsa_binding = init_domain_binding(state, &ndr_table_lsarpc); /* For debugging, it can be a real pain if all the traffic is encrypted */ - if (lp_winbind_sealed_pipes(state->service->task->lp_ctx)) { + if (lpcfg_winbind_sealed_pipes(state->service->task->lp_ctx)) { state->domain->lsa_binding->flags |= (DCERPC_SIGN | DCERPC_SEAL ); } else { state->domain->lsa_binding->flags |= (DCERPC_SIGN); diff --git a/source4/winbind/wb_pam_auth.c b/source4/winbind/wb_pam_auth.c index 0c33f1cf8b..e09addac73 100644 --- a/source4/winbind/wb_pam_auth.c +++ b/source4/winbind/wb_pam_auth.c @@ -177,7 +177,7 @@ static void pam_auth_crap_recv_logon(struct composite_context *ctx) state->unix_username = talloc_asprintf(state, "%s%s%s", state->domain_name, - lp_winbind_separator(state->lp_ctx), + lpcfg_winbind_separator(state->lp_ctx), state->user_name); if (composite_nomem(state->unix_username, state->ctx)) return; @@ -219,11 +219,11 @@ struct composite_context *wb_cmd_pam_auth_send(TALLOC_CTX *mem_ctx, const char *user, *domain; DATA_BLOB chal, nt_resp, lm_resp, names_blob; int flags = CLI_CRED_NTLM_AUTH; - if (lp_client_lanman_auth(service->task->lp_ctx)) { + if (lpcfg_client_lanman_auth(service->task->lp_ctx)) { flags |= CLI_CRED_LANMAN_AUTH; } - if (lp_client_ntlmv2_auth(service->task->lp_ctx)) { + if (lpcfg_client_ntlmv2_auth(service->task->lp_ctx)) { flags |= CLI_CRED_NTLMv2_AUTH; } diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c index fcb587a007..9b8f8e0663 100644 --- a/source4/winbind/wb_samba3_cmd.c +++ b/source4/winbind/wb_samba3_cmd.c @@ -190,7 +190,7 @@ NTSTATUS wbsrv_samba3_interface_version(struct wbsrv_samba3_call *s3call) NTSTATUS wbsrv_samba3_info(struct wbsrv_samba3_call *s3call) { s3call->response->result = WINBINDD_OK; - s3call->response->data.info.winbind_separator = *lp_winbind_separator(s3call->wbconn->lp_ctx); + s3call->response->data.info.winbind_separator = *lpcfg_winbind_separator(s3call->wbconn->lp_ctx); WBSRV_SAMBA3_SET_STRING(s3call->response->data.info.samba_version, SAMBA_VERSION_STRING); return NT_STATUS_OK; @@ -200,7 +200,7 @@ NTSTATUS wbsrv_samba3_domain_name(struct wbsrv_samba3_call *s3call) { s3call->response->result = WINBINDD_OK; WBSRV_SAMBA3_SET_STRING(s3call->response->data.domain_name, - lp_workgroup(s3call->wbconn->lp_ctx)); + lpcfg_workgroup(s3call->wbconn->lp_ctx)); return NT_STATUS_OK; } @@ -208,14 +208,14 @@ NTSTATUS wbsrv_samba3_netbios_name(struct wbsrv_samba3_call *s3call) { s3call->response->result = WINBINDD_OK; WBSRV_SAMBA3_SET_STRING(s3call->response->data.netbios_name, - lp_netbios_name(s3call->wbconn->lp_ctx)); + lpcfg_netbios_name(s3call->wbconn->lp_ctx)); return NT_STATUS_OK; } NTSTATUS wbsrv_samba3_priv_pipe_dir(struct wbsrv_samba3_call *s3call) { struct loadparm_context *lp_ctx = s3call->wbconn->listen_socket->service->task->lp_ctx; - const char *priv_socket_dir = lp_winbindd_privileged_socket_directory(lp_ctx); + const char *priv_socket_dir = lpcfg_winbindd_privileged_socket_directory(lp_ctx); s3call->response->result = WINBINDD_OK; s3call->response->extra_data.data = discard_const(priv_socket_dir); diff --git a/source4/winbind/wb_server.c b/source4/winbind/wb_server.c index 2e1af61de6..ee44f0a240 100644 --- a/source4/winbind/wb_server.c +++ b/source4/winbind/wb_server.c @@ -213,14 +213,14 @@ static void winbind_task_init(struct task_server *task) } /* Make sure the directory for the Samba3 socket exists, and is of the correct permissions */ - if (!directory_create_or_exist(lp_winbindd_socket_directory(task->lp_ctx), geteuid(), 0755)) { + if (!directory_create_or_exist(lpcfg_winbindd_socket_directory(task->lp_ctx), geteuid(), 0755)) { task_server_terminate(task, "Cannot create winbindd pipe directory", true); return; } /* Make sure the directory for the Samba3 socket exists, and is of the correct permissions */ - if (!directory_create_or_exist(lp_winbindd_privileged_socket_directory(task->lp_ctx), geteuid(), 0750)) { + if (!directory_create_or_exist(lpcfg_winbindd_privileged_socket_directory(task->lp_ctx), geteuid(), 0750)) { task_server_terminate(task, "Cannot create winbindd privileged pipe directory", true); return; @@ -234,17 +234,17 @@ static void winbind_task_init(struct task_server *task) /* Find the primary SID, depending if we are a standalone * server (what good is winbind in this case, but anyway...), * or are in a domain as a member or a DC */ - switch (lp_server_role(service->task->lp_ctx)) { + switch (lpcfg_server_role(service->task->lp_ctx)) { case ROLE_STANDALONE: primary_sid = secrets_get_domain_sid(service, service->task->event_ctx, service->task->lp_ctx, - lp_netbios_name(service->task->lp_ctx), &errstring); + lpcfg_netbios_name(service->task->lp_ctx), &errstring); if (!primary_sid) { char *message = talloc_asprintf(task, "Cannot start Winbind (standalone configuration): %s: " "Have you provisioned this server (%s) or changed it's name?", - errstring, lp_netbios_name(service->task->lp_ctx)); + errstring, lpcfg_netbios_name(service->task->lp_ctx)); task_server_terminate(task, message, true); return; } @@ -253,11 +253,11 @@ static void winbind_task_init(struct task_server *task) primary_sid = secrets_get_domain_sid(service, service->task->event_ctx, service->task->lp_ctx, - lp_workgroup(service->task->lp_ctx), &errstring); + lpcfg_workgroup(service->task->lp_ctx), &errstring); if (!primary_sid) { char *message = talloc_asprintf(task, "Cannot start Winbind (domain member): %s: " "Have you joined the %s domain?", - errstring, lp_workgroup(service->task->lp_ctx)); + errstring, lpcfg_workgroup(service->task->lp_ctx)); task_server_terminate(task, message, true); return; } @@ -266,11 +266,11 @@ static void winbind_task_init(struct task_server *task) primary_sid = secrets_get_domain_sid(service, service->task->event_ctx, service->task->lp_ctx, - lp_workgroup(service->task->lp_ctx), &errstring); + lpcfg_workgroup(service->task->lp_ctx), &errstring); if (!primary_sid) { char *message = talloc_asprintf(task, "Cannot start Winbind (domain controller): %s: " "Have you provisioned the %s domain?", - errstring, lp_workgroup(service->task->lp_ctx)); + errstring, lpcfg_workgroup(service->task->lp_ctx)); task_server_terminate(task, message, true); return; } @@ -284,8 +284,8 @@ static void winbind_task_init(struct task_server *task) return; } - service->priv_pipe_dir = lp_winbindd_privileged_socket_directory(task->lp_ctx); - service->pipe_dir = lp_winbindd_socket_directory(task->lp_ctx); + service->priv_pipe_dir = lpcfg_winbindd_privileged_socket_directory(task->lp_ctx); + service->pipe_dir = lpcfg_winbindd_socket_directory(task->lp_ctx); /* setup the unprivileged samba3 socket */ listen_socket = talloc(service, struct wbsrv_listen_socket); @@ -299,7 +299,7 @@ static void winbind_task_init(struct task_server *task) status = stream_setup_socket(task->event_ctx, task->lp_ctx, model_ops, &wbsrv_ops, "unix", listen_socket->socket_path, &port, - lp_socket_options(task->lp_ctx), + lpcfg_socket_options(task->lp_ctx), listen_socket); if (!NT_STATUS_IS_OK(status)) goto listen_failed; @@ -316,7 +316,7 @@ static void winbind_task_init(struct task_server *task) status = stream_setup_socket(task->event_ctx, task->lp_ctx, model_ops, &wbsrv_ops, "unix", listen_socket->socket_path, &port, - lp_socket_options(task->lp_ctx), + lpcfg_socket_options(task->lp_ctx), listen_socket); if (!NT_STATUS_IS_OK(status)) goto listen_failed; diff --git a/source4/winbind/wb_sid2domain.c b/source4/winbind/wb_sid2domain.c index bdbfc3eceb..b77044ee80 100644 --- a/source4/winbind/wb_sid2domain.c +++ b/source4/winbind/wb_sid2domain.c @@ -84,7 +84,7 @@ struct composite_context *wb_sid2domain_send(TALLOC_CTX *mem_ctx, if (dom_sid_equal(service->primary_sid, sid) || dom_sid_in_domain(service->primary_sid, sid)) { - ctx = wb_get_dom_info_send(state, service, lp_workgroup(service->task->lp_ctx), + ctx = wb_get_dom_info_send(state, service, lpcfg_workgroup(service->task->lp_ctx), service->primary_sid); if (ctx == NULL) goto failed; ctx->async.fn = sid2domain_recv_dom_info; diff --git a/source4/winbind/wb_utils.c b/source4/winbind/wb_utils.c index 43effc3028..ffc4aa1950 100644 --- a/source4/winbind/wb_utils.c +++ b/source4/winbind/wb_utils.c @@ -31,10 +31,10 @@ bool wb_samba3_split_username(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_c const char *domuser, char **domain, char **user) { - char *p = strchr(domuser, *lp_winbind_separator(lp_ctx)); + char *p = strchr(domuser, *lpcfg_winbind_separator(lp_ctx)); if (p == NULL) { - *domain = talloc_strdup(mem_ctx, lp_workgroup(lp_ctx)); + *domain = talloc_strdup(mem_ctx, lpcfg_workgroup(lp_ctx)); } else { *domain = talloc_strndup(mem_ctx, domuser, PTR_DIFF(p, domuser)); diff --git a/source4/wrepl_server/wrepl_apply_records.c b/source4/wrepl_server/wrepl_apply_records.c index 878f689f70..4eed36bb67 100644 --- a/source4/wrepl_server/wrepl_apply_records.c +++ b/source4/wrepl_server/wrepl_apply_records.c @@ -1193,7 +1193,7 @@ static NTSTATUS r_do_sgroup_merge(struct wreplsrv_partner *partner, bool changed_old_addrs = false; bool skip_replica_owned_by_us = false; bool become_owner = true; - bool propagate = lp_parm_bool(partner->service->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false); + bool propagate = lpcfg_parm_bool(partner->service->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false); const char *local_owner = partner->service->wins_db->local_owner; merge = talloc(mem_ctx, struct winsdb_record); diff --git a/source4/wrepl_server/wrepl_in_connection.c b/source4/wrepl_server/wrepl_in_connection.c index 364ebc7fa9..5fd2435110 100644 --- a/source4/wrepl_server/wrepl_in_connection.c +++ b/source4/wrepl_server/wrepl_in_connection.c @@ -451,12 +451,12 @@ NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service, struct loadpar return NT_STATUS_INTERNAL_ERROR; } - if (lp_interfaces(lp_ctx) && lp_bind_interfaces_only(lp_ctx)) { + if (lpcfg_interfaces(lp_ctx) && lpcfg_bind_interfaces_only(lp_ctx)) { int num_interfaces; int i; struct interface *ifaces; - load_interfaces(task, lp_interfaces(lp_ctx), &ifaces); + load_interfaces(task, lpcfg_interfaces(lp_ctx), &ifaces); num_interfaces = iface_count(ifaces); @@ -467,10 +467,10 @@ NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service, struct loadpar for(i = 0; i < num_interfaces; i++) { address = iface_n_ip(ifaces, i); status = stream_setup_socket(task->event_ctx, - task->lp_ctx, model_ops, + task->lp_ctx, model_ops, &wreplsrv_stream_ops, "ipv4", address, &port, - lp_socket_options(task->lp_ctx), + lpcfg_socket_options(task->lp_ctx), service); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("stream_setup_socket(address=%s,port=%u) failed - %s\n", @@ -479,10 +479,10 @@ NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service, struct loadpar } } } else { - address = lp_socket_address(lp_ctx); - status = stream_setup_socket(task->event_ctx, task->lp_ctx, + address = lpcfg_socket_address(lp_ctx); + status = stream_setup_socket(task->event_ctx, task->lp_ctx, model_ops, &wreplsrv_stream_ops, - "ipv4", address, &port, lp_socket_options(task->lp_ctx), + "ipv4", address, &port, lpcfg_socket_options(task->lp_ctx), service); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("stream_setup_socket(address=%s,port=%u) failed - %s\n", diff --git a/source4/wrepl_server/wrepl_scavenging.c b/source4/wrepl_server/wrepl_scavenging.c index b601f8658a..91ba917d1b 100644 --- a/source4/wrepl_server/wrepl_scavenging.c +++ b/source4/wrepl_server/wrepl_scavenging.c @@ -65,7 +65,7 @@ static NTSTATUS wreplsrv_scavenging_owned_records(struct wreplsrv_service *servi bool delete_tombstones; struct timeval tombstone_extra_time; const char *local_owner = service->wins_db->local_owner; - bool propagate = lp_parm_bool(service->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false); + bool propagate = lpcfg_parm_bool(service->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false); now_timestr = ldb_timestring(tmp_mem, now); NT_STATUS_HAVE_NO_MEMORY(now_timestr); diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c index bb3a6ba574..af89d8a9f9 100644 --- a/source4/wrepl_server/wrepl_server.c +++ b/source4/wrepl_server/wrepl_server.c @@ -38,8 +38,8 @@ static struct ldb_context *wins_config_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, private_path(mem_ctx, - lp_ctx, lp_wins_config_url(lp_ctx)), + return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, private_path(mem_ctx, + lp_ctx, lpcfg_wins_config_url(lp_ctx)), system_session(lp_ctx), NULL, 0); } @@ -74,11 +74,11 @@ failed: static NTSTATUS wreplsrv_open_winsdb(struct wreplsrv_service *service, struct loadparm_context *lp_ctx) { - const char *owner = lp_parm_string(lp_ctx, NULL, "winsdb", "local_owner"); + const char *owner = lpcfg_parm_string(lp_ctx, NULL, "winsdb", "local_owner"); if (owner == NULL) { struct interface *ifaces; - load_interfaces(service, lp_interfaces(lp_ctx), &ifaces); + load_interfaces(service, lpcfg_interfaces(lp_ctx), &ifaces); owner = iface_n_ip(ifaces, 0); } @@ -93,26 +93,26 @@ static NTSTATUS wreplsrv_open_winsdb(struct wreplsrv_service *service, } /* the default renew interval is 6 days */ - service->config.renew_interval = lp_parm_int(lp_ctx, NULL,"wreplsrv","renew_interval", 6*24*60*60); + service->config.renew_interval = lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","renew_interval", 6*24*60*60); /* the default tombstone (extinction) interval is 6 days */ - service->config.tombstone_interval= lp_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_interval", 6*24*60*60); + service->config.tombstone_interval= lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_interval", 6*24*60*60); /* the default tombstone (extinction) timeout is 1 day */ - service->config.tombstone_timeout = lp_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_timeout", 1*24*60*60); + service->config.tombstone_timeout = lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_timeout", 1*24*60*60); /* the default tombstone extra timeout is 3 days */ - service->config.tombstone_extra_timeout = lp_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_extra_timeout", 3*24*60*60); + service->config.tombstone_extra_timeout = lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_extra_timeout", 3*24*60*60); /* the default verify interval is 24 days */ - service->config.verify_interval = lp_parm_int(lp_ctx, NULL,"wreplsrv","verify_interval", 24*24*60*60); + service->config.verify_interval = lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","verify_interval", 24*24*60*60); /* the default scavenging interval is 'renew_interval/2' */ - service->config.scavenging_interval=lp_parm_int(lp_ctx, NULL,"wreplsrv","scavenging_interval", + service->config.scavenging_interval=lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","scavenging_interval", service->config.renew_interval/2); /* the maximun interval to the next periodic processing event */ - service->config.periodic_interval = lp_parm_int(lp_ctx, NULL,"wreplsrv","periodic_interval", 15); + service->config.periodic_interval = lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","periodic_interval", 15); return NT_STATUS_OK; } @@ -451,7 +451,7 @@ static void wreplsrv_task_init(struct task_server *task) NTSTATUS status; struct wreplsrv_service *service; - if (!lp_wins_support(task->lp_ctx)) { + if (!lpcfg_wins_support(task->lp_ctx)) { return; } -- cgit