1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

7121 Commits

Author SHA1 Message Date
Jeremy Allison
fe7737135a s4: torture: Add additional smbc_readdirplus2() tests into readdirplus_seek().
Make sure we haven't broken anything :-).

Signed-off-by: Puran Chand <pchand@vmware.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-30 20:44:31 +00:00
Jeremy Allison
a5f850a93f s4: torture Add a test for smbc_readdirplus2()
Signed-off-by: Puran Chand <pchand@vmware.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-30 20:44:31 +00:00
Ralph Boehme
b63069db9f torture: expand test "vfs.fruit.resource fork IO" to check size
Reveals a bug where the resource fork size is capped at 65454 bytes.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14171

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-10-30 13:23:42 +00:00
Isaac Boukris
90bdaaf09d selftest: add a test for PAC delegation-info blob in S4U2Proxy
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13133

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-21 14:40:38 +00:00
Isaac Boukris
d6a4eea5fd selftest/remote_pac: split test_PACVerify() in two
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13133

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-21 14:40:38 +00:00
Samuel Cabrero
55ad4ae7ff s4:rpc_server: Find association groups through context callbacks
Split the association group management from the server code, the s3 and
s4 implementation will handle differently.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:37 +00:00
Samuel Cabrero
6fe23fa071 s4:rpc_server: Hide gensec prepare behind function pointer
This function will be different for s3 and s4

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:36 +00:00
Samuel Cabrero
bf09771953 s4:rpc_server: Add dcesrv_context_callbacks to dcesrv_context
Add a new struct dcesrv_context_callbacks in dcesrv_context to hold pointers
to functions whose implementation will differ between S3 and S4.

