From 226478521b93dcdd60d268757b3b2fce14549b72 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 18 Aug 2004 11:01:06 +0000 Subject: r1878: implemet libnet_context_{init,destroy} and implement libnet_Change_Password_generic() metze (This used to be commit d48050ae906ecf8d4f78c224042f8f9fe584ad39) --- source4/libnet/libnet.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 source4/libnet/libnet.c (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c new file mode 100644 index 0000000000..8f49d6334e --- /dev/null +++ b/source4/libnet/libnet.c @@ -0,0 +1,45 @@ +/* + Unix SMB/CIFS implementation. + + Copyright (C) Stefan Metzmacher 2004 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" + +struct libnet_context *libnet_context_init(void) +{ + TALLOC_CTX *mem_ctx; + struct libnet_context *ctx; + + mem_ctx = talloc_init("libnet_context"); + + ctx = talloc_p(mem_ctx, struct libnet_context); + if (!ctx) { + return NULL; + } + + ctx->mem_ctx = mem_ctx; + + return ctx; +} + +void libnet_context_destroy(struct libnet_context **libnetctx) +{ + talloc_destroy((*libnetctx)->mem_ctx); + + (*libnetctx) = NULL; +} -- cgit From 6bd02aa5046b606171a680e6f8aefba31b744af1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Nov 2004 11:42:35 +0000 Subject: r3478: split out some more pieces of includes.h (This used to be commit 8e9212ecfc61c509f686363d8ec412ce54bc1c8d) --- source4/libnet/libnet.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 8f49d6334e..1462a63dd2 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "libnet/libnet.h" struct libnet_context *libnet_context_init(void) { -- cgit From 759da3b915e2006d4c87b5ace47f399accd9ce91 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 27 Jan 2005 07:08:20 +0000 Subject: r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0) --- source4/libnet/libnet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 1462a63dd2..56b55426c0 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -28,7 +28,7 @@ struct libnet_context *libnet_context_init(void) mem_ctx = talloc_init("libnet_context"); - ctx = talloc_p(mem_ctx, struct libnet_context); + ctx = talloc(mem_ctx, struct libnet_context); if (!ctx) { return NULL; } @@ -40,7 +40,7 @@ struct libnet_context *libnet_context_init(void) void libnet_context_destroy(struct libnet_context **libnetctx) { - talloc_destroy((*libnetctx)->mem_ctx); + talloc_free((*libnetctx)->mem_ctx); (*libnetctx) = NULL; } -- cgit From af237084ecd4f9928c6c282b9c5c73598d5c73d6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 16 Jun 2005 11:36:09 +0000 Subject: r7633: this patch started as an attempt to make the dcerpc code use a given event_context for the socket_connect() call, so that when things that use dcerpc are running alongside anything else it doesn't block the whole process during a connect. Then of course I needed to change any code that created a dcerpc connection (such as the auth code) to also take an event context, and anything that called that and so on .... thus the size of the patch. There were 3 places where I punted: - abartlet wanted me to add a gensec_set_event_context() call instead of adding it to the gensec init calls. Andrew, my apologies for not doing this. I didn't do it as adding a new parameter allowed me to catch all the callers with the compiler. Now that its done, we could go back and use gensec_set_event_context() - the ejs code calls auth initialisation, which means it should pass in the event context from the web server. I punted on that. Needs fixing. - I used a NULL event context in dcom_get_pipe(). This is equivalent to what we did already, but should be fixed to use a callers event context. Jelmer, can you think of a clean way to do that? I also cleaned up a couple of things: - libnet_context_destroy() makes no sense. I removed it. - removed some unused vars in various places (This used to be commit 3a3025485bdb8f600ab528c0b4b4eef0c65e3fc9) --- source4/libnet/libnet.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 56b55426c0..5d66005a27 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -20,27 +20,26 @@ #include "includes.h" #include "libnet/libnet.h" +#include "lib/events/events.h" -struct libnet_context *libnet_context_init(void) +struct libnet_context *libnet_context_init(struct event_context *ev) { - TALLOC_CTX *mem_ctx; struct libnet_context *ctx; - mem_ctx = talloc_init("libnet_context"); - - ctx = talloc(mem_ctx, struct libnet_context); + ctx = talloc(NULL, struct libnet_context); if (!ctx) { return NULL; } - ctx->mem_ctx = mem_ctx; + if (ev == NULL) { + ev = event_context_init(ctx); + if (ev == NULL) { + talloc_free(ctx); + return NULL; + } + } + ctx->event_ctx = ev; return ctx; } -void libnet_context_destroy(struct libnet_context **libnetctx) -{ - talloc_free((*libnetctx)->mem_ctx); - - (*libnetctx) = NULL; -} -- cgit From e6b54f7acf45abcbc81d192bf618034a075c4d18 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Sat, 2 Jul 2005 14:32:49 +0000 Subject: r8076: Put name resolution methods into libnet_context. This allows libnet based application use methods of their own choice and makes it less dependent on smb.conf parameters. Use libnet_context in libnet_Lookup functions which is the way to pass default name resolution methods if caller doesn't want to bother with specifying them. rafal (This used to be commit d0ea136356bcb9c6c01120d8683b71e8689d5e5b) --- source4/libnet/libnet.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 5d66005a27..963e824497 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -24,13 +24,19 @@ struct libnet_context *libnet_context_init(struct event_context *ev) { + /* default name resolution methods */ + const char *nr_methods[] = { "lmhosts", "wins", "host", "bcast", NULL }; + int nr_count = 0, nr_i; + struct libnet_context *ctx; + /* create brand new libnet context */ ctx = talloc(NULL, struct libnet_context); if (!ctx) { return NULL; } + /* events */ if (ev == NULL) { ev = event_context_init(ctx); if (ev == NULL) { @@ -40,6 +46,15 @@ struct libnet_context *libnet_context_init(struct event_context *ev) } ctx->event_ctx = ev; + /* count name resolution methods */ + while (nr_methods[nr_count]) nr_count++; + + /* assign name resolution methods */ + ctx->name_res_methods = talloc_array(ctx, char*, nr_count+1); + for (nr_i = 0; nr_i < nr_count; nr_i++) { + ctx->name_res_methods[nr_i] = talloc_strdup(ctx, nr_methods[nr_i]); + } + ctx->name_res_methods[nr_count+1] = NULL; + return ctx; } - -- cgit From 5c87688051bc898e4a606f5ce1654eed0c3bb5d7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 9 Jul 2005 01:53:45 +0000 Subject: r8246: Don't try and set the element after the end off the array to NULL. Andrew Bartlett (This used to be commit 44338b2852bff36d642ea0296d480d384e88fbcb) --- source4/libnet/libnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 963e824497..604a2aaca4 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -54,7 +54,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev) for (nr_i = 0; nr_i < nr_count; nr_i++) { ctx->name_res_methods[nr_i] = talloc_strdup(ctx, nr_methods[nr_i]); } - ctx->name_res_methods[nr_count+1] = NULL; + ctx->name_res_methods[nr_i] = NULL; return ctx; } -- cgit From f8391489bfbeea20e450b9ec7640c3e04c713ced Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 18 Nov 2005 23:27:58 +0000 Subject: r11794: - fixed a valgrind error in libnet, caused by using a stack variable after the function has returned (the *address variable was assigned into the state). - changed libnet to use event_context_find() instead of event_context_init(), so it works as a child of existing code that uses a event context (This used to be commit 47ceb2d3558304b4c4fb00582fb25a885cea2ef5) --- source4/libnet/libnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 604a2aaca4..b7b18b7417 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -38,7 +38,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev) /* events */ if (ev == NULL) { - ev = event_context_init(ctx); + ev = event_context_find(ctx); if (ev == NULL) { talloc_free(ctx); return NULL; -- cgit From 78a328bef894a78881dfae9f278dd839b86fc82f Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Sun, 20 Nov 2005 21:33:30 +0000 Subject: r11813: Const-ify name resolution method list and use string list utilities to set the context field. rafal (This used to be commit 5da8b457c34236b21f6e88e3a7a12338d0390a4f) --- source4/libnet/libnet.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index b7b18b7417..ba995854b2 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -26,7 +26,6 @@ struct libnet_context *libnet_context_init(struct event_context *ev) { /* default name resolution methods */ const char *nr_methods[] = { "lmhosts", "wins", "host", "bcast", NULL }; - int nr_count = 0, nr_i; struct libnet_context *ctx; @@ -46,15 +45,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev) } ctx->event_ctx = ev; - /* count name resolution methods */ - while (nr_methods[nr_count]) nr_count++; - - /* assign name resolution methods */ - ctx->name_res_methods = talloc_array(ctx, char*, nr_count+1); - for (nr_i = 0; nr_i < nr_count; nr_i++) { - ctx->name_res_methods[nr_i] = talloc_strdup(ctx, nr_methods[nr_i]); - } - ctx->name_res_methods[nr_i] = NULL; + ctx->name_res_methods = str_list_copy(ctx, nr_methods); return ctx; } -- cgit From 1b415f7b8e8d02f6b7978de730a16e258ec5d07d Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Sun, 20 Nov 2005 22:00:47 +0000 Subject: r11815: A bit more comments and spaces for better readability. rafal (This used to be commit 1e831aead17b399289b8161e521e1afd5873c556) --- source4/libnet/libnet.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index ba995854b2..4b2551b872 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -45,6 +45,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev) } ctx->event_ctx = ev; + /* name resolution methods */ ctx->name_res_methods = str_list_copy(ctx, nr_methods); return ctx; -- cgit From 7d90b3f802f1d3e0dd177901ebdda0bd756eae38 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 13 Jan 2006 00:54:53 +0000 Subject: r12881: Hard-coded defaults are silly. We have smb.conf for a reason. Andrew Bartlett (This used to be commit c9402f9227a02ff0ee77f264f79ef47207ad50ef) --- source4/libnet/libnet.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 4b2551b872..c350416895 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -24,9 +24,6 @@ struct libnet_context *libnet_context_init(struct event_context *ev) { - /* default name resolution methods */ - const char *nr_methods[] = { "lmhosts", "wins", "host", "bcast", NULL }; - struct libnet_context *ctx; /* create brand new libnet context */ @@ -46,7 +43,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev) ctx->event_ctx = ev; /* name resolution methods */ - ctx->name_res_methods = str_list_copy(ctx, nr_methods); + ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order()); return ctx; } -- cgit From 16b5eac38df91b2377cbffe3009cc956fcb8a78a Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Mon, 15 May 2006 21:49:27 +0000 Subject: r15625: Partial commit of my current work. It makes libnet api functions a bit more smart and more aware of what libnet_context can offer. The context is a help when some of the arguments are not passed (programmer counts on using sensible defaults) and stores some of results so that similar subsequent calls don't need to reopen some of policy handles, pipes, etc. again. It also helps to hide some of details the library user don't really want to know much about. Also, change domain open function to be part of public api, as it is going to be used in ejsnet interface. Note, this is work in progress. Comments are welcome. rafal (This used to be commit 1ed80c594c2f466e364a11194d6fdc30ac4a8f27) --- source4/libnet/libnet.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index c350416895..8398e9ca17 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -44,6 +44,9 @@ struct libnet_context *libnet_context_init(struct event_context *ev) /* name resolution methods */ ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order()); + + /* connected domain params */ + ZERO_STRUCT(ctx->domain); return ctx; } -- cgit From 3b07abf2d7e1fe8831c5ce5d84ba70add24a5a3b Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Wed, 17 May 2006 22:21:24 +0000 Subject: r15667: Make sure the rpc pipe pointers are zeroed during initialisation of libnet_context. This fixes a valgrind warning. rafal (This used to be commit b751eb1102f3169b8eb66bae465cf79a44597bbe) --- source4/libnet/libnet.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 8398e9ca17..0dca57926d 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -47,6 +47,14 @@ struct libnet_context *libnet_context_init(struct event_context *ev) /* connected domain params */ ZERO_STRUCT(ctx->domain); + + /* currently opened user */ + ZERO_STRUCT(ctx->user_handle); + + /* init pipe pointers */ + ctx->samr_pipe = NULL; + ctx->lsa_pipe = NULL; + ctx->pipe = NULL; return ctx; } -- cgit From 1f8fda717f95edb63d4596321b8c8bfafd5a4497 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Mon, 21 Aug 2006 20:52:14 +0000 Subject: r17670: 1) Refactor libnet context structure a bit, to have rpc connection properties more consistently reflected. 2) Add domain open routine for lsa pipe - this is needed for ongoing name resolve function. Tests (still neglected) and comments to follow. rafal (This used to be commit fe5652c2b8121bbe3b9932c43164035355478611) --- source4/libnet/libnet.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 0dca57926d..6626e94b6f 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -45,16 +45,15 @@ struct libnet_context *libnet_context_init(struct event_context *ev) /* name resolution methods */ ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order()); - /* connected domain params */ - ZERO_STRUCT(ctx->domain); + /* connected services' params */ + ZERO_STRUCT(ctx->samr); + ZERO_STRUCT(ctx->lsa); /* currently opened user */ ZERO_STRUCT(ctx->user_handle); - /* init pipe pointers */ - ctx->samr_pipe = NULL; - ctx->lsa_pipe = NULL; - ctx->pipe = NULL; + /* init pipe pointer */ + ctx->pipe = NULL; return ctx; } -- cgit From e13715774c6a656b6f7952a5ae11c49390089b31 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 16 Sep 2006 17:59:33 +0000 Subject: r18587: fixed a potential memory leak in libnet (This used to be commit 935f6f34cfbec0cba6df246b7ef9fdfd604aad38) --- source4/libnet/libnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 6626e94b6f..2d55905b37 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -27,7 +27,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev) struct libnet_context *ctx; /* create brand new libnet context */ - ctx = talloc(NULL, struct libnet_context); + ctx = talloc(ev, struct libnet_context); if (!ctx) { return NULL; } -- cgit From a7795460a90d85ddcf42bf4eeafd4e4ee6a02636 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 28 Nov 2006 13:30:15 +0000 Subject: r19931: remove unused struct members metze (This used to be commit 45d5da47287a9e92b88db875d9ed447c60b57f88) --- source4/libnet/libnet.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 2d55905b37..24e291b6f8 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -49,11 +49,5 @@ struct libnet_context *libnet_context_init(struct event_context *ev) ZERO_STRUCT(ctx->samr); ZERO_STRUCT(ctx->lsa); - /* currently opened user */ - ZERO_STRUCT(ctx->user_handle); - - /* init pipe pointer */ - ctx->pipe = NULL; - return ctx; } -- cgit From 7c636fd2fe0a115999411cd2d67dbe8d421d49fd Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Fri, 11 May 2007 21:44:18 +0000 Subject: r22808: store default buffer size for samr operations in libnet context. This allows not requiring it as an argument in some function calls and still enables specifying any size if it's necessary via libnet context. rafal (This used to be commit 3e4b0c5b3b6d6bd155c8ce11b2342f4af08342f6) --- source4/libnet/libnet.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 24e291b6f8..9f971b59cd 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -47,7 +47,10 @@ struct libnet_context *libnet_context_init(struct event_context *ev) /* connected services' params */ ZERO_STRUCT(ctx->samr); - ZERO_STRUCT(ctx->lsa); + ZERO_STRUCT(ctx->lsa); + + /* default buffer size for various operations requiring specifying a buffer */ + ctx->samr.buf_size = 128; return ctx; } -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/libnet/libnet.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 9f971b59cd..a628a07a99 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From ffeee68e4b72dd94fee57366bd8d38b8c284c3d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 12:42:09 +0000 Subject: r25026: Move param/param.h out of includes.h (This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31) --- source4/libnet/libnet.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index a628a07a99..1994b68df0 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -20,6 +20,7 @@ #include "includes.h" #include "libnet/libnet.h" #include "lib/events/events.h" +#include "param/param.h" struct libnet_context *libnet_context_init(struct event_context *ev) { -- cgit From 37d53832a4623653f706e77985a79d84bd7c6694 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 28 Sep 2007 01:17:46 +0000 Subject: r25398: Parse loadparm context to all lp_*() functions. (This used to be commit 3fcc960839c6e5ca4de2c3c042f12f369ac5f238) --- source4/libnet/libnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 1994b68df0..86804df1ea 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -43,7 +43,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev) ctx->event_ctx = ev; /* name resolution methods */ - ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order()); + ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order(global_loadparm)); /* connected services' params */ ZERO_STRUCT(ctx->samr); -- cgit From 4c4323009fa83f00ed319de59a3aad48fcd65994 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Dec 2007 02:37:04 +0100 Subject: r26327: Explicit loadparm_context for RPC client functions. (This used to be commit eeb2251d22b3d6e0379444a73af69d1014692b07) --- source4/libnet/libnet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 86804df1ea..4502599217 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -22,7 +22,8 @@ #include "lib/events/events.h" #include "param/param.h" -struct libnet_context *libnet_context_init(struct event_context *ev) +struct libnet_context *libnet_context_init(struct event_context *ev, + struct loadparm_context *lp_ctx) { struct libnet_context *ctx; @@ -41,6 +42,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev) } } ctx->event_ctx = ev; + ctx->lp_ctx = lp_ctx; /* name resolution methods */ ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order(global_loadparm)); -- cgit From 6c77f353d3d952b46b401ab29837ba5b75e353c2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Dec 2007 02:37:13 +0100 Subject: r26328: remove more uses of global_loadparm. (This used to be commit 40ae12c08647c47a9c504d39ee6f61c32b4e5748) --- source4/libnet/libnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 4502599217..5c483a757c 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -45,7 +45,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev, ctx->lp_ctx = lp_ctx; /* name resolution methods */ - ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order(global_loadparm)); + ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order(lp_ctx)); /* connected services' params */ ZERO_STRUCT(ctx->samr); -- cgit From 5f4842cf65ce64bfdf577cd549565da20ca818cf Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 10 Dec 2007 18:41:19 +0100 Subject: r26376: Add context for libcli_resolve. (This used to be commit 459e1466a411d6f83b7372e248566e6e71c745fc) --- source4/libnet/libnet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 5c483a757c..d1605bc17d 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -21,6 +21,7 @@ #include "libnet/libnet.h" #include "lib/events/events.h" #include "param/param.h" +#include "libcli/resolve/resolve.h" struct libnet_context *libnet_context_init(struct event_context *ev, struct loadparm_context *lp_ctx) @@ -45,7 +46,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev, ctx->lp_ctx = lp_ctx; /* name resolution methods */ - ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order(lp_ctx)); + ctx->resolve_ctx = lp_resolve_context(lp_ctx); /* connected services' params */ ZERO_STRUCT(ctx->samr); -- cgit From 4f51b0246db3242ee02ee16905cba13a5dc5633a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 14 Apr 2008 12:43:37 -0400 Subject: Fix problems with event context not being the parent. (This used to be commit 957c4d893acf9e6db06a3fc3a4687ab6bb238635) --- source4/libnet/libnet.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index d1605bc17d..c966898cee 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -28,20 +28,17 @@ struct libnet_context *libnet_context_init(struct event_context *ev, { struct libnet_context *ctx; + /* We require an event context here */ + if (!ev) { + return NULL; + } + /* create brand new libnet context */ ctx = talloc(ev, struct libnet_context); if (!ctx) { return NULL; } - /* events */ - if (ev == NULL) { - ev = event_context_find(ctx); - if (ev == NULL) { - talloc_free(ctx); - return NULL; - } - } ctx->event_ctx = ev; ctx->lp_ctx = lp_ctx; -- cgit