summaryrefslogtreecommitdiff
path: root/source4
Commit message (Collapse)AuthorAgeFilesLines
* test samba-tool group listmembers: test listing contacts as group membersBjörn Baumbach2021-04-261-0/+9
| | | | | | | | | | | | Make sure that contacts are listed as group members, even if the --hide-expired option is used. Expect failure. Fix follows up. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14692 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Rowland penny <rpenny@samba.org>
* Fix sigsegv in check_stream in smbtorture smb2.streams.ioGordon Ross2021-04-221-15/+28
| | | | | | | | | | | | | torture_comment calls need a struct torture_context arg, not its mem_ctx child. Use talloc_parent(). Also need to call torture_result somewhere on failure. Signed-off-by: Gordon Ross <gordon.ross@tintri.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Mulder <dmulder@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Apr 22 18:48:30 UTC 2021 on sn-devel-184
* python: Test s3 net join and leaveDavid Mulder2021-04-211-0/+3
| | | | | Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* heimdal_build: avoid cflags='-DSOCKET_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_'Stefan Metzmacher2021-04-201-3/+0
| | | | | | | | | | SOCKET_WRAPPER_DISABLE is unused for a long time already and _SAMBA_HOSTCC_ is implied by use_hostcc=True now. Signed-off-by: Stefan Metzmacher <metze@samba.org> [abartlet@samba.org: Adapted to current master from Metze's wip.git/master/heimdal branch] Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* heimdal_build: Do not use LMDB in Heimdal even if we have it in SambaAndrew Bartlett2021-04-201-0/+3
| | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* heimdal_build: use TO_LIST from wafsamba.samba_utilsStefan Metzmacher2021-04-201-16/+8
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> [abartlet@samba.org: adapted from patch in Metze's wip.git/master-heimdal to current master without the other patches] Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* torture: Move sddl tests to pythonVolker Lendecke2021-04-194-109/+9
| | | | | | | | | This kind of test is better hosted in python than in C. More lines, but the ones in source4/libcli/security/tests/sddl.c were preeetty long... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc: Add py_descriptor_richcmp() equality functionVolker Lendecke2021-04-191-0/+37
| | | | | | | Only a python3 version. Do we still need the python2 flavor? Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc: Use GUID_buf_string() in python wrappersVolker Lendecke2021-04-191-12/+15
| | | | | | | No need for the talloc'ed strings Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* py_security: Avoid casts in py_random_sid()Volker Lendecke2021-04-191-4/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dsdb: Slightly tune get_new_descriptor()Volker Lendecke2021-04-191-3/+7
| | | | | | | | | | | | DBG_DEBUG only calls its arguments if required according to the debug level. A simple talloc_new/TALLOC_FREE in the normal case should be much cheaper than the full sddl_encode(). I just stumbled across this code, this is has not shown up in any profiles. I just think it's cleaner this way. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* auth4: Remove unused auth_unixAndrew Bartlett2021-04-192-810/+0
| | | | | | | | | | | | | | | | | | | | auth_unix was in the source4/auth/ntlm for two reasons: - inherited from earlier Samba before the Samba4 fork - To support the ejs-backed SWAT (web administration tool) Neither of these are good reasons to keep this unused code around, there is very unlikely to be a need to support plaintext PAM authentication in this part of the code in the future. See b16362fab65d0700bd6a8cf6569a9e21c7e6b069 for some context on the historical use case. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Apr 19 07:07:01 UTC 2021 on sn-devel-184
* auth4: Remove sync check_password from auth_operationsVolker Lendecke2021-04-162-44/+4
| | | | | | | | Remove complexity in the data structures, and pushes the async-ness one level down. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* auth4: Make auth_sam pseudo-asyncVolker Lendecke2021-04-161-2/+67
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* auth4: Make auth_unix pseudo-asyncVolker Lendecke2021-04-161-26/+59
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* auth4: Make auth_developer pseudo-asyncVolker Lendecke2021-04-162-2/+61
| | | | | | | This is a simpler approach to really just wrap the code. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* auth4: Make auth_anonymous pseudo-asyncVolker Lendecke2021-04-162-10/+58
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* waf: Check correctly if gnutls has been compiled with fips mode supportAndreas Schneider2021-04-131-3/+3
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Apr 13 19:17:56 UTC 2021 on sn-devel-184
* s4:client:tests: create temporary files under $PREFIX/SELFTEST_TMPDIRStefan Metzmacher2021-04-132-23/+25
| | | | | | | Tests should not create files in the build nor the source directory! Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests python krb5: MS-KILE client principal look-upGary Lockyer2021-04-121-0/+3
| | | | | | | | | | | | Tests of [MS-KILE]: Kerberos Protocol Extensions section 3.3.5.6.1 Client Principal Lookup Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Isaac Boukris <iboukris@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Apr 12 00:38:26 UTC 2021 on sn-devel-184
* s4:torture: Use cli_credentials_init_server()Andreas Schneider2021-04-091-6/+2
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Apr 9 11:48:00 UTC 2021 on sn-devel-184
* s4:rpc_server: Use cli_credentials_init_server()Andreas Schneider2021-04-091-9/+3
| | | | | | This also removes dcerpc_remote:domain option for the machine account case. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:ntvfs: Use cli_credentials_init_server()Andreas Schneider2021-04-091-7/+4
| | | | | | This also removes cifs:domain option for the machine account case. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:ntvfs: Use cli_credentials_init_server()Andreas Schneider2021-04-091-7/+4
| | | | | | This also removes cifs:domain option for the machine account case. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:ldap_server: Use cli_credentials_init_server()Andreas Schneider2021-04-091-8/+1
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* py/provision/sambadns: rename CNameRecord -> CNAMERecordDouglas Bagnall2021-04-081-2/+2
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* torture: add another smbtorture compound SMB2 requests test "related9"Ralph Boehme2021-04-081-0/+101
| | | | | | | | | This test verifies that if a compound related request is not preceeded by a request that generates or contains a File-ID, the request fails with NT_STATUS_INVALID_PARAMETER. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add smbtorture compound SMB2 requests test "related8"Ralph Boehme2021-04-081-0/+122
| | | | | | | | | This verifies that if the initial create fails with NT_STATUS_OBJECT_NAME_NOT_FOUND, compount related operations fail with the same error. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add smbtorture testcase "related7" for failure in compound related ↵Anubhav Rakshit2021-04-081-0/+123
| | | | | | | | | | | | | chain We want to verify what Windows does when the first request of the chain has failed and an async request is part of the chain. We see Windows fails the async request with the same error. Also the async request is immediately failed. Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: smbtorture test case to verify Compound related handlingAnubhav Rakshit2021-04-081-0/+119
| | | | | | | | | This test case checks what happens when we have an intermediate request failure and how it impacts rest of the chain. Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Add couple of compound related test cases to verify that server ↵Anubhav Rakshit2021-04-081-0/+176
| | | | | | | | | | should return NTSTATUS of the failed Create for succeeding requests. We already pass samba3.smb2.compound.related5, but mark related4 as knownfail. Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* cracknames: Allow auto-conversion from an extended canonical nameJoseph Sutton2021-04-071-0/+2
| | | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* cracknames: Add support for SID string formatJoseph Sutton2021-04-073-6/+31
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10319 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* selftest: Test RPC handles and association groups from different connectionSamuel Cabrero2021-04-071-0/+126
| | | | | | | | | | | | | | | | | | | | | | Add a test to check if a RPC handle can be used from a different connection than the one where it was created, when the same association group is requested in the bind operation of the second connection. The association group handling is one of the differences between the S3 and S4 RPC server implementations provided by the implementation callbacks after the merge. Association groups work fine in the S4 implementation as the RPC server runs in one process, except for the 'smbd' embedded services provided by the S3 implementation like winreg (see lp_enforce_ad_dc_settings()). In the S3 implementation, association groups should work in the same process, but the merge introduced a bug where a new association group is always created even when it already exists in the same process. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:dsdb/password_hash: Add a more useful error message for passwords too ↵Joseph Sutton2021-04-071-4/+11
| | | | | | | | | | long to be hashed BUG: https://bugzilla.samba.org/show_bug.cgi?id=14621 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/password_hash: Add additional check for crypt() and crypt_r() failureJoseph Sutton2021-04-071-1/+6
| | | | | | | | | | | | | While crypt_rn() always returns a null pointer in the event of failure, crypt() and crypt_r() may instead return a string starting with the character '*'. This commit adds a check to detect failure in this case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14621 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* provision: Decrease the length of random machine passwordsJoseph Sutton2021-04-072-2/+2
| | | | | | | | | | | | | The current length of 128-255 UTF-16 characters currently causes generation of crypt() passwords to typically fail. This commit decreases the length to 120 UTF-16 characters, which is the same as that used by Windows. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14621 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/password_hash: Don't generate crypt() password for krbtgt accountJoseph Sutton2021-04-071-1/+6
| | | | | | | | | | | | | Since the length of the krbtgt password after conversion to UTF-8 form is typically greater than the maximum accepted by crypt(), the call usually fails. This commit disables generation of crypt() passwords for this specific account, as it's not necessary. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14621 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* provision tests: Add test for the CryptSHA256 and CryptSHA512 password ↵Joseph Sutton2021-04-071-0/+1
| | | | | | | | | | hashing schemes BUG: https://bugzilla.samba.org/show_bug.cgi?id=14621 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc: Remove the gensec dependency from library dcerpc-bindingVolker Lendecke2021-04-062-1/+21
| | | | | | | | | | | | This means yet another library, but having to depend on gensec just for dcerpc_parse_binding() and basic packet parsing seems like a bit overkill to me. 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): Tue Apr 6 23:33:14 UTC 2021 on sn-devel-184
* rpc: Give dcerpc_util.c its own headerVolker Lendecke2021-04-062-0/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tstream_npa: Return named_pipe_auth_req_info4 from accept_existingVolker Lendecke2021-04-011-0/+1
| | | | | | | | Callers might want the full picture. We need to make named_pipe_auth_req_info4 public for that. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4: torture. Add smb2.lease.rename_wait test to reproduce regression in ↵Jeremy Allison2021-03-311-0/+144
| | | | | | | | | | | | | delay rename for lease break code. Passes against Windows 10. Add to knownfail, the next commit will fix this. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14679 CI: https://gitlab.com/samba-team/samba/-/merge_requests/1875 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* rpc/idl dnsserver s/DNS_RPC_DATA/DNS_RPC_RECORD_DATA/Douglas Bagnall2021-03-301-1/+1
| | | | | | | | | | Following MS-DNSP. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Mar 30 00:20:53 UTC 2021 on sn-devel-184
* librpc/idl: dnsp tombstone timestamp name matches MS-DNSPDouglas Bagnall2021-03-293-7/+7
| | | | | | | | | | MS-DNSP uses the term "EntombedTime" in e.g. "2.2.2.2.4.23 DNS_RPC_RECORD_TS" which is more descriptive than the generic "timestamp", and less likely to be confused with dwTimestamp, which has been our curse. Let's make it grep-able, google-able, and evocative. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>
* dsdb/dns scavange: make a helper function staticDouglas Bagnall2021-03-292-9/+4
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>
* dsdb/scavange dns: reserve NTTIME type for NTTIME valuesDouglas Bagnall2021-03-292-9/+9
| | | | | | | | | | | | We know it "really" just means uint64_t, but we also know it means 100-nanosecond intervals since 1601, and that makes any other use very confusing (and not just to me, or there wouldn't be these bugs we're chasing). In these cases we are talking about 32 bit hours-since-1601 timestamps. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>
* dns: use unix_to_dns_timestamp almost everywhereDouglas Bagnall2021-03-294-18/+6
| | | | | | | | | | | In places we change NTTIME to uint32_t, because that is what is actually wanted. There is one instance of the calculation that we are not changing, because there are other problems there. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>
* pydns: expose dns timestamp utils to python, and testDouglas Bagnall2021-03-292-0/+50
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>
* dns: add common dns_timestamp util functionsDouglas Bagnall2021-03-292-0/+95
| | | | | | | | | | | The dns structs have an unsigned 32 bit timestamp in hours since the beginning of 1601. In a number of places we need to convert from unix time to this timestamp, or from the timestamp to NTTIME. You'll see subsequent patches that make use of these functions. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>