From 8bf57cf8f57be28831023c2218d358b24b705256 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 May 2005 14:17:19 +0000 Subject: r6573: Start on my project to implement an NT4 compatible BDC in Samba4. This brings in a compatability layer for Samba3 in Samba4 - where we will start to define file formats and similar details. The 'net samdump' command uses 'password server = ' for now, and performs a similar task to Samba3's 'net rpc samsync'. Andrew Bartlett (This used to be commit 550f17f9924fe783917318753de7d1a388423908) --- source4/utils/net/net_vampire.c | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 source4/utils/net/net_vampire.c (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c new file mode 100644 index 0000000000..df2d84746b --- /dev/null +++ b/source4/utils/net/net_vampire.c @@ -0,0 +1,68 @@ +/* + Samba Unix/Linux SMB client library + Distributed SMB/CIFS Server Management Utility + + Copyright (C) 2004 Stefan Metzmacher + Copyright (C) 2005 Andrew Bartlett + + 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" +#include "utils/net/net.h" +#include "libnet/libnet.h" +#include "librpc/gen_ndr/ndr_samr.h" + +int net_samdump(struct net_context *ctx, int argc, const char **argv) +{ + NTSTATUS status; + struct libnet_context *libnetctx; + union libnet_SamDump r; + + libnetctx = libnet_context_init(); + if (!libnetctx) { + return -1; + } + libnetctx->credentials = ctx->credentials; + + /* prepare password change */ + r.generic.level = LIBNET_SAMDUMP_GENERIC; + r.generic.error_string = NULL; + + /* do the domain join */ + status = libnet_SamDump(libnetctx, ctx->mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0,("libnet_SamDump returned %s: %s\n", + nt_errstr(status), + r.generic.error_string)); + return -1; + } + + libnet_context_destroy(&libnetctx); + + return 0; +} + +int net_samdump_usage(struct net_context *ctx, int argc, const char **argv) +{ + d_printf("net samdump\n"); + return 0; +} + +int net_samdump_help(struct net_context *ctx, int argc, const char **argv) +{ + d_printf("Dumps the sam of the domain we are joined to.\n"); + return 0; +} -- cgit From 0a40093ef39a46b9df82d6d0486b70b354d9dde5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 3 Jun 2005 21:30:07 +0000 Subject: r7249: Cope with struct member rename (This used to be commit e7549f33f5fb06d8b2a8f31745545cc7b9c8d4f9) --- source4/utils/net/net_vampire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index df2d84746b..5a17544e82 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -35,7 +35,7 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) if (!libnetctx) { return -1; } - libnetctx->credentials = ctx->credentials; + libnetctx->cred = ctx->credentials; /* prepare password change */ r.generic.level = LIBNET_SAMDUMP_GENERIC; -- 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/utils/net/net_vampire.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index 5a17544e82..e60fd85a7d 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -31,7 +31,7 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) struct libnet_context *libnetctx; union libnet_SamDump r; - libnetctx = libnet_context_init(); + libnetctx = libnet_context_init(NULL); if (!libnetctx) { return -1; } @@ -50,7 +50,7 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) return -1; } - libnet_context_destroy(&libnetctx); + talloc_free(libnetctx); return 0; } -- cgit From 27ab60f5d406adee641d7a288822ba4c34eed416 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 25 Jul 2005 04:15:57 +0000 Subject: r8748: fixed build. Andrew, please check. (This used to be commit 9411bd4e5e7ac9fd0aacd1432de967eda45e64f4) --- source4/utils/net/net_vampire.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index e60fd85a7d..72f791db66 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -29,7 +29,7 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) { NTSTATUS status; struct libnet_context *libnetctx; - union libnet_SamDump r; + struct libnet_SamDump r; libnetctx = libnet_context_init(NULL); if (!libnetctx) { @@ -37,16 +37,14 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) } libnetctx->cred = ctx->credentials; - /* prepare password change */ - r.generic.level = LIBNET_SAMDUMP_GENERIC; - r.generic.error_string = NULL; + r.level = LIBNET_SAMDUMP_GENERIC; + r.error_string = NULL; - /* do the domain join */ status = libnet_SamDump(libnetctx, ctx->mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("libnet_SamDump returned %s: %s\n", nt_errstr(status), - r.generic.error_string)); + r.error_string)); return -1; } -- cgit From 6d26a7114f233418b17b76c3e8dc73086a901ed7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 25 Jul 2005 06:33:51 +0000 Subject: r8752: With all the infrustructure done, details like a SamSync migration into LDB are actually quite easy. This brings us the users, and sets basic domain information. You are expected to have provisioned with the settings for the target domain, and have joined the domain as a BDC. Then simply 'net samsync'. Now we just need to flesh out the delta types. Andrew Bartlett (This used to be commit 1e0f7792bb29b17c23197a5e42ee8cabb0cf17d0) --- source4/utils/net/net_vampire.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index 72f791db66..e898352cfc 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -64,3 +64,43 @@ int net_samdump_help(struct net_context *ctx, int argc, const char **argv) d_printf("Dumps the sam of the domain we are joined to.\n"); return 0; } + +int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) +{ + NTSTATUS status; + struct libnet_context *libnetctx; + struct libnet_samsync_ldb r; + + libnetctx = libnet_context_init(NULL); + if (!libnetctx) { + return -1; + } + libnetctx->cred = ctx->credentials; + + r.level = LIBNET_SAMSYNC_LDB_GENERIC; + r.error_string = NULL; + + status = libnet_samsync_ldb(libnetctx, ctx->mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0,("libnet_samsync_ldb returned %s: %s\n", + nt_errstr(status), + r.error_string)); + return -1; + } + + talloc_free(libnetctx); + + return 0; +} + +int net_samsync_ldb_usage(struct net_context *ctx, int argc, const char **argv) +{ + d_printf("net samsync_ldb\n"); + return 0; +} + +int net_samsync_ldb_help(struct net_context *ctx, int argc, const char **argv) +{ + d_printf("Syncrosnise into the local ldb the SAM of a domain.\n"); + return 0; +} -- cgit From 221c1512a8b4de9a568c0a0cdafa97ab5c53368c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 21 Dec 2005 22:02:52 +0000 Subject: r12411: Add 'net samdump keytab '. This extracts a remote windows domain into a keytab, suitable for use in ethereal for kerberos decryption. For the moment, like net samdump and net samsync, the 'password server' smb.conf option must be set to the binding string for the server. eg: password server = ncacn_np:mypdc Andrew Bartlett (This used to be commit 272013438f53bb168f74e09eb70fc96112b84772) --- source4/utils/net/net_vampire.c | 67 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index e898352cfc..75ad175c66 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -25,11 +25,77 @@ #include "libnet/libnet.h" #include "librpc/gen_ndr/ndr_samr.h" +static int net_samdump_keytab_usage(struct net_context *ctx, int argc, const char **argv) +{ + d_printf("net samdump keytab \n"); + return 0; +} + +static int net_samdump_keytab_help(struct net_context *ctx, int argc, const char **argv) +{ + d_printf("Dumps kerberos keys of a domain into a keytab.\n"); + return 0; +} + +static int net_samdump_keytab(struct net_context *ctx, int argc, const char **argv) +{ + NTSTATUS status; + struct libnet_context *libnetctx; + struct libnet_SamDump_keytab r; + + switch (argc) { + case 0: + return net_samdump_keytab_usage(ctx, argc, argv); + break; + case 1: + r.keytab_name = argv[0]; + break; + } + + libnetctx = libnet_context_init(NULL); + if (!libnetctx) { + return -1; + } + libnetctx->cred = ctx->credentials; + + r.level = LIBNET_SAMDUMP_GENERIC; + r.error_string = NULL; + + status = libnet_SamDump_keytab(libnetctx, ctx->mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0,("libnet_SamDump returned %s: %s\n", + nt_errstr(status), + r.error_string)); + return -1; + } + + talloc_free(libnetctx); + + return 0; +} + +/* main function table */ +static const struct net_functable net_samdump_functable[] = { + {"keytab", "dump keys into a keytab\n", net_samdump_keytab, net_samdump_keytab_usage}, + {NULL, NULL, NULL, NULL} +}; + int net_samdump(struct net_context *ctx, int argc, const char **argv) { NTSTATUS status; struct libnet_context *libnetctx; struct libnet_SamDump r; + int rc; + + switch (argc) { + case 0: + break; + case 1: + default: + rc = net_run_function(ctx, argc, argv, net_samdump_functable, + net_samdump_usage); + return rc; + } libnetctx = libnet_context_init(NULL); if (!libnetctx) { @@ -56,6 +122,7 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) int net_samdump_usage(struct net_context *ctx, int argc, const char **argv) { d_printf("net samdump\n"); + d_printf("net samdump keytab \n"); return 0; } -- cgit From a5a79e8b8cbdf24d5c2db45ece4110ed5d85e58f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 12 Jan 2006 09:33:49 +0000 Subject: r12865: Upgrade the librpc and libnet code. In librpc, always try SMB level authentication, even if trying schannel, but allow fallback to anonymous. This should better function with servers that set restrict anonymous. There are too many parts of Samba that get, parse and modify the binding parameters. Avoid the extra work, and add a binding element to the struct dcerpc_pipe The libnet vampire code has been refactored, to reduce extra layers and to better conform with the standard argument pattern. Also, take advantage of the new libnet_Lookup code, so we don't require the silly 'password server' smb.conf parameter. To better support forcing traffic to be sealed for the vampire operation, the dcerpc_bind_auth() function now takes an auth level parameter. Andrew Bartlett (This used to be commit d65b354959842326fdd4bd7eb7fbeea0390f4afa) --- source4/utils/net/net_vampire.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index 75ad175c66..f89739225d 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -48,7 +48,7 @@ static int net_samdump_keytab(struct net_context *ctx, int argc, const char **ar return net_samdump_keytab_usage(ctx, argc, argv); break; case 1: - r.keytab_name = argv[0]; + r.in.keytab_name = argv[0]; break; } @@ -58,14 +58,15 @@ static int net_samdump_keytab(struct net_context *ctx, int argc, const char **ar } libnetctx->cred = ctx->credentials; - r.level = LIBNET_SAMDUMP_GENERIC; - r.error_string = NULL; + r.out.error_string = NULL; + r.in.machine_account = NULL; + r.in.binding_string = NULL; status = libnet_SamDump_keytab(libnetctx, ctx->mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("libnet_SamDump returned %s: %s\n", nt_errstr(status), - r.error_string)); + r.out.error_string)); return -1; } @@ -103,14 +104,15 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) } libnetctx->cred = ctx->credentials; - r.level = LIBNET_SAMDUMP_GENERIC; - r.error_string = NULL; + r.out.error_string = NULL; + r.in.machine_account = NULL; + r.in.binding_string = NULL; status = libnet_SamDump(libnetctx, ctx->mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("libnet_SamDump returned %s: %s\n", nt_errstr(status), - r.error_string)); + r.out.error_string)); return -1; } @@ -144,14 +146,15 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) } libnetctx->cred = ctx->credentials; - r.level = LIBNET_SAMSYNC_LDB_GENERIC; - r.error_string = NULL; + r.out.error_string = NULL; + r.in.machine_account = NULL; + r.in.binding_string = NULL; status = libnet_samsync_ldb(libnetctx, ctx->mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("libnet_samsync_ldb returned %s: %s\n", nt_errstr(status), - r.error_string)); + r.out.error_string)); return -1; } -- cgit From f3db23ac75578198ee411b21a7ba2ec49dedafab Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 14 Jan 2006 06:17:24 +0000 Subject: r12928: This patch improves the interaction between the vampire and provsion code. Previously, we had to know (or guess) the host and domain guid at the provision stage. Now we query the database post-provision, to extract the values and fill in the zone file. This allows us to generate a correct zone file in the Windows migration case. In an effort to make SWAT easier to use, I have removed and renamed some of the provision options. I have also fixed a nasty issue in my js code. I had implictly declared a global variable of the name 'join', with disasterious results for any subsequent user of the string utility function: esp exception - ASSERT at lib/appweb/ejs/ejsParser.c:2064, 0 Backtrace: [ 0] substitute_var:20 -> list[i] = join("", list2) [ 1] setup_file:9 -> data = substitute_var(data, subobj) Andrew Bartlett (This used to be commit a38ceefd11f8b748f30383ef36a4752f178bfca1) --- source4/utils/net/net_vampire.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index f89739225d..00ae647016 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -24,6 +24,7 @@ #include "utils/net/net.h" #include "libnet/libnet.h" #include "librpc/gen_ndr/ndr_samr.h" +#include "auth/auth.h" static int net_samdump_keytab_usage(struct net_context *ctx, int argc, const char **argv) { @@ -150,7 +151,10 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) r.in.machine_account = NULL; r.in.binding_string = NULL; - status = libnet_samsync_ldb(libnetctx, ctx->mem_ctx, &r); + /* Needed to override the ACLs on ldb */ + r.in.session_info = system_session(libnetctx); + + status = libnet_samsync_ldb(libnetctx, libnetctx, &r); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("libnet_samsync_ldb returned %s: %s\n", nt_errstr(status), -- cgit From 8528016978b084213ef53d66e1b6e831b1a01acc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 16 Mar 2006 00:23:11 +0000 Subject: r14464: Don't include ndr_BASENAME.h files unless strictly required, instead try to include just the BASENAME.h files (containing only structs) (This used to be commit 3dd477ca5147f28a962b8437e2611a8222d706bd) --- source4/utils/net/net_vampire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index 00ae647016..8649740777 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -23,7 +23,7 @@ #include "includes.h" #include "utils/net/net.h" #include "libnet/libnet.h" -#include "librpc/gen_ndr/ndr_samr.h" +#include "librpc/gen_ndr/samr.h" #include "auth/auth.h" static int net_samdump_keytab_usage(struct net_context *ctx, int argc, const char **argv) -- cgit From ece95aad3da31809369e8867493bffb5cb749993 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Sun, 7 May 2006 13:40:56 +0000 Subject: r15490: Typo fixes and remove long forgotten commented piece. rafal (This used to be commit a2f6dc786031aa368b0398c21baf18cf82375c46) --- source4/utils/net/net_vampire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index 8649740777..dba51ea1af 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -175,6 +175,6 @@ int net_samsync_ldb_usage(struct net_context *ctx, int argc, const char **argv) int net_samsync_ldb_help(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syncrosnise into the local ldb the SAM of a domain.\n"); + d_printf("Synchronise into the local ldb the SAM of a domain.\n"); return 0; } -- 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/utils/net/net_vampire.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index dba51ea1af..86c7c0115a 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -7,7 +7,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, @@ -16,8 +16,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 43696d2752e2faad34fb3ed2a7dbf01d40ffdc46 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Dec 2007 15:53:28 +0100 Subject: r26252: Specify loadparm_context explicitly when creating sessions. (This used to be commit 7280c1e9415daabb2712db1372e23f9846272ede) --- source4/utils/net/net_vampire.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index 86c7c0115a..dc11917fa4 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -24,6 +24,7 @@ #include "libnet/libnet.h" #include "librpc/gen_ndr/samr.h" #include "auth/auth.h" +#include "param/param.h" static int net_samdump_keytab_usage(struct net_context *ctx, int argc, const char **argv) { @@ -151,7 +152,7 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) r.in.binding_string = NULL; /* Needed to override the ACLs on ldb */ - r.in.session_info = system_session(libnetctx); + r.in.session_info = system_session(libnetctx, global_loadparm); status = libnet_samsync_ldb(libnetctx, libnetctx, &r); if (!NT_STATUS_IS_OK(status)) { -- cgit From a693e6f1c71d9772b52cf40a85b0504cea837240 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 4 Dec 2007 19:33:00 +0100 Subject: r26295: Remove use of global_loadparm for net and wb_pam_auth. (This used to be commit 47696b42987ea67ae1c6c09a4bec5858e5db4542) --- source4/utils/net/net_vampire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index dc11917fa4..4e0f1501d9 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -152,7 +152,7 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) r.in.binding_string = NULL; /* Needed to override the ACLs on ldb */ - r.in.session_info = system_session(libnetctx, global_loadparm); + r.in.session_info = system_session(libnetctx, ctx->lp_ctx); status = libnet_samsync_ldb(libnetctx, libnetctx, &r); if (!NT_STATUS_IS_OK(status)) { -- 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/utils/net/net_vampire.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index 4e0f1501d9..c798112d7b 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -53,7 +53,7 @@ static int net_samdump_keytab(struct net_context *ctx, int argc, const char **ar break; } - libnetctx = libnet_context_init(NULL); + libnetctx = libnet_context_init(NULL, ctx->lp_ctx); if (!libnetctx) { return -1; } @@ -99,7 +99,7 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) return rc; } - libnetctx = libnet_context_init(NULL); + libnetctx = libnet_context_init(NULL, ctx->lp_ctx); if (!libnetctx) { return -1; } @@ -141,7 +141,7 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) struct libnet_context *libnetctx; struct libnet_samsync_ldb r; - libnetctx = libnet_context_init(NULL); + libnetctx = libnet_context_init(NULL, ctx->lp_ctx); if (!libnetctx) { return -1; } -- cgit From 8a982108a4f115e350c4246276f2ec886934c7fe Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 9 Apr 2008 14:59:32 +1000 Subject: Link the new vampire code togeather. This adds in the newly attached secrets handling, as well as an interface to the command line 'net' tool. Andrew Bartlett (This used to be commit 1282e3c39479aa580124206814b493370d10690a) --- source4/utils/net/net_vampire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index c798112d7b..4f6371d617 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -169,7 +169,7 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) int net_samsync_ldb_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("net samsync_ldb\n"); + d_printf("net samsync\n"); return 0; } -- 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/utils/net/net_vampire.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index 4f6371d617..38f05353ed 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -25,6 +25,7 @@ #include "librpc/gen_ndr/samr.h" #include "auth/auth.h" #include "param/param.h" +#include "lib/events/events.h" static int net_samdump_keytab_usage(struct net_context *ctx, int argc, const char **argv) { @@ -53,7 +54,7 @@ static int net_samdump_keytab(struct net_context *ctx, int argc, const char **ar break; } - libnetctx = libnet_context_init(NULL, ctx->lp_ctx); + libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx); if (!libnetctx) { return -1; } @@ -63,7 +64,7 @@ static int net_samdump_keytab(struct net_context *ctx, int argc, const char **ar r.in.machine_account = NULL; r.in.binding_string = NULL; - status = libnet_SamDump_keytab(libnetctx, ctx->mem_ctx, &r); + status = libnet_SamDump_keytab(libnetctx, ctx, &r); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("libnet_SamDump returned %s: %s\n", nt_errstr(status), @@ -99,7 +100,7 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) return rc; } - libnetctx = libnet_context_init(NULL, ctx->lp_ctx); + libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx); if (!libnetctx) { return -1; } @@ -109,7 +110,7 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) r.in.machine_account = NULL; r.in.binding_string = NULL; - status = libnet_SamDump(libnetctx, ctx->mem_ctx, &r); + status = libnet_SamDump(libnetctx, ctx, &r); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("libnet_SamDump returned %s: %s\n", nt_errstr(status), @@ -141,7 +142,7 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) struct libnet_context *libnetctx; struct libnet_samsync_ldb r; - libnetctx = libnet_context_init(NULL, ctx->lp_ctx); + libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx); if (!libnetctx) { return -1; } -- cgit From a5d52174bd993b32d01d26a795a56df4a92eba45 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 16 Apr 2008 22:30:15 +0200 Subject: Avoid event_find_context() when the event context is already available in the net utility. (This used to be commit d40804777edf41889bd461f63f7a07cc1cc60e27) --- source4/utils/net/net_vampire.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/utils/net/net_vampire.c') diff --git a/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c index 38f05353ed..14f6a07e4b 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/utils/net/net_vampire.c @@ -54,7 +54,7 @@ static int net_samdump_keytab(struct net_context *ctx, int argc, const char **ar break; } - libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx); + libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx); if (!libnetctx) { return -1; } @@ -100,7 +100,7 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) return rc; } - libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx); + libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx); if (!libnetctx) { return -1; } @@ -142,7 +142,7 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) struct libnet_context *libnetctx; struct libnet_samsync_ldb r; - libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx); + libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx); if (!libnetctx) { return -1; } -- cgit