The log_successful_dcesrv_authz_event implementation will differ as it
requires an imessaging_context.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:36 +00:00
Samuel Cabrero
61aaebaa35 s4:torture: Assert connection
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:35 +00:00
Samuel Cabrero
e4b1354066 s4:torture: Fix torture comment
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:35 +00:00
Samuel Cabrero
f43e08259c s4:torture: Add braces
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:35 +00:00
Andrew Bartlett
c46191b878 librpc: Remove client and server build of rot.idl
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>
2019-10-10 08:08:45 +00:00
Ralph Boehme
c9b6298249 mdssvc.idl: pass policy_handle as pointer
No change in behaviour, this just changes all functions to take the
policy_handle argument as pointer instead of passing it by value.
This is how all other IDLs pass it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Oct  9 15:52:55 UTC 2019 on sn-devel-184
2019-10-09 15:52:55 +00:00
Gordon Ross
78161550ba torture: Allow running on FS that does not support EAs
Signed-off-by: Gordon Ross <gordon.w.ross@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Oct  7 22:05:59 UTC 2019 on sn-devel-184
2019-10-07 22:05:59 +00:00
Volker Lendecke
e3e5894b85 torture: Fix a comment
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-02 08:01:40 +00:00
Ralph Boehme
300b47442b torture:smb2: add a File-ID test on directories
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-10-02 08:01:39 +00:00
Ralph Boehme
432202413f torture:smb2: extend test for File-IDs
This now hopefully covers most possible combinations of creating and opening
files plus, checking the file's File-ID after every operation.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-10-02 08:01:39 +00:00
Günther Deschner
5550367e46 s4-torture: remove duplicate NDR_PRINT
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-09-26 18:41:26 +00:00
Günther Deschner
fd20153e8b s4-torture: dump ndr packet in ndr tests with high log level
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-09-26 18:41:26 +00:00
Günther Deschner
2d5facc954 s4-torture: add netr_LogonGetDomainInfo NDR(64) tests
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Sep 20 02:32:44 UTC 2019 on sn-devel-184
2019-09-20 02:32:44 +00:00
Günther Deschner
634ab14f0d s4-torture: reformat test table in ndr test
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-09-20 01:14:43 +00:00
Günther Deschner
fda5b839c7 torture: add torture_suite_add_ndr_pull_io_test_flags()
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-09-20 01:14:43 +00:00
Stefan Metzmacher
8f0751b8b7 netlogon.idl: fix the marshalling of netr_trust_extension_container for NDR64
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2019-09-20 01:14:43 +00:00
Sam Zaydel
3263dd32fe Argument to control number of operations -o no longer valid
(This patch, only removing manpage text, submitted by gitlab.com user
Sam Zaydel @szaydel in MR 243 but without a Signed-off-by, so I
(Andrew Bartlett) am adding mine to say I'm happy to say this is a
legitimate and deliberate contribtion.)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep 18 19:51:11 UTC 2019 on sn-devel-184
2019-09-18 19:51:11 +00:00
Ralph Wuerthner
b730f350c2 s4:torture: fix file cleanup in smb2.create.delete
Cleanup of test files created by smb2.create.delete is broken because
READONLY is set on the test file. Clear READONLY first before doing
the cleanup.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 12 17:36:50 UTC 2019 on sn-devel-184
2019-09-12 17:36:50 +00:00
Ralph Wuerthner
aa5b233328 s4:torture: fix closure of test directory handle
Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-09-12 16:16:28 +00:00
Ralph Wuerthner
156eb9120e s4:torture: correctly cast printf() argument
In most cases sattrib is passed as a long int literal. Avoid
compile errors by casting the value passed to printf().

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-09-12 16:16:28 +00:00
Ralph Boehme
2ecab3c60a s4:torture: add a file-id related test
Note I'm using the share vfs_fruit_xattr because I need a share with both a
streams and a acl_* VFS object.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-09-10 19:05:28 +00:00
Stefan Metzmacher
849e3842cd s4:torture/smb2: try to fix a RESOURCE_LEAK in smb2.samba3misc.localposixlock1
CID 1453656:    (RESOURCE_LEAK)
Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 10 18:56:45 UTC 2019 on sn-devel-184
2019-09-10 18:56:45 +00:00
Stefan Metzmacher
c6b48490ac s4:torture: always add ';' after torture_assert()
The next commit will require this.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-09-10 17:38:40 +00:00
Stefan Metzmacher
d3bc019969 s4:torture/raw: add multilock6 test
This is similar to multilock3, but uses a read-only
(LOCKING_ANDX_SHARED_LOCK) locks for the 2nd lock
request.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-09-09 14:23:40 +00:00
Stefan Metzmacher
6d4296aca0 s4:torture/raw: add multilock5 test
This is similar to multilock3, but uses a read-only
(LOCKING_ANDX_SHARED_LOCK) locks for the first lock
request.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-09-09 14:23:40 +00:00
Stefan Metzmacher
d3e65ceb1e s4:torture/raw: add multilock4 test
This is similar to multilock3, but uses read-only
(LOCKING_ANDX_SHARED_LOCK) locks for the blocked
requests.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-09-09 14:23:40 +00:00
Stefan Metzmacher
297763c6b6 s4:torture/raw: add multilock3 test
This demonstrates that unrelated lock ranges
are not blocked by other blocked requests on the same
fsp.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-09-09 14:23:40 +00:00
Stefan Metzmacher
8a7039be53 s4:torture/raw: improvements for multilock2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-09-09 14:23:40 +00:00
Stefan Metzmacher
7155d3a2c5 s4:torture/smb2: add smb2.samba3misc.localposixlock1
This demonstrates that the SMB2 code path doesn't do
any retry for local posix locks.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-09-09 14:23:40 +00:00
Stefan Metzmacher
2a77025a1e s4:torture/raw: assert to get LOCK_NOT_GRANTED in torture_samba3_posixtimedlock()
There should not be a different if the blocker is a posix process
instead of another smbd.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-09-09 14:23:40 +00:00
Stefan Metzmacher
bebee47e63 s4:torture: make rpc.handles.random-assoc test more robust
We've seen failures like this:

  RPC-HANDLE-RANDOM-ASSOC
  connect samr pipe1
  pipe1 uses assoc_group_id[0x00000001]
  connect samr pipe2 with assoc_group_id[0xFFFFFFFF]- should fail
  Failed to bind to uuid 12345778-1234-abcd-ef00-0123456789ac for
    ncacn_np:localdc[\pipe\samr,bigendian,assoc_group_id=0xffffffff,
    abstract_syntax=12345778-1234-abcd-ef00-0123456789ac/0x00000001] NT_STATUS_UNSUCCESSFUL
  connect samr pipe3 with assoc_group_id[0x00000000]- should fail
  UNEXPECTED(failure): samba4.rpc.handles on ncacn_np with bigendian.random-assoc(ad_dc_default)
  REASON: Exception: Exception: ../../source4/torture/rpc/handles.c:546:
    status was NT_STATUS_OK, expected NT_STATUS_UNSUCCESSFUL: opening samr pipe3

