From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/rpcclient/cmd_test.c | 68 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 source3/rpcclient/cmd_test.c (limited to 'source3/rpcclient/cmd_test.c') diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c new file mode 100644 index 0000000000..94545dc74e --- /dev/null +++ b/source3/rpcclient/cmd_test.c @@ -0,0 +1,68 @@ +/* + Unix SMB/CIFS implementation. + RPC pipe client + + Copyright (C) Volker Lendecke 2005 + + 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 "rpcclient.h" + +static NTSTATUS cmd_testme(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + int argc, const char **argv) +{ + struct rpc_pipe_client *lsa_pipe = NULL, *samr_pipe = NULL; + NTSTATUS status = NT_STATUS_UNSUCCESSFUL; + POLICY_HND pol; + + d_printf("testme\n"); + + lsa_pipe = cli_rpc_pipe_open_noauth(cli->cli, PI_LSARPC, &status); + if (lsa_pipe == NULL) goto done; + + samr_pipe = cli_rpc_pipe_open_noauth(cli->cli, PI_SAMR, &status); + if (samr_pipe == NULL) goto done; + + status = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False, + SEC_RIGHTS_QUERY_VALUE, &pol); + + if (!NT_STATUS_IS_OK(status)) + goto done; + + status = rpccli_lsa_close(lsa_pipe, mem_ctx, &pol); + + if (!NT_STATUS_IS_OK(status)) + goto done; + + done: + if (lsa_pipe != NULL) cli_rpc_pipe_close(lsa_pipe); + if (samr_pipe != NULL) cli_rpc_pipe_close(samr_pipe); + + return status; +} + +/* List of commands exported by this module */ + +struct cmd_set test_commands[] = { + + { "TESTING" }, + + { "testme", RPC_RTYPE_NTSTATUS, cmd_testme, NULL, + -1, NULL, "Sample test", "testme" }, + + { NULL } +}; -- cgit From 05ba38f7549f91670761928f1c959b65eb4bcec1 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 20 Sep 2006 22:49:02 +0000 Subject: r18747: replace rpccli_lsa_close() with rpccli_lsa_Close() (This used to be commit 50d74ce0488a9bd0980cdc6d523a210f6238ef74) --- source3/rpcclient/cmd_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/rpcclient/cmd_test.c') diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c index 94545dc74e..28c13965d8 100644 --- a/source3/rpcclient/cmd_test.c +++ b/source3/rpcclient/cmd_test.c @@ -43,7 +43,7 @@ static NTSTATUS cmd_testme(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, if (!NT_STATUS_IS_OK(status)) goto done; - status = rpccli_lsa_close(lsa_pipe, mem_ctx, &pol); + status = rpccli_lsa_Close(lsa_pipe, mem_ctx, &pol); if (!NT_STATUS_IS_OK(status)) goto done; -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/rpcclient/cmd_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/rpcclient/cmd_test.c') diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c index 28c13965d8..2c7e031d48 100644 --- a/source3/rpcclient/cmd_test.c +++ b/source3/rpcclient/cmd_test.c @@ -6,7 +6,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, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/rpcclient/cmd_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/rpcclient/cmd_test.c') diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c index 2c7e031d48..089d7bcaa3 100644 --- a/source3/rpcclient/cmd_test.c +++ b/source3/rpcclient/cmd_test.c @@ -15,8 +15,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 e73e8297f5484b6c7f525917679414c09a145cf0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Apr 2008 13:51:46 +0200 Subject: Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct (This used to be commit 99fc3283c4ecc791f5a242bd1983b4352ce3e6cf) --- source3/rpcclient/cmd_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/rpcclient/cmd_test.c') diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c index 089d7bcaa3..f9ea5c0fc2 100644 --- a/source3/rpcclient/cmd_test.c +++ b/source3/rpcclient/cmd_test.c @@ -48,8 +48,8 @@ static NTSTATUS cmd_testme(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, goto done; done: - if (lsa_pipe != NULL) cli_rpc_pipe_close(lsa_pipe); - if (samr_pipe != NULL) cli_rpc_pipe_close(samr_pipe); + TALLOC_FREE(lsa_pipe); + TALLOC_FREE(samr_pipe); return status; } -- cgit From b9cc05506273e5ce3398a5912b9c9e5989717480 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Apr 2008 14:05:25 +0200 Subject: Introduce rpc_pipe_np_smb_conn() This abstracts away all references to rpc_pipe_client->cli, the only reference is now in cli_pipe.c. (This used to be commit c56e1c08cef107ff33a34346ceeca3475a102b19) --- source3/rpcclient/cmd_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/rpcclient/cmd_test.c') diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c index f9ea5c0fc2..dd956604cc 100644 --- a/source3/rpcclient/cmd_test.c +++ b/source3/rpcclient/cmd_test.c @@ -30,10 +30,12 @@ static NTSTATUS cmd_testme(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, d_printf("testme\n"); - lsa_pipe = cli_rpc_pipe_open_noauth(cli->cli, PI_LSARPC, &status); + lsa_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli), + PI_LSARPC, &status); if (lsa_pipe == NULL) goto done; - samr_pipe = cli_rpc_pipe_open_noauth(cli->cli, PI_SAMR, &status); + samr_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli), + PI_SAMR, &status); if (samr_pipe == NULL) goto done; status = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False, -- cgit From 1335da2a7cc639310e5d389e8e8dbe67c4e7ca25 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Jul 2008 11:04:31 +0200 Subject: Refactoring: Change calling conventions for cli_rpc_pipe_open_noauth Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS (This used to be commit 9abc9dc4dc13bd3e42f98eff64eacf24b51f5779) --- source3/rpcclient/cmd_test.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'source3/rpcclient/cmd_test.c') diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c index dd956604cc..599e4c255d 100644 --- a/source3/rpcclient/cmd_test.c +++ b/source3/rpcclient/cmd_test.c @@ -30,13 +30,19 @@ static NTSTATUS cmd_testme(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, d_printf("testme\n"); - lsa_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli), - PI_LSARPC, &status); - if (lsa_pipe == NULL) goto done; + status = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli), + &ndr_table_lsarpc.syntax_id, + &lsa_pipe); + if (!NT_STATUS_IS_OK(status)) { + goto done; + } - samr_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli), - PI_SAMR, &status); - if (samr_pipe == NULL) goto done; + status = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli), + &ndr_table_samr.syntax_id, + &samr_pipe); + if (!NT_STATUS_IS_OK(status)) { + goto done; + } status = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False, SEC_RIGHTS_QUERY_VALUE, &pol); -- cgit From 82b5f54f96b1161b8357a69b985c75f2853573ef Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Jul 2008 18:17:52 +0200 Subject: Refactoring: rpcclient uses ndr_syntax_id instead of pipe_idx (This used to be commit 85db87c451dacf80e9575c04e9e08c625b3f1199) --- source3/rpcclient/cmd_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/rpcclient/cmd_test.c') diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c index 599e4c255d..0f1d4221ca 100644 --- a/source3/rpcclient/cmd_test.c +++ b/source3/rpcclient/cmd_test.c @@ -69,7 +69,7 @@ struct cmd_set test_commands[] = { { "TESTING" }, { "testme", RPC_RTYPE_NTSTATUS, cmd_testme, NULL, - -1, NULL, "Sample test", "testme" }, + NULL, NULL, "Sample test", "testme" }, { NULL } }; -- cgit