From f7065cc0a5555a32499908a499f926ede3f7d851 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 12 Dec 2003 22:48:57 +0000 Subject: after chatting with jeremy I decided to use a separate directory for each rpc endpoint implementation, so we will have rpc_server/samr/ rpc_server/lsa/ etc. this should encourage each pipe to be written in a more complete manner, as it gives easy ways to split the pipe into multiple modules. (This used to be commit 30a996b68222de72dd7959a09ff884f266f2fc9a) --- source4/rpc_server/echo/rpc_echo.c | 181 +++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 source4/rpc_server/echo/rpc_echo.c (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c new file mode 100644 index 0000000000..42856737c4 --- /dev/null +++ b/source4/rpc_server/echo/rpc_echo.c @@ -0,0 +1,181 @@ +/* + Unix SMB/CIFS implementation. + + endpoint server for the echo pipe + + Copyright (C) Andrew Tridgell 2003 + + 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" + + +static NTSTATUS echo_AddOne(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_AddOne *r) +{ + *r->out.v = *r->in.v + 1; + return NT_STATUS_OK; +} + +static NTSTATUS echo_EchoData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_EchoData *r) +{ + r->out.out_data = talloc(mem_ctx, r->in.len); + if (!r->out.out_data) { + return NT_STATUS_NO_MEMORY; + } + memcpy(r->out.out_data, r->in.in_data, r->in.len); + + return NT_STATUS_OK; +} + +static NTSTATUS echo_SinkData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_SinkData *r) +{ + return NT_STATUS_OK; +} + +static NTSTATUS echo_SourceData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_SourceData *r) +{ + int i; + for (i=0;iin.len;i++) { + r->out.data[i] = i; + } + + return NT_STATUS_OK; +} + +static NTSTATUS echo_TestCall(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct TestCall *r) +{ + r->out.s2 = "this is a test string"; + + return NT_STATUS_OK; +} + +static NTSTATUS echo_TestCall2(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct TestCall2 *r) +{ + r->out.info = talloc(mem_ctx, sizeof(*r->out.info)); + if (!r->out.info) { + r->out.result = NT_STATUS_NO_MEMORY; + return NT_STATUS_OK; + } + + r->out.result = NT_STATUS_OK; + + switch (r->in.level) { + case 1: + r->out.info->info1.v = 10; + break; + case 2: + r->out.info->info2.v = 20; + break; + case 3: + r->out.info->info3.v = 30; + break; + case 4: + r->out.info->info4.v.low = 40; + r->out.info->info4.v.high = 0; + break; + case 5: + r->out.info->info5.v1 = 50; + r->out.info->info5.v2.low = 60; + r->out.info->info5.v2.high = 0; + break; + case 6: + r->out.info->info6.v1 = 70; + r->out.info->info6.info1.v= 80; + break; + case 7: + r->out.info->info7.v1 = 80; + r->out.info->info7.info4.v.low = 90; + r->out.info->info7.info4.v.high = 0; + break; + default: + r->out.result = NT_STATUS_INVALID_LEVEL; + break; + } + + return NT_STATUS_OK; +} + + + + +/************************************************************************** + all the code below this point is boilerplate that will be auto-generated +***************************************************************************/ + +static const dcesrv_dispatch_fn_t dispatch_table[] = { + (dcesrv_dispatch_fn_t)echo_AddOne, + (dcesrv_dispatch_fn_t)echo_EchoData, + (dcesrv_dispatch_fn_t)echo_SinkData, + (dcesrv_dispatch_fn_t)echo_SourceData, + (dcesrv_dispatch_fn_t)echo_TestCall, + (dcesrv_dispatch_fn_t)echo_TestCall2 +}; + + +/* + return True if we want to handle the given endpoint +*/ +static BOOL op_query_endpoint(const struct dcesrv_endpoint *ep) +{ + return dcesrv_table_query(&dcerpc_table_rpcecho, ep); +} + +/* + setup for a particular rpc interface +*/ +static BOOL op_set_interface(struct dcesrv_state *dce, const char *uuid, uint32 if_version) +{ + if (strcasecmp(uuid, dcerpc_table_rpcecho.uuid) != 0 || + if_version != dcerpc_table_rpcecho.if_version) { + DEBUG(2,("Attempt to use unknown interface %s/%d\n", uuid, if_version)); + return False; + } + + dce->ndr = &dcerpc_table_rpcecho; + dce->dispatch = dispatch_table; + + return True; +} + + +/* op_connect is called when a connection is made to an endpoint */ +static NTSTATUS op_connect(struct dcesrv_state *dce) +{ + return NT_STATUS_OK; +} + +static void op_disconnect(struct dcesrv_state *dce) +{ + /* nothing to do */ +} + + +static const struct dcesrv_endpoint_ops rpc_echo_ops = { + op_query_endpoint, + op_set_interface, + op_connect, + op_disconnect +}; + +/* + register with the dcerpc server +*/ +void rpc_echo_init(struct server_context *smb) +{ + if (!dcesrv_endpoint_register(smb, &rpc_echo_ops)) { + DEBUG(1,("Failed to register rpcecho endpoint\n")); + } +} -- cgit From 340d9b71f9e75d634389104da5949ba59669ede2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 13 Dec 2003 02:20:40 +0000 Subject: added a basic dcerpc endpoint mapper to Samba4. Currently only implements the epm_Lookup() call, I'll add the other important calls soon. I was rather pleased to find that epm_Lookup() worked first time, which is particularly surprising given its complexity. This required quite a bit of new infrastructure: * a generic way of handling dcerpc policy handles in the rpc server * added type checked varients of talloc. These are much less error prone. I'd like to move to using these for nearly all uses of talloc. * added more dcerpc fault handling code, and translation from NTSTATUS to a dcerpc fault code * added data_blob_talloc_zero() for allocating an initially zero blob * added a endpoint enumeration hook in the dcerpc endpoint server operations (This used to be commit 3f85f9b782dc17417baf1ca557fcae22f5b6a83a) --- source4/rpc_server/echo/rpc_echo.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 42856737c4..f741e63d62 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -163,11 +163,17 @@ static void op_disconnect(struct dcesrv_state *dce) } +static int op_lookup_endpoints(TALLOC_CTX *mem_ctx, struct dcesrv_ep_iface **e) +{ + return dcesrv_lookup_endpoints(&dcerpc_table_rpcecho, mem_ctx, e); +} + static const struct dcesrv_endpoint_ops rpc_echo_ops = { op_query_endpoint, op_set_interface, op_connect, - op_disconnect + op_disconnect, + op_lookup_endpoints }; /* -- cgit From d4705378ce88d1bb2f787338c531998d37d078ef Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 13 Dec 2003 10:58:48 +0000 Subject: dcerpc over tcp in the samba4 server now works to some extent. It needs quite a bit more work to get it finished. The biggest missing feature is the lack of NTLMSSP which is needed for basic authentication over tcp (This used to be commit 9fb0f0369356909c99389e2cbc525be27c08793c) --- source4/rpc_server/echo/rpc_echo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index f741e63d62..0f3c504c37 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -179,9 +179,9 @@ static const struct dcesrv_endpoint_ops rpc_echo_ops = { /* register with the dcerpc server */ -void rpc_echo_init(struct server_context *smb) +void rpc_echo_init(struct dcesrv_context *dce) { - if (!dcesrv_endpoint_register(smb, &rpc_echo_ops)) { + if (!dcesrv_endpoint_register(dce, &rpc_echo_ops)) { DEBUG(1,("Failed to register rpcecho endpoint\n")); } } -- cgit From d262b8c3c79b2fbb0bf8c330d765f89210948a26 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 13 Dec 2003 23:25:15 +0000 Subject: completed the linkage between the endpoint mapper and the dcerpc server endpoints. We can now successfully setup listening endpoints on high ports, then use our endpoint mapper redirect incoming clients to the right port. also greatly cleanup the rpc over tcp session handling. (This used to be commit 593bc29bbe0e46d356d001160e8a3332a88f2fa8) --- source4/rpc_server/echo/rpc_echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 0f3c504c37..d62ebc3d26 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -181,7 +181,7 @@ static const struct dcesrv_endpoint_ops rpc_echo_ops = { */ void rpc_echo_init(struct dcesrv_context *dce) { - if (!dcesrv_endpoint_register(dce, &rpc_echo_ops)) { + if (!dcesrv_endpoint_register(dce, &rpc_echo_ops, &dcerpc_table_rpcecho)) { DEBUG(1,("Failed to register rpcecho endpoint\n")); } } -- cgit From f6eb8342cba87c7c8f17471ed9783b567d36b0ed Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Dec 2003 13:22:12 +0000 Subject: added auto-generation of the server side boilerplate code for each pipe. The server side code gets generated as librpc/gen_ndr/ndr_NAME_s.c and gets included in the pipe module (This used to be commit bd3dcfe5820489a838e19b244266bd9126af5eb4) --- source4/rpc_server/echo/rpc_echo.c | 82 ++------------------------------------ 1 file changed, 4 insertions(+), 78 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index d62ebc3d26..1d3846aaff 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -55,14 +55,14 @@ static NTSTATUS echo_SourceData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, s return NT_STATUS_OK; } -static NTSTATUS echo_TestCall(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct TestCall *r) +static NTSTATUS echo_TestCall(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) { r->out.s2 = "this is a test string"; return NT_STATUS_OK; } -static NTSTATUS echo_TestCall2(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct TestCall2 *r) +static NTSTATUS echo_TestCall2(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_TestCall2 *r) { r->out.info = talloc(mem_ctx, sizeof(*r->out.info)); if (!r->out.info) { @@ -109,79 +109,5 @@ static NTSTATUS echo_TestCall2(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, st } - - -/************************************************************************** - all the code below this point is boilerplate that will be auto-generated -***************************************************************************/ - -static const dcesrv_dispatch_fn_t dispatch_table[] = { - (dcesrv_dispatch_fn_t)echo_AddOne, - (dcesrv_dispatch_fn_t)echo_EchoData, - (dcesrv_dispatch_fn_t)echo_SinkData, - (dcesrv_dispatch_fn_t)echo_SourceData, - (dcesrv_dispatch_fn_t)echo_TestCall, - (dcesrv_dispatch_fn_t)echo_TestCall2 -}; - - -/* - return True if we want to handle the given endpoint -*/ -static BOOL op_query_endpoint(const struct dcesrv_endpoint *ep) -{ - return dcesrv_table_query(&dcerpc_table_rpcecho, ep); -} - -/* - setup for a particular rpc interface -*/ -static BOOL op_set_interface(struct dcesrv_state *dce, const char *uuid, uint32 if_version) -{ - if (strcasecmp(uuid, dcerpc_table_rpcecho.uuid) != 0 || - if_version != dcerpc_table_rpcecho.if_version) { - DEBUG(2,("Attempt to use unknown interface %s/%d\n", uuid, if_version)); - return False; - } - - dce->ndr = &dcerpc_table_rpcecho; - dce->dispatch = dispatch_table; - - return True; -} - - -/* op_connect is called when a connection is made to an endpoint */ -static NTSTATUS op_connect(struct dcesrv_state *dce) -{ - return NT_STATUS_OK; -} - -static void op_disconnect(struct dcesrv_state *dce) -{ - /* nothing to do */ -} - - -static int op_lookup_endpoints(TALLOC_CTX *mem_ctx, struct dcesrv_ep_iface **e) -{ - return dcesrv_lookup_endpoints(&dcerpc_table_rpcecho, mem_ctx, e); -} - -static const struct dcesrv_endpoint_ops rpc_echo_ops = { - op_query_endpoint, - op_set_interface, - op_connect, - op_disconnect, - op_lookup_endpoints -}; - -/* - register with the dcerpc server -*/ -void rpc_echo_init(struct dcesrv_context *dce) -{ - if (!dcesrv_endpoint_register(dce, &rpc_echo_ops, &dcerpc_table_rpcecho)) { - DEBUG(1,("Failed to register rpcecho endpoint\n")); - } -} +/* include the generated boilerplate */ +#include "librpc/gen_ndr/ndr_echo_s.c" -- cgit From a22917260c56294a3627d1a71649683c9764737e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Dec 2003 01:06:01 +0000 Subject: zero length echo is not an error (This used to be commit f21d6351d0441e5bc77aca07a2863ef9f999bb92) --- source4/rpc_server/echo/rpc_echo.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 1d3846aaff..9d2c72e1b6 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -31,6 +31,10 @@ static NTSTATUS echo_AddOne(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struc static NTSTATUS echo_EchoData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_EchoData *r) { + if (!r->in.len) { + return NT_STATUS_OK; + } + r->out.out_data = talloc(mem_ctx, r->in.len); if (!r->out.out_data) { return NT_STATUS_NO_MEMORY; -- cgit From 7e6cf43756b7643e2f0ee7ada5076f36f3a24bb7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 8 Jan 2004 22:55:27 +0000 Subject: This patch adds a better dcerpc server infastructure. 1.) We now register endpoint servers add startup via register_backend() and later use the smb.conf 'dcerpc endpoint servers' parameter to setup the dcesrv_context 2.) each endpoint server can register at context creation time as much interfaces as it wants (multiple interfaces on one endpoint are supported!) (NOTE: there's a difference between 'endpoint server' and 'endpoint'! for details look at rpc_server/dcesrv_server.h) 3.) one endpoint can have a security descriptor registered to it self this will be checked in the future when a client wants to connect to an smb pipe endpoint. 4.) we now have a 'remote' endpoint server, which works like the ntvfs_cifs module it takes this options in the [globals] section: dcerpc remote:interfaces = srvsvc, winreg, w32time, epmapper dcerpc remote:binding = ... dcerpc remote:user = ... dcerpc remote:password = ... 5.) we currently have tree endpoint servers: epmapper, rpcecho and remote the default for the 'dcerpc endpiont servers = epmapper, rpcecho' for testing you can also do dcerpc endpoint servers = rpcecho, remote, epmapper dcerpc remote:interfaces = srvsvc, samr, netlogon 6,) please notice the the epmapper now only returns NO_ENTRIES (but I think we'll find a solution for this too:-) 7.) also there're some other stuff left, but step by step :-) This patch also includes updates for the register_subsystem() , ntvfs_init(), and some other funtions to check for duplicate subsystem registration metze (hmmm, my first large commit...I hope it works as supposed :-) (This used to be commit 917e45dafd5be4c2cd90ff425b8d6f8403122349) --- source4/rpc_server/echo/rpc_echo.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 9d2c72e1b6..ec5d667b46 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -23,13 +23,13 @@ #include "includes.h" -static NTSTATUS echo_AddOne(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_AddOne *r) +static NTSTATUS echo_AddOne(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_AddOne *r) { *r->out.v = *r->in.v + 1; return NT_STATUS_OK; } -static NTSTATUS echo_EchoData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_EchoData *r) +static NTSTATUS echo_EchoData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_EchoData *r) { if (!r->in.len) { return NT_STATUS_OK; @@ -44,12 +44,12 @@ static NTSTATUS echo_EchoData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, str return NT_STATUS_OK; } -static NTSTATUS echo_SinkData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_SinkData *r) +static NTSTATUS echo_SinkData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_SinkData *r) { return NT_STATUS_OK; } -static NTSTATUS echo_SourceData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_SourceData *r) +static NTSTATUS echo_SourceData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_SourceData *r) { int i; for (i=0;iin.len;i++) { @@ -59,14 +59,14 @@ static NTSTATUS echo_SourceData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, s return NT_STATUS_OK; } -static NTSTATUS echo_TestCall(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) +static NTSTATUS echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) { r->out.s2 = "this is a test string"; return NT_STATUS_OK; } -static NTSTATUS echo_TestCall2(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_TestCall2 *r) +static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall2 *r) { r->out.info = talloc(mem_ctx, sizeof(*r->out.info)); if (!r->out.info) { -- cgit From 21e6b1531b4e656af5962fdbeb671350f653fc26 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 May 2004 06:07:52 +0000 Subject: r464: a big improvement to the API for writing server-side RPC servers. Previously the server pipe code needed to return the RPC level status (nearly always "OK") and separately set the function call return using r->out.result. All the programmers writing servers (metze, jelmer and me) were often getting this wrong, by doing things like "return NT_STATUS_NO_MEMORY" which was really quite meaningless as there is no code like that at the dcerpc level. I have now modified pidl to generate the necessary boilerplate so that just returning the status you want from the function will work. So for a NTSTATUS function you return NT_STATUS_XXX and from a WERROR function you return WERR_XXX. If you really want to generate a DCERPC level fault rather than just a return value in your function then you should use the DCESRV_FAULT() macro which will correctly generate a fault for you. As a side effect, this also adds automatic type checking of all of our server side rpc functions, which was impossible with the old API. When I changed the API I found and fixed quite a few functions with the wrong type information, so this is definately useful. I have also changed the server side template generation to generate a DCERPC "operation range error" by default when you have not yet filled in a server side function. This allows us to correctly implement functions in any order in our rpc pipe servers and give the client the right information about the fault. (This used to be commit a4df5c7cf88891a78d82c8d6d7f058d8485e73f0) --- source4/rpc_server/echo/rpc_echo.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index ec5d667b46..25ac28a664 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -70,12 +70,9 @@ static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *m { r->out.info = talloc(mem_ctx, sizeof(*r->out.info)); if (!r->out.info) { - r->out.result = NT_STATUS_NO_MEMORY; - return NT_STATUS_OK; + return NT_STATUS_NO_MEMORY; } - r->out.result = NT_STATUS_OK; - switch (r->in.level) { case 1: r->out.info->info1.v = 10; @@ -105,8 +102,7 @@ static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *m r->out.info->info7.info4.v.high = 0; break; default: - r->out.result = NT_STATUS_INVALID_LEVEL; - break; + return NT_STATUS_INVALID_LEVEL; } return NT_STATUS_OK; -- cgit From 579c13da43d5b40ac6d6c1436399fbc1d8dfd054 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 25 May 2004 13:57:39 +0000 Subject: r873: converted samba4 to use real 64 bit integers instead of structures. This was suggested by metze recently. I checked on the build farm and all the machines we have support 64 bit ints, and support the LL suffix for 64 bit constants. I suspect some won't support strtoll() and related functions, so we will probably need replacements for those. (This used to be commit 9a9244a1c66654c12abe4379661cba83a73c4c21) --- source4/rpc_server/echo/rpc_echo.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 25ac28a664..c4e1256841 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -84,13 +84,11 @@ static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *m r->out.info->info3.v = 30; break; case 4: - r->out.info->info4.v.low = 40; - r->out.info->info4.v.high = 0; + r->out.info->info4.v = 40; break; case 5: r->out.info->info5.v1 = 50; - r->out.info->info5.v2.low = 60; - r->out.info->info5.v2.high = 0; + r->out.info->info5.v2 = 60; break; case 6: r->out.info->info6.v1 = 70; @@ -98,8 +96,7 @@ static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *m break; case 7: r->out.info->info7.v1 = 80; - r->out.info->info7.info4.v.low = 90; - r->out.info->info7.info4.v.high = 0; + r->out.info->info7.info4.v = 90; break; default: return NT_STATUS_INVALID_LEVEL; -- cgit From f891ff694b84304ba34ec3b6367e52b30d77be59 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 30 Aug 2004 07:36:16 +0000 Subject: r2105: added a TestSleep() operation to the echo pipe and extended the RPC-ECHO test to use it to test asynchronous rpc operations. (This used to be commit a5eb6cad5050928fab593e1f9a82fbfba589120c) --- source4/rpc_server/echo/rpc_echo.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index c4e1256841..066bb2cdc1 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -105,6 +105,11 @@ static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *m return NT_STATUS_OK; } +static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r) +{ + sleep(r->in.seconds); + return r->in.seconds; +} /* include the generated boilerplate */ #include "librpc/gen_ndr/ndr_echo_s.c" -- cgit From 90067934cd3195df80f8b1e614629d51fffcb38b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Nov 2004 10:30:34 +0000 Subject: r3428: switched to using minimal includes for the auto-generated RPC code. The thing that finally convinced me that minimal includes was worth pursuing for rpc was a compiler (tcc) that failed to build Samba due to reaching internal limits of the size of include files. Also the fact that includes.h.gch was 16MB, which really seems excessive. This patch brings it back to 12M, which is still too large, but better. Note that this patch speeds up compile times for both the pch and non-pch case. This change also includes the addition iof a "depends()" option in our IDL files, allowing you to specify that one IDL file depends on another. This capability was needed for the auto-includes generation. (This used to be commit b8f5fa8ac8e8725f3d321004f0aedf4246fc6b49) --- source4/rpc_server/echo/rpc_echo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 066bb2cdc1..fe5e76fb94 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "librpc/gen_ndr/ndr_echo.h" static NTSTATUS echo_AddOne(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_AddOne *r) -- cgit From c051779a0a34a9c40a5425fb1eb821983b8dc852 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Nov 2004 07:42:47 +0000 Subject: r3468: split out dcerpc_server.h (This used to be commit 729e0026e4408f74f140375537d4fe48c1fc3242) --- source4/rpc_server/echo/rpc_echo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index fe5e76fb94..6e8b94c610 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "rpc_server/dcerpc_server.h" #include "librpc/gen_ndr/ndr_echo.h" -- cgit From 2f9e170f45e128eb6ab6bd97c9c8b40dcd9a97fa Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 4 Dec 2004 09:30:38 +0000 Subject: r4058: added a type safe version of smb_xmalloc() (This used to be commit 1235afa5fe3a396cd7a180cbc500834a30fbaa80) --- source4/rpc_server/echo/rpc_echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 6e8b94c610..f86ae6debf 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -70,7 +70,7 @@ static NTSTATUS echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *me static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall2 *r) { - r->out.info = talloc(mem_ctx, sizeof(*r->out.info)); + r->out.info = talloc_p(mem_ctx, union echo_Info); if (!r->out.info) { return NT_STATUS_NO_MEMORY; } -- cgit From 7588a01cb6d387440d778e3bd77225b287cf48bc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 Jan 2005 23:27:12 +0000 Subject: r4520: added a enum test function to the echo pipe (This used to be commit f9e0aa1ab1faac039893db241819907c9c4bb510) --- source4/rpc_server/echo/rpc_echo.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index f86ae6debf..543bca1073 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -107,6 +107,12 @@ static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *m return NT_STATUS_OK; } +static NTSTATUS echo_TestEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestEnum *r) +{ + r->out.foo2->e1 = ECHO_ENUM2; + return NT_STATUS_OK; +} + static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r) { sleep(r->in.seconds); -- cgit From ddc10d4d37984246a6547e34a32d629c689c40d1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Jan 2005 03:06:58 +0000 Subject: r4549: got rid of a lot more uses of plain talloc(), instead using talloc_size() or talloc_array_p() where appropriate. also fixed a memory leak in pvfs_copy_file() (failed to free a memory context) (This used to be commit 89b74b53546e1570b11b3702f40bee58aed8c503) --- source4/rpc_server/echo/rpc_echo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 543bca1073..e5c1ee56ce 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -37,11 +37,10 @@ static NTSTATUS echo_EchoData(struct dcesrv_call_state *dce_call, TALLOC_CTX *me return NT_STATUS_OK; } - r->out.out_data = talloc(mem_ctx, r->in.len); + r->out.out_data = talloc_memdup(mem_ctx, r->in.in_data, r->in.len); if (!r->out.out_data) { return NT_STATUS_NO_MEMORY; } - memcpy(r->out.out_data, r->in.in_data, r->in.len); return NT_STATUS_OK; } -- cgit From fae215266b6711b24f4893653b146751885e4e5f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 11 Jan 2005 16:53:02 +0000 Subject: r4690: - add support for async rpc server replies the backend should check for (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_MAY_ASYNC) then it's allowed to reply async then the backend should mark that call as async with dce_call->state_flags |= DCESRV_CALL_STATE_FLAG_ASYNC; later it has to manualy set r->out.result and then send the reply by calling status = dcesrv_reply(p->dce_call); NOTE: that ncacn_np doesn't support async replies yet - implement an async version of echo_TestSleep - reenable the echo_TestSleep torture test (this need to be more strict when we have support for async ncacn_np) metze (This used to be commit f0a0dbeb25b034b1333078ca085999359f5f6209) --- source4/rpc_server/echo/rpc_echo.c | 63 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index e5c1ee56ce..164e2d588f 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -4,6 +4,7 @@ endpoint server for the echo pipe Copyright (C) Andrew Tridgell 2003 + Copyright (C) Stefan (metze) Metzmacher 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 @@ -23,6 +24,7 @@ #include "includes.h" #include "rpc_server/dcerpc_server.h" #include "librpc/gen_ndr/ndr_echo.h" +#include "events.h" static NTSTATUS echo_AddOne(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_AddOne *r) @@ -112,10 +114,67 @@ static NTSTATUS echo_TestEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *me return NT_STATUS_OK; } +struct echo_TestSleep_private { + struct dcesrv_call_state *dce_call; + struct echo_TestSleep *r; + struct timed_event *te; +}; + +static void echo_TestSleep_handler(struct event_context *ev, struct timed_event *te, struct timeval t) +{ + struct echo_TestSleep_private *p = te->private; + struct echo_TestSleep *r = p->r; + NTSTATUS status; + + r->out.result = r->in.seconds; + + status = dcesrv_reply(p->dce_call); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0,("echo_TestSleep_handler: dcesrv_reply() failed - %s\n", + nt_errstr(status))); + } +} + +static int echo_TestSleep_destructor(void *ptr) +{ + struct echo_TestSleep_private *p = ptr; + event_remove_timed(p->dce_call->event_ctx, p->te); + return 0; +} + static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r) { - sleep(r->in.seconds); - return r->in.seconds; + struct timed_event te; + struct echo_TestSleep_private *p; + + if (!(dce_call->state_flags & DCESRV_CALL_STATE_FLAG_MAY_ASYNC)) { + /* we're not allowed to reply async */ + sleep(r->in.seconds); + return r->in.seconds; + } + + /* we're allowed to reply async */ + p = talloc(mem_ctx, struct echo_TestSleep_private); + if (!p) { + return 0; + } + + p->dce_call = dce_call; + p->r = r; + + te.handler = echo_TestSleep_handler; + te.private = p; + te.next_event = timeval_add(&dce_call->time, r->in.seconds, 0); + + p->te = event_add_timed(dce_call->event_ctx, &te); + if (!p->te) { + return 0; + } + + talloc_set_destructor(p, echo_TestSleep_destructor); + + dce_call->state_flags |= DCESRV_CALL_STATE_FLAG_ASYNC; + return 0; } /* include the generated boilerplate */ -- cgit From fd62df64188c0f992876c72fdda8a6da5dba3090 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Jan 2005 11:49:15 +0000 Subject: r4943: Smplified the events handling code a lot. The first source of complexity was that events didn't automatically cleanup themselves. This was because the events code was written before we had talloc destructors, so you needed to call event_remove_XX() to clean the event out of the event lists from every piece of code that used events. I have now added automatic event destructors, which in turn allowed me to simplify a lot of the calling code. The 2nd source of complexity was caused by the ref_count, which was needed to cope with event handlers destroying events while handling them, which meant the linked lists became invalid, so the ref_count ws used to mark events for later destruction. The new system is much simpler. I now have a ev->destruction_count, which is incremented in all event destructors. The event dispatch code checks for changes to this and handles it. (This used to be commit a3c7417cfeab429ffb22d5546b205818f531a7b4) --- source4/rpc_server/echo/rpc_echo.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 164e2d588f..2b4f31482d 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -135,13 +135,6 @@ static void echo_TestSleep_handler(struct event_context *ev, struct timed_event } } -static int echo_TestSleep_destructor(void *ptr) -{ - struct echo_TestSleep_private *p = ptr; - event_remove_timed(p->dce_call->event_ctx, p->te); - return 0; -} - static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r) { struct timed_event te; @@ -170,8 +163,7 @@ static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_c if (!p->te) { return 0; } - - talloc_set_destructor(p, echo_TestSleep_destructor); + talloc_steal(p, p->te); dce_call->state_flags |= DCESRV_CALL_STATE_FLAG_ASYNC; return 0; -- cgit From 6c14b0133dede38294a812be7f5f5bd5ec3d498b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Jan 2005 12:17:45 +0000 Subject: r4944: every event_add_*() caller was having to call talloc_steal() to take control of the event, so instead build that into the function. If you pass NULL as mem_ctx then it leaves it as a child of the events structure. (This used to be commit 7f981b9ed96f39027cbfd500f41e0c2be64cbb50) --- source4/rpc_server/echo/rpc_echo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 2b4f31482d..88fd7fb12d 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -159,11 +159,10 @@ static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_c te.private = p; te.next_event = timeval_add(&dce_call->time, r->in.seconds, 0); - p->te = event_add_timed(dce_call->event_ctx, &te); + p->te = event_add_timed(dce_call->event_ctx, &te, p); if (!p->te) { return 0; } - talloc_steal(p, p->te); dce_call->state_flags |= DCESRV_CALL_STATE_FLAG_ASYNC; return 0; -- cgit From 4ad08968f634b071f5ed84164700d4c5ffadea24 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Jan 2005 12:24:36 +0000 Subject: r4945: the te element isn't needed any more In general, now that events are children of the structure they are handling events for, the caller only needs to keep the event handle around if it plans on changing the event flags later (This used to be commit 8c8955155476827408c107af38089c8320631526) --- source4/rpc_server/echo/rpc_echo.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 88fd7fb12d..b793cd4da7 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -117,7 +117,6 @@ static NTSTATUS echo_TestEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *me struct echo_TestSleep_private { struct dcesrv_call_state *dce_call; struct echo_TestSleep *r; - struct timed_event *te; }; static void echo_TestSleep_handler(struct event_context *ev, struct timed_event *te, struct timeval t) @@ -159,10 +158,7 @@ static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_c te.private = p; te.next_event = timeval_add(&dce_call->time, r->in.seconds, 0); - p->te = event_add_timed(dce_call->event_ctx, &te, p); - if (!p->te) { - return 0; - } + event_add_timed(dce_call->event_ctx, &te, p); dce_call->state_flags |= DCESRV_CALL_STATE_FLAG_ASYNC; return 0; -- 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/rpc_server/echo/rpc_echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index b793cd4da7..009fa1aa6d 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -71,7 +71,7 @@ static NTSTATUS echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *me static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall2 *r) { - r->out.info = talloc_p(mem_ctx, union echo_Info); + r->out.info = talloc(mem_ctx, union echo_Info); if (!r->out.info) { return NT_STATUS_NO_MEMORY; } -- cgit From 66170ef8b36b499aa5b44ef10c1bd362a50f2636 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 3 Feb 2005 02:35:52 +0000 Subject: r5185: make all the events data structures private to events.c. This will make it possible to add optimisations to the events code such as keeping the next timed event in a sorted list, and using epoll for file descriptor events. I also removed the loop events code, as it wasn't being used anywhere, and changed timed events to always be one-shot (as adding a new timed event in the event handler is so easy to do if needed) (This used to be commit d7b4b6de51342a65bf46fce772d313f92f8d73d3) --- source4/rpc_server/echo/rpc_echo.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 009fa1aa6d..f78d1d231d 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -119,9 +119,11 @@ struct echo_TestSleep_private { struct echo_TestSleep *r; }; -static void echo_TestSleep_handler(struct event_context *ev, struct timed_event *te, struct timeval t) +static void echo_TestSleep_handler(struct event_context *ev, struct timed_event *te, + struct timeval t, void *private) { - struct echo_TestSleep_private *p = te->private; + struct echo_TestSleep_private *p = talloc_get_type(private, + struct echo_TestSleep_private); struct echo_TestSleep *r = p->r; NTSTATUS status; @@ -136,7 +138,6 @@ static void echo_TestSleep_handler(struct event_context *ev, struct timed_event static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r) { - struct timed_event te; struct echo_TestSleep_private *p; if (!(dce_call->state_flags & DCESRV_CALL_STATE_FLAG_MAY_ASYNC)) { @@ -154,11 +155,9 @@ static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_c p->dce_call = dce_call; p->r = r; - te.handler = echo_TestSleep_handler; - te.private = p; - te.next_event = timeval_add(&dce_call->time, r->in.seconds, 0); - - event_add_timed(dce_call->event_ctx, &te, p); + event_add_timed(dce_call->event_ctx, p, + timeval_add(&dce_call->time, r->in.seconds, 0), + echo_TestSleep_handler, p); dce_call->state_flags |= DCESRV_CALL_STATE_FLAG_ASYNC; return 0; -- cgit From 131dc76d56df40b3511c47e54f15412a25b491f8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 3 Feb 2005 11:56:03 +0000 Subject: r5197: moved events code to lib/events/ (suggestion from metze) (This used to be commit 7f54c8a339f36aa43c9340be70ab7f0067593ef2) --- source4/rpc_server/echo/rpc_echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index f78d1d231d..173e6fbf82 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -24,7 +24,7 @@ #include "includes.h" #include "rpc_server/dcerpc_server.h" #include "librpc/gen_ndr/ndr_echo.h" -#include "events.h" +#include "lib/events/events.h" static NTSTATUS echo_AddOne(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_AddOne *r) -- cgit From e82aad1ce39a6b7a2e51b9e2cb494d74ec70e158 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 10 Feb 2005 05:09:35 +0000 Subject: r5298: - got rid of pstring.h from includes.h. This at least makes it a bit less likely that anyone will use pstring for new code - got rid of winbind_client.h from includes.h. This one triggered a huge change, as winbind_client.h was including system/filesys.h and defining the old uint32 and uint16 types, as well as its own pstring and fstring. (This used to be commit 9db6c79e902ec538108d6b7d3324039aabe1704f) --- source4/rpc_server/echo/rpc_echo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 173e6fbf82..28c9958c92 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -22,6 +22,7 @@ */ #include "includes.h" +#include "system/filesys.h" #include "rpc_server/dcerpc_server.h" #include "librpc/gen_ndr/ndr_echo.h" #include "lib/events/events.h" -- cgit From ea5ddbcb4d531971ac9f252ed423d0ccecf56769 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 18 Feb 2005 23:30:26 +0000 Subject: r5452: Add implementation + torture test for echo_Surrounding (This used to be commit 1b71000cc15a06bd4868fbf4ce5415f5866d29a5) --- source4/rpc_server/echo/rpc_echo.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 28c9958c92..a2d2e552d6 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -137,6 +137,20 @@ static void echo_TestSleep_handler(struct event_context *ev, struct timed_event } } +static NTSTATUS echo_TestSurrounding(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSurrounding *r) +{ + if (!r->in.data) { + r->out.data = NULL; + return NT_STATUS_OK; + } + + r->out.data = talloc(mem_ctx, struct echo_Surrounding); + r->out.data->x = 2 * r->in.data->x; + r->out.data->surrounding = talloc_zero_array(mem_ctx, uint16_t, r->out.data->x); + + return NT_STATUS_OK; +} + static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r) { struct echo_TestSleep_private *p; -- cgit From 64112074e9772aead31092c8713e077d1aff050b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 20 Feb 2005 02:57:38 +0000 Subject: r5465: Add support to multiple levels of pointers in pidl. Also add a new function to echo.idl that tests this behaviour. (This used to be commit e5eb5e847e75f2b7b041a66f84d9b919ddf27739) --- source4/rpc_server/echo/rpc_echo.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index a2d2e552d6..daf16e12d7 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -151,6 +151,15 @@ static NTSTATUS echo_TestSurrounding(struct dcesrv_call_state *dce_call, TALLOC_ return NT_STATUS_OK; } +static uint16_t echo_TestDoublePointer(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestDoublePointer *r) +{ + if (!*r->in.data) + return 0; + if (!**r->in.data) + return 0; + return ***r->in.data; +} + static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r) { struct echo_TestSleep_private *p; -- cgit From 03c2d642a620380d96a9e745ceb1cd19ffea2160 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 1 Jun 2005 00:00:50 +0000 Subject: r7159: Improve the messages from pidl's validator module. Change the IDL file for the echo interface to match the one we use for Windows. The only thing different between the two files currently is the names of the scalar types and the handling of strings. (This used to be commit b264c61061d222347919837600adf809fbadfb13) --- source4/rpc_server/echo/rpc_echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index daf16e12d7..057d89a866 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -30,7 +30,7 @@ static NTSTATUS echo_AddOne(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_AddOne *r) { - *r->out.v = *r->in.v + 1; + *r->out.out_data = r->in.in_data + 1; return NT_STATUS_OK; } -- cgit From c56ddaf7efdd5744c3f1adb7e40b1db5cbe01523 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 2 Jun 2005 13:21:11 +0000 Subject: r7195: - Fix echo pipe - Don't allocate strings - Give higher preference to the [out] part of variables when they are being used by another [out] variable. Also make sure that [in] variables never use [out] variables (i.e. switch_is() on an [in] variable can no longer use an [out] variable). (This used to be commit 837c83d77a2d1990419c4f3e343616daf8da5799) --- source4/rpc_server/echo/rpc_echo.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 057d89a866..b67c172579 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -56,6 +56,9 @@ static NTSTATUS echo_SinkData(struct dcesrv_call_state *dce_call, TALLOC_CTX *me static NTSTATUS echo_SourceData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_SourceData *r) { int i; + + r->out.data = talloc_array(mem_ctx, uint8_t, r->in.len); + for (i=0;iin.len;i++) { r->out.data[i] = i; } -- cgit From 804b8d2792246abf24096dea99160b454353670b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 16 Jun 2005 11:52:15 +0000 Subject: r7634: move TestSleep functions so that all of them are together metze (This used to be commit 520d5c67329e957121e3b71c1ffc0be3893c2033) --- source4/rpc_server/echo/rpc_echo.c | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index b67c172579..5e50a69641 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -118,28 +118,6 @@ static NTSTATUS echo_TestEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *me return NT_STATUS_OK; } -struct echo_TestSleep_private { - struct dcesrv_call_state *dce_call; - struct echo_TestSleep *r; -}; - -static void echo_TestSleep_handler(struct event_context *ev, struct timed_event *te, - struct timeval t, void *private) -{ - struct echo_TestSleep_private *p = talloc_get_type(private, - struct echo_TestSleep_private); - struct echo_TestSleep *r = p->r; - NTSTATUS status; - - r->out.result = r->in.seconds; - - status = dcesrv_reply(p->dce_call); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0,("echo_TestSleep_handler: dcesrv_reply() failed - %s\n", - nt_errstr(status))); - } -} - static NTSTATUS echo_TestSurrounding(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSurrounding *r) { if (!r->in.data) { @@ -163,6 +141,28 @@ static uint16_t echo_TestDoublePointer(struct dcesrv_call_state *dce_call, TALLO return ***r->in.data; } +struct echo_TestSleep_private { + struct dcesrv_call_state *dce_call; + struct echo_TestSleep *r; +}; + +static void echo_TestSleep_handler(struct event_context *ev, struct timed_event *te, + struct timeval t, void *private) +{ + struct echo_TestSleep_private *p = talloc_get_type(private, + struct echo_TestSleep_private); + struct echo_TestSleep *r = p->r; + NTSTATUS status; + + r->out.result = r->in.seconds; + + status = dcesrv_reply(p->dce_call); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0,("echo_TestSleep_handler: dcesrv_reply() failed - %s\n", + nt_errstr(status))); + } +} + static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r) { struct echo_TestSleep_private *p; -- cgit From 152a6a00c31f52d14a63bfc977ac54713c56c9cd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 24 Jun 2005 01:18:56 +0000 Subject: r7865: changed pidl to take a "const void *" instead of a "void *" for the structure in ndr_push_*() and ndr_print_*(). The push and print functions really should not modify the structure. metze, to make this work I had to change your spoolss hand marshaller. Can you please check it is OK? I think that the IN and OUT sides of that function are not ever called on the same structure, so I think that attempt at remembering the value by assigning to r->in._offered was not doing anything anyway, but please correct me if I have misunderstood it. If you really do need to remember something on those structures I'd suggest the ndr_token_store() and ndr_token_retrieve() functions, which are used by pidl for just this sort of thing. (This used to be commit eee528be97fa43ca53bdc5652b4d29a0a2caf563) --- source4/rpc_server/echo/rpc_echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 5e50a69641..d7d7ef31c2 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -68,7 +68,7 @@ static NTSTATUS echo_SourceData(struct dcesrv_call_state *dce_call, TALLOC_CTX * static NTSTATUS echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) { - r->out.s2 = "this is a test string"; + r->out.s2 = talloc_strdup(mem_ctx, "this is a test string"); return NT_STATUS_OK; } -- cgit From d9b4bdd5bb32806162514f7e010a97d24fb94549 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 15 Sep 2006 20:07:55 +0000 Subject: r18565: Fix echo.idl to be Samba3-, MIDL and midlc compatible (This used to be commit ab0a798c57564901f0adcd8aedc1ef0928e79edd) --- source4/rpc_server/echo/rpc_echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index d7d7ef31c2..3de24fb366 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -68,7 +68,7 @@ static NTSTATUS echo_SourceData(struct dcesrv_call_state *dce_call, TALLOC_CTX * static NTSTATUS echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) { - r->out.s2 = talloc_strdup(mem_ctx, "this is a test string"); + *r->out.s2 = talloc_strdup(mem_ctx, "this is a test string"); return NT_STATUS_OK; } -- cgit From 8773e743c518578584d07d35ffdafdd598af88b0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 16 Oct 2006 13:06:41 +0000 Subject: r19339: Merge my 4.0-unittest branch. This adds an API for more fine-grained output in the testsuite rather than just True or False for a set of tests. The aim is to use this for: * known failure lists (run all tests and detect tests that started working or started failing). This would allow us to get rid of the RPC-SAMBA3-* tests * nicer torture output * simplification of the testsuite system * compatibility with other unit testing systems * easier usage of smbtorture (being able to run one test and automatically set up the environment for that) This is still a work-in-progress; expect more updates over the next couple of days. (This used to be commit 0eb6097305776325c75081356309115f445a7218) --- source4/rpc_server/echo/rpc_echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 3de24fb366..460c866c49 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -68,7 +68,7 @@ static NTSTATUS echo_SourceData(struct dcesrv_call_state *dce_call, TALLOC_CTX * static NTSTATUS echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) { - *r->out.s2 = talloc_strdup(mem_ctx, "this is a test string"); + *r->out.s2 = talloc_strdup(mem_ctx, r->in.s1); return NT_STATUS_OK; } -- cgit From 64e88a8ccf2faa34ee9d182f4e89fa6e44c609a6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 17 Jan 2007 14:49:36 +0000 Subject: r20850: Prefix all server calls with dcesrv_ (This used to be commit 76c78b0339cd88c61a13745f7f4e037f400db21b) --- source4/rpc_server/echo/rpc_echo.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 460c866c49..7be464935b 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -28,13 +28,13 @@ #include "lib/events/events.h" -static NTSTATUS echo_AddOne(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_AddOne *r) +static NTSTATUS dcesrv_echo_AddOne(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_AddOne *r) { *r->out.out_data = r->in.in_data + 1; return NT_STATUS_OK; } -static NTSTATUS echo_EchoData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_EchoData *r) +static NTSTATUS dcesrv_echo_EchoData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_EchoData *r) { if (!r->in.len) { return NT_STATUS_OK; @@ -48,12 +48,12 @@ static NTSTATUS echo_EchoData(struct dcesrv_call_state *dce_call, TALLOC_CTX *me return NT_STATUS_OK; } -static NTSTATUS echo_SinkData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_SinkData *r) +static NTSTATUS dcesrv_echo_SinkData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_SinkData *r) { return NT_STATUS_OK; } -static NTSTATUS echo_SourceData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_SourceData *r) +static NTSTATUS dcesrv_echo_SourceData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_SourceData *r) { int i; @@ -66,14 +66,14 @@ static NTSTATUS echo_SourceData(struct dcesrv_call_state *dce_call, TALLOC_CTX * return NT_STATUS_OK; } -static NTSTATUS echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) +static NTSTATUS dcesrv_echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) { *r->out.s2 = talloc_strdup(mem_ctx, r->in.s1); return NT_STATUS_OK; } -static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall2 *r) +static NTSTATUS dcesrv_echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall2 *r) { r->out.info = talloc(mem_ctx, union echo_Info); if (!r->out.info) { @@ -112,13 +112,13 @@ static NTSTATUS echo_TestCall2(struct dcesrv_call_state *dce_call, TALLOC_CTX *m return NT_STATUS_OK; } -static NTSTATUS echo_TestEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestEnum *r) +static NTSTATUS dcesrv_echo_TestEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestEnum *r) { r->out.foo2->e1 = ECHO_ENUM2; return NT_STATUS_OK; } -static NTSTATUS echo_TestSurrounding(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSurrounding *r) +static NTSTATUS dcesrv_echo_TestSurrounding(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSurrounding *r) { if (!r->in.data) { r->out.data = NULL; @@ -132,7 +132,7 @@ static NTSTATUS echo_TestSurrounding(struct dcesrv_call_state *dce_call, TALLOC_ return NT_STATUS_OK; } -static uint16_t echo_TestDoublePointer(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestDoublePointer *r) +static uint16_t dcesrv_echo_TestDoublePointer(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestDoublePointer *r) { if (!*r->in.data) return 0; @@ -163,7 +163,7 @@ static void echo_TestSleep_handler(struct event_context *ev, struct timed_event } } -static long echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r) +static long dcesrv_echo_TestSleep(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestSleep *r) { struct echo_TestSleep_private *p; -- cgit From c069ead0bb543b397542a94fbf4ca836653e2159 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 5 Mar 2007 10:28:24 +0000 Subject: r21698: Check for talloc failures. Andrew Bartlett (This used to be commit c9eb5bf19a702af32a4e4f109a27e4076303efdc) --- source4/rpc_server/echo/rpc_echo.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 7be464935b..8f562b4826 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -58,6 +58,9 @@ static NTSTATUS dcesrv_echo_SourceData(struct dcesrv_call_state *dce_call, TALLO int i; r->out.data = talloc_array(mem_ctx, uint8_t, r->in.len); + if (!r->out.data) { + return NT_STATUS_NO_MEMORY; + } for (i=0;iin.len;i++) { r->out.data[i] = i; @@ -126,6 +129,9 @@ static NTSTATUS dcesrv_echo_TestSurrounding(struct dcesrv_call_state *dce_call, } r->out.data = talloc(mem_ctx, struct echo_Surrounding); + if (!r->out.data) { + return NT_STATUS_NO_MEMORY; + } r->out.data->x = 2 * r->in.data->x; r->out.data->surrounding = talloc_zero_array(mem_ctx, uint16_t, r->out.data->x); -- cgit From 85a11bc1bbf41d17d38343e9c2707604287b6f58 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 7 Mar 2007 11:15:44 +0000 Subject: r21744: Test more talloc failure cases. Andrew Bartlett (This used to be commit ddf7354986a800455b6f55c2fdbeb8bb39381716) --- source4/rpc_server/echo/rpc_echo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 8f562b4826..1e80e91641 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -72,7 +72,9 @@ static NTSTATUS dcesrv_echo_SourceData(struct dcesrv_call_state *dce_call, TALLO static NTSTATUS dcesrv_echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) { *r->out.s2 = talloc_strdup(mem_ctx, r->in.s1); - + if (r->in.s1 && !*r->out.s2) { + return NT_STATUS_NO_MEMORY; + } return NT_STATUS_OK; } @@ -134,6 +136,9 @@ static NTSTATUS dcesrv_echo_TestSurrounding(struct dcesrv_call_state *dce_call, } r->out.data->x = 2 * r->in.data->x; r->out.data->surrounding = talloc_zero_array(mem_ctx, uint16_t, r->out.data->x); + if (!r->out.data->surrounding) { + return NT_STATUS_NO_MEMORY; + } return NT_STATUS_OK; } -- 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/rpc_server/echo/rpc_echo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/rpc_server/echo/rpc_echo.c') diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 1e80e91641..f188ef0a0d 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -8,7 +8,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, @@ -17,8 +17,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