Prevent that it wraps to 0x00000000

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-09-09 14:23:39 +00:00
Volker Lendecke
1e2d209494 torture: Fix the FreeBSD clang build
clang complained that "full_filename==NULL" is always false, because
it's a normal stack variable.

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 Sep  4 18:20:22 UTC 2019 on sn-devel-184
2019-09-04 18:20:22 +00:00
Jeremy Allison
3355601fe8 s3/4: libsmbclient test. Test using smbc_telldir/smbc_lseekdir with smbc_readdir/smbc_readdirplus/smbc_getdents.
Ensure that for file access you can mix any of these
three access methods for directory entries and the
returned names/structs stay in sync across telldir/seekdir
changes.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14094

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep  3 17:31:29 UTC 2019 on sn-devel-184
2019-09-03 17:31:28 +00:00
Mathieu Parent
08cc61f9b6 Spelling fixes s/accidentially/accidentally/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:27 +00:00
Mathieu Parent
7cb0ca4171 Spelling fixes s/ dont / don't /
Excluding examples/tridge/smb.conf

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:27 +00:00
Mathieu Parent
619e8f46d8 Spelling fixes s/ upto / up to /
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:27 +00:00
Mathieu Parent
271b04aaae Spelling fixes s/noone/no one/
Skipping source4/torture/winbind/struct_based.c

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:27 +00:00
Mathieu Parent
06e0f89345 Spelling fixes s/optinally/optionally/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:26 +00:00
Mathieu Parent
49a6e109aa Spelling fixes s/componet/component/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:26 +00:00
Mathieu Parent
5d0c26fc6b Spelling fixes s/nonexistant/nonexistent/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:26 +00:00
Mathieu Parent
de813400f3 Spelling fixes s/DISLPAY/DISPLAY/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:26 +00:00
Mathieu Parent
cdc8c05ba5 Spelling fixes s/serivce/service/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:26 +00:00
Mathieu Parent
fbf94dba59 Spelling fixes s/BUITIN/BUILTIN/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:26 +00:00
Mathieu Parent
54b6fa8631 Spelling fixes s/emtpy/empty/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:26 +00:00
Mathieu Parent
a12d843b2c Spelling fixes s/setted/set/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:26 +00:00
Mathieu Parent
e8f8d2d214 Spelling fixes s/encrpted/encrypted/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:26 +00:00
Swen Schillig
42123c11c4 s4: free popt context in torture
If done with popt context it should be free'd.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2019-08-22 00:21:50 +00:00
Swen Schillig
a7e7a62f7d torture: fix mem leak found by ASAN (smb2_connect)
Direct leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x7f0b16624c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
    #1 0x7f0b15e4ba5c in __talloc_with_prefix ../../lib/talloc/talloc.c:782
    #2 0x7f0b15e4ba5c in __talloc ../../lib/talloc/talloc.c:824
    #3 0x7f0b15e4ba5c in _talloc_named_const ../../lib/talloc/talloc.c:981
    #4 0x7f0b15e4ba5c in talloc_named_const ../../lib/talloc/talloc.c:1748
    #5 0x55ffdd30d591 in torture_smb2_connect ../../source4/torture/smb2/connect.c:199
    #6 0x7f0b12723772 in wrap_simple_test ../../lib/torture/torture.c:633
    #7 0x7f0b1272775e in internal_torture_run_test ../../lib/torture/torture.c:442
    #8 0x7f0b12728543 in torture_run_tcase_restricted ../../lib/torture/torture.c:507
    #9 0x7f0b12728dd5 in torture_run_suite_restricted ../../lib/torture/torture.c:357
    #10 0x7f0b12729434 in torture_run_suite ../../lib/torture/torture.c:339
    #11 0x55ffdd10c54a in run_matching ../../source4/torture/smbtorture.c:93
    #12 0x55ffdd10df56 in torture_run_named_tests ../../source4/torture/smbtorture.c:143
    #13 0x55ffdd11199d in main ../../source4/torture/smbtorture.c:691
    #14 0x7f0b0aa45412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Aug 21 15:42:43 UTC 2019 on sn-devel-184
