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 --- 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 ++++++++-------- 14 files changed, 50 insertions(+), 50 deletions(-) (limited to 'source4/lib') 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; } -- cgit