summaryrefslogtreecommitdiff
path: root/librpc
Commit message (Collapse)AuthorAgeFilesLines
* pidl: Allow ndrdump to print public structuresGary Lockyer2019-06-061-0/+10
| | | | | | | | Generate code to allow ndrdump to operate on public structures. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* librpc/ndr: make push_charset_to_null UTF-16 safe (CID 1399648)Douglas Bagnall2019-05-091-1/+1
| | | | | | | | | The length is in test units, not bytes, and includes terminating nulls. For 16-bit character sets, the terminating null must be two bytes. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* ndrdump: change behaviour of flags to operate as flagsAndrew Bartlett2019-04-121-4/+4
| | | | | | | | | These are called flags because that is what they become to the ndr_pull function, but to avoid total confusion treat them as flags generally even if the values are always exclusive (at the moment). Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* ndrdump: Remove local variables for pipesMichael Hanselmann2019-04-121-8/+4
| | | | | | | | There's no need for the local variables as the NDR call structure pointer is kept around anyway. Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* drsuapi.idl: add DRSUAPI_ATTID_schemaInfoStefan Metzmacher2019-04-111-0/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13799 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* idl: Remove a trailing empty lineVolker Lendecke2019-03-181-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* idl: Fix a typoVolker Lendecke2019-03-181-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ndr_spoolss_buf: fix out of scope use of stack variable in ↵Stefan Metzmacher2019-03-061-2/+2
| | | | | | | | | | | | | | NDR_SPOOLSS_PUSH_ENUM_OUT() BUG: https://bugzilla.samba.org/show_bug.cgi?id=13818 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* librpc idl: netlogon netr_identity_info logon_id to 64 bitGary Lockyer2019-02-201-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fold the two 32 bit values logon_id_high and logon_id_low into a single 64 bit logon_id in netr_identity_info. This will be used to tie together winbind and SamLogon requests in audit logging. Summary of the of the Query and Response from Microsoft on it's usage. [REG:119013019612095] [MS-NRPC]: NETLOGON_LOGON_IDENTITY_INFO: Does the Reserved field have LogonId meaning? Questions: In NetrLogonSamLogonEx does the Reserved field (of NETLOGON_LOGON_IDENTITY_INFO) have LogonId meaning? What is a valid LogonID, and does have any audit usage? Samba is sending a constant "deadbeef" in hex and would like to understand any usage of this field. Response: The NRPC spec is accurate in defining the field as Reserved, and without protocol significance. In the header file in our source code, it is defined as LogonId and commented as such, but it’s effectively not used. This is probably why the API structure has that field name. It may have been intended as such but it’s not used. Samba will send a random value in this field. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib:util: Move discard_const(_p) to own header for libndr.hAndreas 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: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* librpc:ndr: Add NDR_ZERO_STRUCT(P) macrosAndreas Schneider2019-02-141-0/+7
| | | | | | | 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>
* librpc:ndr: Implement ndr_zero_memory()Andreas Schneider2019-02-144-1/+271
| | | | | | | 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>
* build: Get rid of hardcoded 'bin/default' in includesAliaksei Karaliou2019-02-081-1/+1
| | | | | | | | | | | | Removed occurrences of bin/default used in #include directive for auto-generated headers residing in build directory. Build system is capable of resolving path to such headers by itself without extra hardcoded path to build directory. Signed-off-by: Aliaksei Karaliou <akaraliou@panasas.com> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* docs: Document DCEPRC binding string for rpcclientAndreas Schneider2019-02-041-52/+1
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Feb 4 02:03:56 CET 2019 on sn-devel-144
* librpc: Solaris cc does not like unnamed struct membersVolker Lendecke2019-02-031-22/+22
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dns.idl: fix DNS_RCODE from 0xF to 0x1FStefan Metzmacher2019-01-291-2/+1
| | | | | | | | | commit 74206984daa9c707a38675df88d6bbe660d876bc introduced TSIG related error codes up to DNS_RCODE_BADALG = 0x15 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc:idl: Fix pszDestInfPath winspool parameter typeJustin Stephenson2019-01-281-1/+1
| | | | | | | | | | | | | | | | | The in/out type of pszDestInfPath needs to be a string type for RPC call UploadPrinterDriverPackage. Per the Spec: [in, out, unique, size_is(*pcchDestInfPath)] wchar_t* pszDestInfPath, pszDestInfPath: A pointer to a buffer that receives a string that specifies the full path of the directory to which the driver installation control file was copied. Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Bjoern Jacke <bjacke@samba.org>
* librpc:rpc: Use C99 initializer for last element in dcerpc_faultsAndreas Schneider2019-01-281-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* librpc: add SMB_ASSERT(blob->length >= DCERPC_NCACN_PAYLOAD_OFFSET) protectionStefan Metzmacher2019-01-121-0/+10
| | | | | | | | | | | | A lot of functions rely on having the 16 bytes dcerpc header to operate on. This makes it more obvious and makes sure they can't be misused in future. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc: add dcerpc_get_auth_{type,level,context_id}() helper functionsStefan Metzmacher2019-01-122-0/+90
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc: add dcerpc_get_auth_length() helper functionStefan Metzmacher2019-01-122-0/+10
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libndr: Use dom_sid_str_bufVolker Lendecke2019-01-081-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4 group_audit: Add Windows Event Id's to Group membership changesGary Lockyer2018-12-211-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate a GroupChange event when a user is created with a PrimaryGroup membership. Log the windows event id in the JSON GroupChange message. Event Id's supported are: 4728 A member was added to a security enabled global group 4729 A member was removed from a security enabled global group 4732 A member was added to a security enabled local group 4733 A member was removed from a security enabled local group 4746 A member was added to a security disabled local group 4747 A member was removed from a security disabled local group 4751 A member was added to a security disabled global group 4752 A member was removed from a security disabled global group 4756 A member was added to a security enabled universal group 4757 A member was removed from a security enabled universal group 4761 A member was added to a security disabled universal group 4762 A member was removed from a security disabled universal group Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3 smbcontrol: Add sleep commandGary Lockyer2018-12-191-0/+1
| | | | | | | | | | Add a sleep command that pauses the target process for the specified number of seconds This command is only enabled on developer and self test builds. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb audit_log: Add windows event codes to password changesGary Lockyer2018-12-141-1/+3
| | | | | | | | | | Add a new "eventId" element to the PasswordChange JSON log messages. This contains a Windows Event Code Id either: 4723 Password changed 4724 Password reset Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* idl: Add Windows event code idsGary Lockyer2018-12-142-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add idl definitions for Windows Event Code Ids, and Logon Types. This intial commit adds: Event Ids 4264 Successful logon 4625 Unsuccessful logon Logon Types 2 Interactive 3 Network 4 Batch 5 Service 7 Unlock 8 NetworkCleartext 9 NewCredentials 10 RemoteInteractive 11 CachedInteractive The intention is to add Windows Event Codes to the JSON log messages, to provide a common event identifier in mixed Windows and Samba networks. And to assist security personnel with a windows background. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc:ndr: Give the optimizer hints for ndr_push_bytes()Andreas Schneider2018-12-071-6/+2
| | | | | | | | | | Also remove the redundant check in ndr_push_DATA_BLOB. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Dec 7 15:33:38 CET 2018 on sn-devel-144
* librpc:ndr: Fix undefined behavior in ndr_basicAndreas Schneider2018-12-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | librpc/ndr/ndr_basic.c:723:2: runtime error: null pointer passed as argument 2, which is declared to never be null The following triggered the undefined behavior: (gdb) bt at librpc/gen_ndr/ndr_drsuapi.c:2318 fn=0x7ffff6e72983 <ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary>) at ../../librpc/ndr/ndr.c:1337 at ../../source4/dsdb/schema/schema_syntax.c:2136 drs_str=<optimized out>) at ../../source4/dsdb/schema/tests/schema_syntax.c:122 already_setup=<optimized out>, restricted=restricted@entry=0x0) at ../../lib/torture/torture.c:442 at ../../lib/torture/torture.c:507 suite=0x5555563d9490, matched=0x7fffffffcef7) at ../../source4/torture/smbtorture.c:93 matched=0x7fffffffcef7) at ../../source4/torture/smbtorture.c:95 at ../../source4/torture/smbtorture.c:143 (gdb) f 1 1335 NDR_CHECK(ndr_push_bytes(ndr, blob.data, blob.length)); (gdb) p blob $2 = {data = 0x0, length = 0} Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Thu Dec 6 08:48:28 CET 2018 on sn-devel-144
* winbind: Fix "wbint_Principals" definitionVolker Lendecke2018-11-271-1/+1
| | | | | | | A signed integer does not make any sense for an IDL array length Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc:ndr: Fix undefined behavior in ndr.cAndreas Schneider2018-11-231-33/+33
| | | | | | | | | | | librpc/ndr/ndr.c:1430 runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Fri Nov 23 01:23:09 CET 2018 on sn-devel-144
* librpc/tables.pl: remove unused $opt_output optionStefan Metzmacher2018-11-201-2/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc:ndr: Initialize inblobAndreas Schneider2018-11-141-1/+3
| | | | | | | | | Found by cppcheck. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13680 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ndr: Init variables of GUID_from_data_blob()Andreas Schneider2018-10-191-5/+6
| | | | | | | Found by covscan. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* preg: Use gensize to allow modification of winreg data to be repackedGarming Sam2018-08-164-3/+266
| | | | | 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-164-2/+286
| | | | | | | 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>
* preg: Unpack winreg_Data for parsingGarming Sam2018-08-161-1/+1
| | | | | | | It seems that there might be pre-existing endianness issues which would be fixed by the ndr_push. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* preg: Build python preg bindingsGarming Sam2018-08-162-5/+6
| | | | | | | These will be used in the GPO import/export. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* winreg: Add hyper REG_QWORD to parsing routinesGarming Sam2018-08-161-0/+1
| | | | | | | This will be useful when exporting registry.pol files. 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-313-0/+60
| | | | | | | 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>
* librpc: add binding handle support for [smb1]Stefan Metzmacher2018-07-242-0/+3
| | | | | | | | | This will be used to force smb1. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* ndr_misc: read syntax_id using strict util_str_hex functionsDouglas Bagnall2018-05-311-10/+23
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* messaging idl add group membersip eventsGary Lockyer2018-05-161-0/+2
| | | | | Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* idl messaging: Add DSDB and Password events and message typesGary Lockyer2018-05-161-2/+9
| | | | | Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix spelling s/ouput/output/Mathieu Parent2018-05-121-1/+1
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* auth: Add unique session GUID identifierGary Lockyer2018-05-101-0/+7
| | | | | | | | Generate a GUID for each successful authorization, this will allow the tying of events in the logs back to a specific session. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ndr_string: Do overflow checks in ndr_push/pull_charsetVolker Lendecke2018-03-281-0/+6
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Mar 28 16:08:16 CEST 2018 on sn-devel-144
* ndr_string: Fix a signed/unsigned glitchVolker Lendecke2018-03-281-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* drsuapi.idl: add DN/fpo-enabled attributes as DRSUAPI_ATTID_* valuesStefan Metzmacher2018-03-191-0/+6
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13307 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* winbind: Add smbcontrol disconnect-dcVolker Lendecke2018-03-151-0/+1
| | | | | | | | | Make a winbind child drop all DC connections Bug: https://bugzilla.samba.org/show_bug.cgi?id=13332 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* librpc:ndr: Add FALL_THROUGH statements in ndr_cab.cAndreas Schneider2018-03-011-0/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>