2019-08-21 15:42:43 +00:00
Andreas Schneider
c3f9698175 lib:crypto: Do not build AES-CMAC if we use GnuTLS that supports it
This requires GnuTLS >= 3.6.5.

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): Wed Aug 21 11:14:11 UTC 2019 on sn-devel-184
2019-08-21 11:14:11 +00:00
Andrew Bartlett
52b91cb33c s4-rpc_server: Remove Heimdal-based BackupKey server
We rely on a modern GnuTLS now.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-08-21 09:57:31 +00:00
Andreas Schneider
1f6104f09a lib:crypto: Prepare not to build AES or AES-CMAC if we use GnuTLS support it
Samba will soon require GnuTLS >= 3.4.7.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Adjusted by Andrew Bartlett from an earlier more comprehensive patch by Andreas

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2019-08-21 09:57:31 +00:00
Alexander Bokovoy
4d276a93fc smbtorture: extend rpc.lsa to lookup machine over forest-wide LookupNames
Add a simple test to resolve DOMAIN\MACHINE$ via LSA LookupNames3
using LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 level. This level would pass
zero lookup flags to lookup_name().

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Wed Aug 14 13:07:42 UTC 2019 on sn-devel-184
2019-08-14 13:07:42 +00:00
Alexander Bokovoy
317bc6a734 torture/rpc/lsa: allow testing different lookup levels
Convert torture/rpc/lsa LookupNames/LookupSids code to allow testing
different LSA_LOOKUP_NAMES_* levels. Keep existing level 1
(LSA_LOOKUP_NAMES_ALL) for the current set of tests.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-08-14 11:49:33 +00:00
Volker Lendecke
dee721af72 torture: Fix CID 1452288 Null pointer dereferences (NULL_RETURNS)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Aug 14 08:59:23 UTC 2019 on sn-devel-184
2019-08-14 08:59:23 +00:00
Swen Schillig
dbf26d7e0c torture: fix mem leak found by ASAN (smb2_scan)
Direct leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x7f63e6938c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
    #1 0x7f63e615fa5c in __talloc_with_prefix ../../lib/talloc/talloc.c:782
    #2 0x7f63e615fa5c in __talloc ../../lib/talloc/talloc.c:824
    #3 0x7f63e615fa5c in _talloc_named_const ../../lib/talloc/talloc.c:981
    #4 0x7f63e615fa5c in talloc_named_const ../../lib/talloc/talloc.c:1748
    #5 0x55609e7530cf in torture_smb2_scan ../../source4/torture/smb2/scan.c:203
    #6 0x7f63e2a37772 in wrap_simple_test ../../lib/torture/torture.c:633
    #7 0x7f63e2a3b75e in internal_torture_run_test ../../lib/torture/torture.c:442
    #8 0x7f63e2a3c543 in torture_run_tcase_restricted ../../lib/torture/torture.c:507
    #9 0x7f63e2a3cdd5 in torture_run_suite_restricted ../../lib/torture/torture.c:357
    #10 0x7f63e2a3cf25 in torture_run_suite_restricted ../../lib/torture/torture.c:362
    #11 0x7f63e2a3d434 in torture_run_suite ../../lib/torture/torture.c:339
    #12 0x55609e3a154a in run_matching ../../source4/torture/smbtorture.c:93
    #13 0x55609e3a2f56 in torture_run_named_tests ../../source4/torture/smbtorture.c:143
    #14 0x55609e3a699d in main ../../source4/torture/smbtorture.c:691
    #15 0x7f63dad59412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-08-10 19:24:29 +00:00
