summaryrefslogtreecommitdiff
path: root/librpc/wscript_build
Commit message (Collapse)AuthorAgeFilesLines
* CVE-2020-10745: ndr/dns-utils: prepare for NBT compatibilityDouglas Bagnall2020-07-021-2/+1
| | | | | | | | | | | | | | | | | NBT has a funny thing where it sometimes needs to send a trailing dot as part of the last component, because the string representation is a user name. In DNS, "example.com", and "example.com." are the same, both having three components ("example", "com", ""); in NBT, we want to treat them differently, with the second form having the three components ("example", "com.", ""). This retains the logic of e6e2ec0001fe3c010445e26cc0efddbc1f73416b. Also DNS compression cannot be turned off for NBT. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14378 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* CVE-2020-10745: ndr_dns: move ndr_push_dns_string core into sharable functionDouglas Bagnall2020-07-021-1/+1
| | | | | | | | | | | This is because ndr_nbt.c does almost exactly the same thing with almost exactly the same code, and they both do it wrong. Soon they will both be using the better version that this will become. Though in this patch we just move the code, not fix it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14378 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* CVE-2020-10745: librpc/tests: cmocka tests of dns and ndr stringsDouglas Bagnall2020-07-021-0/+10
| | | | | | | | | | | These time the push and pull function in isolation. Timing should be under 0.0001 seconds on even quite old hardware; we assert it must be under 0.2 seconds. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14378 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: core: Move the s4 handles implementation to the RPC server coreSamuel Cabrero2020-05-241-0/+1
| | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpc_server: Do not generate and build s3 RPC server codeSamuel Cabrero2020-03-201-5/+0
| | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc ndr: add recursion check macrosGary Lockyer2020-02-271-0/+9
| | | | | | | | | | | | Add macros to check the recursion depth. Credit to OSS-Fuzz REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19280 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14254 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc ndr: Heap-buffer-overflow in lzxpress_decompressGary Lockyer2020-02-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reproducer for oss-fuzz Issue 20083 Project: samba Fuzzing Engine: libFuzzer Fuzz Target: fuzz_ndr_drsuapi_TYPE_OUT Job Type: libfuzzer_asan_samba Platform Id: linux Crash Type: Heap-buffer-overflow READ 1 Crash Address: 0x6040000002fd Crash State: lzxpress_decompress ndr_pull_compression_xpress_chunk ndr_pull_compression_start Sanitizer: address (ASAN) Recommended Security Severity: Medium Credit to OSS-Fuzz REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20083 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc: Move winstation.idl to the top level and exclude from fuzzingAndrew Bartlett2019-12-181-0/+5
| | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Dec 18 08:05:05 UTC 2019 on sn-devel-184
* librpc: Fill in full deps for NDR_* subsystemsAndrew Bartlett2019-12-101-9/+27
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* dcerpc: developer option to save ndr_fuzz_X seedsDouglas Bagnall2019-12-101-1/+1
| | | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc ndr: Tests for ndr_pull_stringGary Lockyer2019-12-041-0/+11
| | | | | | | | | | Tests to ensure that ndr_pull_string handles zero and one byte length data correctly for both character strings and UTF-16 strings. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13874 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ndr: Include the caller location in ndr_{pull,push}_error() messagesAndrew Bartlett2019-11-191-2/+2
| | | | | | | | | | | | | This should aid in debugging NDR parse failures. Use the ABI bump to again exclude ndr_table_misc incorrectly added in ABI 0.2.1. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Nov 19 14:47:46 UTC 2019 on sn-devel-184
* pidl: Generate the trailing ndr_table even if the UUID is not setAndrew Bartlett2019-11-131-1/+1
| | | | | | | | | | | This allows ndrdump to dump many more public structures because most of these are not in files with a UUID as they are not RPC protocols. 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>
* s4:rpc_server: Move core functions to core librarySamuel Cabrero2019-10-181-0/+3
| | | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc: Add new dcerpc server core librarySamuel Cabrero2019-10-181-0/+10
| | | | | | | | Next commits will move the core of s4 rpc server to this library. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc: Remove client and server build of w32time.idlAndrew Bartlett2019-10-101-5/+0
| | | | | | | | We do not have a server for the Win32 Time Server so do not generate the code for it. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* librpc: Remove client and server build of rot.idlAndrew Bartlett2019-10-101-5/+0
| | | | | | | | We do not have a client or server for this DCOM component so do not generate the code for it. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* librpc: add RPC_NDR_MDSSVCRalph Boehme2019-08-081-0/+5
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc: No longer generate or build unused client bindings for frsrpcAndrew Bartlett2019-06-261-5/+0
| | | | | | | We retain the IDL and NDR parsers for ndrdump. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Remove frsblobs.idlAndrew Bartlett2019-06-261-5/+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_MDSSVCAndrew 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_KEYSVCAndrew 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_TRKWKSAndrew 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_SCERPCAndrew 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_WZCSVCAndrew 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_MSGSVCAndrew 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_SERVER_IDAndrew 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_NBTAndrew 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_DSBACKUPAndrew 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_POLICYAGENTAndrew 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_EFSAndrew 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_AUDIOSRVAndrew 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_SMB_ACLAndrew 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_IDMAPAndrew 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-5/+0
| | | | | 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-5/+0
| | | | | 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-5/+0
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: Do not generate client code for dbgidl.idlAndrew Bartlett2019-06-261-5/+0
| | | | | | | | We only want to record the GUID and function table names, we do not need to generate uncalled stubs. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc:ndr: Implement ndr_zero_memory()Andreas Schneider2019-02-141-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* preg: Use gensize to allow modification of winreg data to be repackedGarming Sam2018-08-161-1/+1
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* preg: Using winreg_Data_GPO instead of DATA_BLOBGarming Sam2018-08-161-1/+1
| | | | | | | We need to make a duplicate in order to have reasonable python bindings. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc/idl Add some query [getset]info quota related structuresNoel Power2018-07-311-0/+5
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* shift read_hex_bytes() and parse_guid_string() into lib/utilDouglas Bagnall2018-02-221-1/+1
| | | | | | | | | | | | | | read_hex_bytes() is going to be used in lib/util/rfc1738.c. parse_guid_string() is shifted for two reasons: Firstly, it is called very often in some operations, sometimes constituting a few percent of the CPU load, and it makes several calls to read_hex_bytes(). We want the compiler to be able to inline those calls if it thinks that is wise. Secondly, there are other places that could do with fast GUID parsing. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python: Add bindings for NTLMSSPAndrew Bartlett2017-03-291-0/+5
| | | | | | This is helpful for building NTLMv2 packets in python for testing against the SamLogon server Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* ndr: Use resizing array instead of linked lists (breaking ABI)Douglas Bagnall2017-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ndr token code keeps a temporary store of tokens which are referred to a small number of times (often once) before being discarded. The access patterns are somewhat stack-like, with recently placed tokens being accessed most often. The old code kept these tokens in a linked list, which we replace with a self-resizing array. This keeps everything roughly the same in big-O terms, but makes it all faster in practice by vastly reducing the amount of tallocing and pointer-chasing. The peak memory use is strictly reduced. On a 64 bit machine each core token struct fits in 16 bytes (after padding) while the two pointers used by the DLIST add another 16 bytes, so the overall list allocation is the same as the peak 2n array allocation -- except in the list case it is dwarfed by the talloc and malloc metadata overhead. Before settling on the resized arrays, we tried red-black trees, which are bound to be better for large ndr structures. As it happens, we don't deal with large structures (the size of replication clumps is limited to 400 objects) and the asymptotic benefits of the trees are not realised in practice. With luck you should find graphs comparing the performance of these various techniques at: https://www.samba.org/~dbagnall/perf-tests/ndr-token/ This necessarily breaks the ABI because the linked list implementation was publicly exposed. 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): Thu Mar 2 08:38:22 CET 2017 on sn-devel-144
* librpc/ndr: add ndr_push_charset_to_null and increase library version (abi ↵Günther Deschner2017-01-241-1/+1
| | | | | | | | | | | | | | change) We were crashing earlier when calculating the length of NULL strings in fixed size arrays (noticed while replying with an empty spoolss_CorePrinterDriver struct within the spoolss_GetCorePrinterDrivers call). Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* librpc: Introduce cab.idlGünther Deschner2016-11-241-0/+7
| | | | | | | | | | This allows processing of Windows Cabinet files (required for the MS-PAR print protocol implementation) Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc: add dcerpc_ncacn_pull_pkt_auth() helper functionStefan Metzmacher2016-10-261-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idl: compile iremotewinspool.idl.Günther Deschner2016-09-221-0/+10
| | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* librpc: Add ndr_push_struct_into_fixed_blob() and use it in GUID_to_ndr_blob()Andrew Bartlett2016-07-281-1/+1
| | | | | | | | This allows us to allocate only the correct size, not a default of 1024 bytes per push. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>