summaryrefslogtreecommitdiff
path: root/source4
Commit message (Collapse)AuthorAgeFilesLines
* s4: torture: test closing dir handle with in-flight findRalph Boehme2018-07-271-0/+69
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb group_audit_test: Remove redundant mocking codeGary Lockyer2018-07-251-90/+0
| | | | | | | | Remove a place holder test and unused mocking code. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb group auditing: remove HAVE_JANSSON from group_auditGary Lockyer2018-07-251-6/+0
| | | | | | | | | This modules is ADDC only and JANSSON is required for the ADDC builds, so the ifdef is no longer necessary. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb audit logging: remove HAVE_JANSSON from audit_logGary Lockyer2018-07-251-11/+0
| | | | | | | | | This modules is ADDC only and JANSSON is required for the ADDC builds, so the ifdef is no longer necessary. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* json: Add unit tests for error handlingGary Lockyer2018-07-254-1/+951
| | | | | | | | | Add cmocka unit tests to exercise the error handling in the JSON routines. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* json: Modify API to use return codesGary Lockyer2018-07-253-122/+553
| | | | | | | | | Modify the auditing JSON API to return a response code, as the consensus was that the existing error handling was aesthetically displeasing. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4: libcli/smb2: calculate correct credit charge for findsRalph Boehme2018-07-251-0/+1
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:librpc: autonegotiate SMB1/2/3Stefan Metzmacher2018-07-241-139/+120
| | | | | | | | | | | Windows Server 1709 defaults to SMB2 and does not have SMB1 enabled. When establishing trust, samba-tool does not specify SMB protocol version and fail by default. 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>
* s4:libcli: add smb_connect_nego_{send,recv}()Stefan Metzmacher2018-07-243-5/+246
| | | | | | | | | | This can be used to create a connection up to a negotiated smbXcli_conn. 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>
* s4:libcli: allow a fallback to NTLMSSP if SPNEGO is not supported locallyStefan Metzmacher2018-07-241-5/+30
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s4:libcli: add fallback_to_anonymous to smb2_connect_send()Stefan Metzmacher2018-07-242-0/+33
| | | | | | | 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>
* s4:libcli: allow passing an already negotiated connection to smb2_connect_send()Stefan Metzmacher2018-07-242-0/+22
| | | | | | | | | It will just do the session setup and tree connect steps. 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>
* s4:libcli: split out smb2_connect_session_start()Stefan Metzmacher2018-07-241-4/+12
| | | | | | | 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>
* s4:libcli: add smb2_transport_raw_init()Stefan Metzmacher2018-07-241-0/+35
| | | | | | | 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>
* s4:libcli: allow passing an already negotiated connection to ↵Stefan Metzmacher2018-07-244-10/+41
| | | | | | | | | | | smb_composite_connect() It will just do the session setup and tree connect steps. 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>
* s4:libcli: use talloc_zero() for struct smb_composite_connect in fetchfile.cStefan Metzmacher2018-07-241-1/+1
| | | | | | | 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>
* s4:libcli: add smbcli_transport_raw_init()Stefan Metzmacher2018-07-241-0/+44
| | | | | | | 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>
* s4:libcli: split out smb_raw_negotiate_fill_transport()Stefan Metzmacher2018-07-241-30/+44
| | | | | | | 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>
* s4-dsdb: only build dsdb Python modules for AD DCAlexander Bokovoy2018-07-231-4/+7
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13542 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4-dns_server: Only build dns server Python code for AD DCAlexander Bokovoy2018-07-231-3/+5
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13542 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* dns wildcards: fix BUG 13536Gary Lockyer2018-07-201-0/+1
| | | | | | | | | | | The current position in the dns name was not advanced past the '.' character Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jul 20 04:40:31 CEST 2018 on sn-devel-144
* dsdb: Fix the 32-bit buildVolker Lendecke2018-07-181-2/+2
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jul 18 03:12:02 CEST 2018 on sn-devel-144
* kcc: Fix the 32-bit buildVolker Lendecke2018-07-181-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4: torture: run test_durable_v2_open_reopen2_lease() in a subdirectoryRalph Boehme2018-07-181-2/+9
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13535 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4/torure/drs/python: Fix incorrect use of unicode which doesn't exist in py3Noel Power2018-07-131-1/+1
| | | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4/torture/drs/python: xrange -> range for py2/py3 compatNoel Power2018-07-131-1/+1
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4/torture/drs/python: long is not used in py3Noel Power2018-07-131-1/+1
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4/torture/drs/python: use cmp_fn for cmp (for py2/py3 compat)Noel Power2018-07-131-3/+3
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4/torture/drs/python: use cmp_fn and key=cmp_to_key_fn for py2/py3Noel Power2018-07-131-5/+7
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4/torture/drs/python: py2/py3 port map / ord usageNoel Power2018-07-131-5/+8
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4/torture/drs: ndr_upack needs bytes in py3 (samba4.drs.repl_move)Noel Power2018-07-131-1/+1
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4/dsdb/tests/python: base64.b64encode returns bytesNoel Power2018-07-131-3/+3
| | | | | | | | | | adjust to unicode for py2/py3 compat needed as part of changes to ensure samba4.ldap.password_settings will work with PY3 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4/librpc/ndr: allow GUID to accept unicode alsoNoel Power2018-07-131-1/+1
| | | | | | | | | | This needed since _GUID_string method change (in source4/torture/drs/python/drs_base.py) which makes use use a unicode guid at times now Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4/torture/drs/python: Py2/Py2 fix tab/space also incorrect unicode usageNoel Power2018-07-131-7/+7
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* gpo: Add user policy extensionsDavid Mulder2018-07-121-2/+4
| | | | | | Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* gpo: Dynamically load gp_extsDavid Mulder2018-07-121-0/+4
| | | | | | | | | | | | | | | This loads Group Policy Client Side Extensions similar to the way that they are loaded on a Windows client. Extensions are installed to a configuration file in the samba cache path where they receive a unique GUID matched with the path to the python gp_ext file. Classes which inherit from the gp_ext class (as defined in gpclass.py) will be dynamically loaded. Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* param: Add python binding for lpcfg_state_pathDavid Mulder2018-07-121-0/+27
| | | | | | Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python: Allow forced signing via smb.SMB()David Mulder2018-07-121-3/+7
| | | | | | Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* gpo: Disable python3 testingDavid Mulder2018-07-121-1/+1
| | | | | | | | | | | The gpo module doesn't work in python3 yet, causing this test to fail on python3. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13525 Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python: Add samba.auth.session_info_fill_unix()Andrew Bartlett2018-07-121-0/+61
| | | | | | | | | This fills in the unix portions of the token needed by smbd and the pysmbd bindings Signed-off-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Joe Guo <joeg@catalyst.net.nz> Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* dns: static recordsAaron Haslett2018-07-124-23/+54
| | | | | | | | | | Modifies bind9 and internal dns to match windows static records behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dns: update tool changed for scavengingAaron Haslett2018-07-121-9/+1
| | | | | | | | | | | | Now that scavenging is implemented, the DNS update tool needs to be changed so that it always updates every name required by the DC. Otherwise, the records might be scavenged. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dns+kcc: adding dns scavenging to kcc periodic runAaron Haslett2018-07-122-0/+79
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Pair-Programmed-With: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dns: dns record scavenging function (without task)Aaron Haslett2018-07-126-3/+572
| | | | | | | | | | | | DNS record scavenging function with testing. The logic of the custom match rule in previous commit is inverted so that calculations using zone properties can be taken out of the function's inner loop. Periodic task to come. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dns: custom match rule for DNS records to be tombstonedAaron Haslett2018-07-121-0/+1
| | | | | | | | | | | | | A custom match rule for records to be tombstoned by the scavenging process. Needed because DNS records are a multi-valued attribute on name records, so without a custom match rule we'd have entire zones into memory to search for expired records. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* dns: server side implementation of record agingAaron Haslett2018-07-124-4/+144
| | | | | | | | | | | Code for retrieving aging properties from a zone and using them for timestamp setting logic during processing of DNS requests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dns: moving name_equal func into commonAaron Haslett2018-07-126-39/+22
| | | | | | | | | | This function is duplicated in the BIND9 and RPC DNS servers. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rpc dns: reset dword aging related zone propertiesAaron Haslett2018-07-123-6/+130
| | | | | | | | | | This allows a user to set zone properties relevant to DNS record aging over RPC. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rpc dns: reading zone properties from LDBAaron Haslett2018-07-123-5/+84
| | | | | | | | | | | Reading zone properties from LDB on server connection initialisation, instead of them being volatile fields. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dns: Reformat DNS with clang-formatGary Lockyer2018-07-128-27/+39
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>