Swen Schillig
1610476860 torture: fix mem leak found by ASAN
==14507==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7f3c76fe5c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
    #1 0x7f3c7680df33 in __talloc_with_prefix ../../lib/talloc/talloc.c:782
    #2 0x7f3c7680df33 in __talloc ../../lib/talloc/talloc.c:824
    #3 0x7f3c7680df33 in _talloc_named_const ../../lib/talloc/talloc.c:981
    #4 0x7f3c7680df33 in _talloc_zero ../../lib/talloc/talloc.c:2422
    #5 0x7f3c7680e2a5 in _talloc_zero_array ../../lib/talloc/talloc.c:2775
    #6 0x557a50d4a09f in torture_bench_treeconnect ../../source4/torture/raw/tconrate.c:165
    #7 0x7f3c730e4772 in wrap_simple_test ../../lib/torture/torture.c:633
    #8 0x7f3c730e875e in internal_torture_run_test ../../lib/torture/torture.c:442
    #9 0x7f3c730e9543 in torture_run_tcase_restricted ../../lib/torture/torture.c:507
    #10 0x7f3c730e9dd5 in torture_run_suite_restricted ../../lib/torture/torture.c:357
    #11 0x7f3c730ea434 in torture_run_suite ../../lib/torture/torture.c:339
    #12 0x557a50c1b54a in run_matching ../../source4/torture/smbtorture.c:93
    #13 0x557a50c1cf56 in torture_run_named_tests ../../source4/torture/smbtorture.c:143
    #14 0x557a50c2099d in main ../../source4/torture/smbtorture.c:691
    #15 0x7f3c6b406412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-08-10 19:24:29 +00:00
