summaryrefslogtreecommitdiff
path: root/source4/librpc
Commit message (Collapse)AuthorAgeFilesLines
* selftest: Add test for ndr_size_struct() faulting on a NULL pointerAndrew Bartlett2019-12-121-0/+43
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13876 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* selftest: Add example xattr_NTACL packets to demonstrate switch/union behaviourAndrew Bartlett2019-12-122-0/+119
| | | | | | | | | This is a good example with both buffers and scalars in the union. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13876 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* librpc: Fill in full deps for NDR_* subsystemsAndrew Bartlett2019-12-101-1/+1
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* selftest: Add ndrdump tests for malformed drsuapi trafficAndrew Bartlett2019-12-104-0/+541
| | | | | | | | | Thanks to Douglas Bagnall for the samples, produced from seeds generated by Samba's make test traffic, fuzzed by ndr_fuzz_X and Hongfuzz. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* selftest: Test repushing an ntlmssp AUTHENTICATE_MESSAGEAndrew Bartlett2019-11-202-0/+135
| | | | | | | | | | | This demonstrates a bug found by Douglas Bagnall using Hongfuzz and the new fuzz_ndr_X fuzzer where the value() evaluatuion could segfault if it was made to follow a NULL pointer. This also demonstrates that the --base64 mode works on file inputs. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Unify packet dumping on ndr_pull() failureAndrew Bartlett2019-11-201-4/+0
| | | | | | | | | | | | | | | | There were two duplicate implementations of packet dumping just for the s4 RPC server! This unifies them and makes them easier to find because they are not triggered from the generated server stub any more. The behaviour have unified on setting "dcesrv:stubs directory" and being compiled with --enable-developer. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Samuel Cabrero <scabrero@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Nov 20 02:14:56 UTC 2019 on sn-devel-184
* ndrdump: Use human-readable strings for NDR decode errorsAndrew Bartlett2019-11-171-1/+1
| | | | | | | | These make much more sense than the NTSTATUS values they can be forced to map to. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* selftest: Test fix for ndrdump of structures by numberAndrew Bartlett2019-11-171-0/+1
| | | | | | | | | This requires that misc.GUID not move in the IDL, so a comment is added. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14191 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4/rpc/dcerpc_connect: no crash on NULL dest_hostDouglas Bagnall2019-11-141-1/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
* s4:librpc: Check return code of netlogon_creds_client_authenticator()Andreas Schneider2019-11-141-1/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* build: Prepare for pidl to generate ndr_table entries for more IDLAndrew Bartlett2019-11-131-0/+12
| | | | | | | | | | | These IDL files will soon create ndr_table entries so need to be linked into the ndr-table subsystem. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14191 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Pair-progammed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* selftest: Add expected-output tests for the ndrdump struct modeAndrew Bartlett2019-11-132-0/+35
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14191 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Match interface name and file name for winsrepl.idlAndrew Bartlett2019-11-131-1/+1
| | | | | | | This helps generate fuzzers for this IDL. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Move dcerpc_log_packet from s4 librpc to common librpcSamuel Cabrero2019-10-181-39/+0
| | | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc: Move dcerpc_ncacn_push_auth from s4 librpc to common librpcSamuel Cabrero2019-10-181-56/+0
| | | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:librpc: Rename ncacn_push_auth to dcerpc_ncacn_push_authSamuel Cabrero2019-10-182-9/+16
| | | | | | | | Next commit will move this function to common librpc Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:rpc_server: Split dcerpc_generic_session_key for server and clientSamuel Cabrero2019-10-183-9/+4
| | | | | | | | | Split the common bits of dcerpc_generic_session_key to librpc and rename client the specific part to dcecli_generic_session_key. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc: add Python mdssvc bindingsRalph Boehme2019-10-091-0/+7
| | | | | | | Not used for now, but soon. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* librpc: Fix CID 1452292 Null pointer dereferences (REVERSE_INULL)Volker Lendecke2019-08-141-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4:librpc/rpc: Use generic roh_connect_channel_send/recvSamuel Cabrero2019-08-073-219/+18
| | | | | | | | | | The HTTP connection code is common to in and out channels. Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Aug 7 14:12:40 UTC 2019 on sn-devel-184
* s4:librpc/rpc: Add roh_connect_channel_send/recvSamuel Cabrero2019-08-071-0/+100
| | | | | | | | Generic function to connect a ROH channel. The use comes later to avoid duplicated code. Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4:lib/http: move to the toplevelRalph Boehme2019-08-074-4/+4
| | | | | | | This is going to be used from the s3 RPC server soon... Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Samuel Cabrero <scabrero@suse.de>
* s4:lib/http: use http_conn in http_send_request_send() and ↵Ralph Boehme2019-08-072-18/+3
| | | | | | | | | | | | | | | | http_read_response_send() Works, tested with $ bin/smbtorture -W RIVERSIDE --realm=RIVERSIDE.SITE -s /dev/null \ -U Administrator%Passw0rd \ ncacn_http:10.10.11.164[HttpProxy=10.10.11.164:593,HttpUseTls=false,HttpAuthOption=basic,HttpConnectOption=UseHttpProxy] \ rpc.epmapper.epmapper.Lookup_simple I get an ACCESS_DENIED error, but I get it over HTTP. :) Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Samuel Cabrero <scabrero@suse.de>
* s4:librpc/rpc: use http_connect_send/recv in ncacn_httpRalph Boehme2019-08-074-214/+104
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Samuel Cabrero <scabrero@suse.de>
* dcerpc: use anon creds for unknown transportDouglas Bagnall2019-07-221-0/+5
| | | | | | | | | | | | Otherwise we get a segfault when the NULL creds are dereferenced in cli_credentials_is_anonymous() $ python3 -c"from samba.dcerpc.dnsserver import dnsserver; d = dnsserver('addc')" Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Jul 22 23:37:57 UTC 2019 on sn-devel-184
* s4/rpc/py_security: don't deref NULL for invalid valuesDouglas Bagnall2019-07-221-2/+10
| | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc: Do not generate extra unused client or python bindings with PIDLAndrew Bartlett2019-06-261-2/+7
| | | | | | | | This sorts out the idl list into the parts that actually need --python and --client specified and so speeds up the compile and clarifies the code behaviour. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Remove frsblobs.idlAndrew Bartlett2019-06-261-1/+0
| | | | | | | | We can now dump public structures using ndrdump, so helper dump functions are not required any more. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Remove unused RPC_NDR_SERVER_IDAndrew Bartlett2019-06-261-1/+1
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Remove unused RPC_NDR_NBTAndrew Bartlett2019-06-261-1/+1
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Remove unused RPC_NDR_WINSIFAndrew Bartlett2019-06-261-5/+0
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Remove unused RPC_NDR_XATTRAndrew Bartlett2019-06-261-2/+2
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Remove unused RPC_NDR_DRSBLOBSAndrew Bartlett2019-06-261-1/+1
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Remove unused RPC_NDR_NTLMSSPAndrew Bartlett2019-06-261-1/+1
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* py3: Remove duplicated PyUnicode_Check() after the py3 compat macros were ↵Andrew Bartlett2019-06-241-2/+2
| | | | | | | | | | | | removed This came about because in py2 we had to check for strings and unicode. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Mon Jun 24 18:48:53 UTC 2019 on sn-devel-184
* py3: Remove PyStr_AsUTF8AndSize() compatability macroAndrew Bartlett2019-06-241-1/+1
| | | | | | | | We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* py3: Remove PyStr_AsString() compatability macroAndrew Bartlett2019-06-241-1/+1
| | | | | | | | We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* py3: Remove PyStr_FromFormat() compatability macroAndrew Bartlett2019-06-243-5/+5
| | | | | | | | We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* py3: Remove PyStr_FromString() compatability macroAndrew Bartlett2019-06-245-9/+9
| | | | | | | | We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* py3: Remove PyStr_Check() compatability macroAndrew Bartlett2019-06-241-2/+2
| | | | | | | | We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* winsrepl.idl: remove unused decode functionsGary Lockyer2019-06-061-5/+0
| | | | | | | | Remove the decode_* functions as they are no longer needed, and this will reduce the amount of untested automatically generated code. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* sasl_helpers.idl: remove unused decode functionsGary Lockyer2019-06-061-4/+0
| | | | | | | | Remove the decode_* functions as they are no longer needed, and this will reduce the amount of untested automatically generated code. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ntp_signd.idl: remove unused decode functionsGary Lockyer2019-06-061-6/+0
| | | | | | | | Remove the decode_* functions as they are no longer needed, and this will reduce the amount of untested automatically generated code. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4 lib rpc pyrpc: Fix error messageGary Lockyer2019-05-301-1/+2
| | | | | | | | | Fix the error message returned when unable to initialise an event context. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4 librpc rpc pyrpc: Fix flapping dcerpc.bare testsGary Lockyer2019-05-221-5/+2
| | | | | | | | | | | | | Commit d65b7641c84976c543ded8f0de5ab2da3c19b407 had the parameters to talloc_reparent reversed. This caused the dcerpc.bare tests to flap. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13932 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Wed May 22 03:03:43 UTC 2019 on sn-devel-184
* s4/librpc: squash 'cast between incompatible function types' warningNoel Power2019-05-163-7/+18
| | | | | | | | | | Where possible make PyCFunction definition signature match. Sometimes this is not possible (e.g. when the c-function is associated with a python method definition with 'METH_VARARGS|METH_KEYWORDS' in this case we use the PY_DISCARD_FUNC_SIG macro. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4 librpc rpc pyrpc: Ensure tevent_context deleted lastGary Lockyer2019-05-103-28/+39
| | | | | | | | | | | | | | Ensure that the tevent_context is deleted after the connection, to prevent a use after free. Note: Py_DECREF calls dcerpc_interface_dealloc so the TALLOC_FREE(ret->mem_ctx) calls in the error paths of py_dcerpc_interface_init_helper needed removal. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13932 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pyrpc: remove crutch for python <= 2.5Douglas Bagnall2019-05-091-4/+0
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* pyrpc: ndr PY_CHECK_TYPE checks for NULL as well as typeDouglas Bagnall2019-05-091-4/+13
| | | | | | | Addresses CID 1361477 and others. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s4/rpc/dcerpc_roh_channel_out: check ndr_init (CID 1273062)Douglas Bagnall2019-05-091-0/+3
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>