Ralph Boehme
017af5d583 torture: beginning of a mdssvc RPC service test-suite
Yikes! Most tests fail atm.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-08-08 20:24:33 +00:00
Ralph Boehme
c282d76d55 torture: start of a mdssvc packet (un)marshalling testsuite
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-08-08 20:24:32 +00:00
Swen Schillig
f9a32767b6 ldb: Free memory in torture test to satisfy sanitizer
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2019-08-08 10:08:32 +00:00
Swen Schillig
bb8cc5956f ndr: Free memory in torture test to satisfy sanitizer
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2019-08-08 10:08:32 +00:00
Swen Schillig
d167fb4089 ldb: Fix mem allocation in torture test to satisfy sanitizer
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2019-08-08 10:08:32 +00:00
Garming Sam
35c54007e6 tests/drs_no_dns: Check dbcheck and ldapcmp pass
When joining a DC without DNS partitions, make sure that the alternate
flow of creating them afterwards results in a database with everything
that is necessary.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14051
RN: Allow a DC join without DNS partitions, to add them later

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-31 02:50:24 +00:00
Andreas Schneider
301544ab2b s4:torture: Use init_samr_CryptPassword in testjoin RPC test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:26 +00:00
Andrew Bartlett
5740e9516f s4:torture: Use samba_gnutls_arcfour_confounded_md5() in test_ChangePasswordRandomBytes
This ensures GnuTLS is used as the underlying RC4 crypto engine

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-26 01:48:26 +00:00
Andreas Schneider
82a6480611 s4:torture: Use GnuTLS RC4 in test_ChangePasswordRandomBytes
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:26 +00:00
Andrew Bartlett
19d9c2c01a s4:torture: Use init_samr_CryptPassword in test_ChangePasswordRandomBytes
This allows the use of GnuTLS for the underlying RC4 crypto

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-26 01:48:26 +00:00
Andrew Bartlett
8380668be7 s4:torture: clarify comments and variable names in "ChangePasswordUser3 tests
There is no session key here, the buffers are directly encrypted
with the long-term passwords.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-26 01:48:26 +00:00
Andreas Schneider
5b7c21fca5 s4:torture: Use init_samr_CryptPassword in test_ChangePasswordUser3
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:26 +00:00
Andreas Schneider
a476a2e332 s4:torture: Use GnuTLS RC4 in test_ChangePasswordUser2_ntstatus
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:25 +00:00
Andreas Schneider
9cbdf7b2e5 s4_torture: Use GnuTLS RC4 in test_ChangePasswordUser2
This uses STR_ASCII as string encodings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:25 +00:00
Andrew Bartlett
1b1c302a7d s4:torture: Use init_samr_CryptPassword in test_ChangePasswordUser2_ntstatus
This allows the use of GnuTLS for the RC4 crypto operation

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-26 01:48:25 +00:00
Andrew Bartlett
dfda49472e s4:torture: Use init_samr_CryptPassword in test_ChangePasswordUser2
This allows the use of GnuTLS for the RC4 crypto operation

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-26 01:48:25 +00:00
Andreas Schneider
b512b59744 s4:torture: Use GnuTLS RC4 in test_OemChangePasswordUser2
This uses STR_ASCII for password encoding!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:25 +00:00
Andreas Schneider
f45ba47afb s4:torture: Use init_samr_CryptPassword in test_SetUserPass_level_ex
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:25 +00:00
Andreas Schneider
3b9496d905 s4:torture: Use init_samr_CryptPassword in test_SetUserPass_25
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:25 +00:00
Andreas Schneider
e398ecbd8e s4:torture: Use init_samr_CryptPassword in test_SetUserPassEx
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:25 +00:00
Andreas Schneider
b0b9cabc4d s4:torture: Use init_samr_CryptPassword in test_SetUserPass_23
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:25 +00:00
Andreas Schneider
70e05d7eb7 s4:torture: Use init_samr_CryptPassword in test_SetUserPass
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:25 +00:00
Andreas Schneider
80f5beb480 s4:torture: Use init_samr_CryptPassword(Ex) in samba3rpc test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:25 +00:00
Andreas Schneider
811c412da5 s4:torture: Use GnuTLS RC4 for RAP SAM test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:25 +00:00
Andreas Schneider
576bcf6155 libcli:auth: Return WERROR for encode_wkssvc_join_password_buffer()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-26 01:48:24 +00:00
Ralph Boehme
bb37a88e63 s4/torture: add a vfs_fruit unconversion test
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:30 +00:00
Björn Jacke
37b3c6375b torture: fix durable open/alloc-size test
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2019-07-07 21:32:25 +00:00
Christof Schmitt
e1bb3d34d9 smbtorture: Add smb2.ioctl.zero_data
Allow to manually issue the FSCTL_ZERO_DATA call and verify the
state of the file in the file system.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-05 03:33:19 +00:00
Christof Schmitt
aa199696b9 smbtorture: Add smb2.ioctl.sparse_set_sparse
This allows for manual testing of changing the sparse setting on a file
and verifying the flag in the file system.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-05 03:33:19 +00:00
Douglas Bagnall
c6bb0497a0 s4/torture: remove autoidl
This has been turned off by default for 10 years
(since 26e114b83c), and is only interesting for
nostalgia purposes.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-05 01:05:20 +00:00
Isaac Boukris
3700998419 selftest: check for PrimaryGroupId in DC returned group array
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11362

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-03 12:38:13 +00:00
Isaac Boukris
60afe949c3 selftest: remote_pac: s/s2u4self/s4u2self/g
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11362

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-03 12:38:13 +00:00
Tim Beale
dba9987bf5 tests: Add getncchanges test for cross-partition links + TGT
This adds a test-case to highlight a bug in the client side GetNCChanges
handling.

These tests mostly exercise the server-side behaviour of sending the
GetNCChanges, however, there's a bug in the client-side code when we try
to handle a missing cross-partition link target *in combination* with
the GET_TGT flag already having been set.

The test is exercising the client-side code by using the 'samba-tool drs
replicate' command. By adding a one-way link to a deleted target object,
we force the client code to retry with the GET_TGT flag set.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14022

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-02 04:21:36 +00:00
Swen Schillig
3bc973c602 source4: Update all consumers of strtoul_err(), strtoull_err() to new API
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2019-06-30 11:32:18 +00:00
Andreas Schneider
9920aefd4e s4:torture: Use GnuTLS RC4 in rpc forest_trust test
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): Thu Jun 27 14:11:39 UTC 2019 on sn-devel-184
2019-06-27 14:11:39 +00:00
Andreas Schneider
9767013b44 s4:tortue: Use GnuTLS RC4 in rpc lsa test
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-06-27 12:54:24 +00:00
Andreas Schneider
2e6fe27bad libcli:auth: Return NTSTATUS for netlogon_creds_decrypt_samlogon_validation()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-06-27 12:54:23 +00:00