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

814 Commits

Author SHA1 Message Date
Jeremy Allison
747de99fcd s4: torture: Added raw readX test to ensure 'reserved' fields are zero.
Passes against Win2k12+, and smbd with the previous patch.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Sat Jun 18 19:32:22 CEST 2016 on sn-devel-144
2016-06-18 19:32:22 +02:00
Noel Power
cd7c57c85d s4:torture:raw: fix 'Invalid read of size 1 & Conditional jump or move' errors.
smbtorture test raw.offline.offline generates the following valgrind trace(s).

==5130==    at 0x2223AF: loadfile_callback (offline.c:107)
==5130==    by 0x5AF73E6: loadfile_handler (loadfile.c:208)
==5130==    by 0x5ADFEE0: smbcli_request_done (clitransport.c:395)
==5130==    by 0xF676EEE: tevent_common_loop_timer_delay (in /usr/lib64/libtevent.so.0.9.26)
==5130==    by 0xF677EF9: ??? (in /usr/lib64/libtevent.so.0.9.26)
==5130==    by 0xF6765F6: ??? (in /usr/lib64/libtevent.so.0.9.26)
==5130==    by 0xF6727FC: _tevent_loop_once (in /usr/lib64/libtevent.so.0.9.26)
==5130==    by 0x223A16: torture_test_offline (offline.c:493)
==5130==    by 0x9553F62: wrap_simple_test (torture.c:632)
==5130==    by 0x955368F: internal_torture_run_test (torture.c:442)
==5130==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==5130==    by 0x260121: run_matching (smbtorture.c:110)
==5130==    by 0x25FFE3: run_matching (smbtorture.c:95)
==5130==    by 0x260242: torture_run_named_tests (smbtorture.c:143)
==5130==    by 0x261EC1: main (smbtorture.c:665)
==5130==  Address 0x188b80d0 is 96 bytes inside a block of size 8,288 free'd
==5130==    at 0x4C2A37C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==5130==    by 0xF4673A3: ??? (in /usr/lib64/libtalloc.so.2.1.5)
==5130==    by 0xF460E42: _talloc_free (in /usr/lib64/libtalloc.so.2.1.5)
==5130==    by 0x5AF7635: smb_composite_loadfile_recv (loadfile.c:278)
==5130==    by 0x2222F7: loadfile_callback (offline.c:91)
==5130==    by 0x5AF73E6: loadfile_handler (loadfile.c:208)
==5130==    by 0x5ADFEE0: smbcli_request_done (clitransport.c:395)
==5130==    by 0xF676EEE: tevent_common_loop_timer_delay (in /usr/lib64/libtevent.so.0.9.26)
==5130==    by 0xF677EF9: ??? (in /usr/lib64/libtevent.so.0.9.26)
==5130==    by 0xF6765F6: ??? (in /usr/lib64/libtevent.so.0.9.26)
==5130==    by 0xF6727FC: _tevent_loop_once (in /usr/lib64/libtevent.so.0.9.26)
==5130==    by 0x223A16: torture_test_offline (offline.c:493)
==5130==    by 0x9553F62: wrap_simple_test (torture.c:632)
==5130==    by 0x955368F: internal_torture_run_test (torture.c:442)
==5130==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==5130==    by 0x260121: run_matching (smbtorture.c:110)
==5130==    by 0x25FFE3: run_matching (smbtorture.c:95)
==5130==    by 0x260242: torture_run_named_tests (smbtorture.c:143)
==5130==    by 0x261EC1: main (smbtorture.c:665)
==5130==

AND

==5428== Conditional jump or move depends on uninitialised value(s)
==5428==    at 0x22270E: getoffline_callback (offline.c:197)
==5428==    by 0x5ADFEE0: smbcli_request_done (clitransport.c:395)
==5428==    by 0xF676EEE: tevent_common_loop_timer_delay (in /usr/lib64/libtevent.so.0.9.26)
==5428==    by 0xF677EF9: ??? (in /usr/lib64/libtevent.so.0.9.26)
==5428==    by 0xF6765F6: ??? (in /usr/lib64/libtevent.so.0.9.26)
==5428==    by 0xF6727FC: _tevent_loop_once (in /usr/lib64/libtevent.so.0.9.26)
==5428==    by 0x223A1B: torture_test_offline (offline.c:494)
==5428==    by 0x9553F62: wrap_simple_test (torture.c:632)
==5428==    by 0x955368F: internal_torture_run_test (torture.c:442)
==5428==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==5428==    by 0x260126: run_matching (smbtorture.c:110)
==5428==    by 0x25FFE8: run_matching (smbtorture.c:95)
==5428==    by 0x260247: torture_run_named_tests (smbtorture.c:143)
==5428==    by 0x261EC6: main (smbtorture.c:665)
==5428==

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-25 10:35:15 +02:00
Noel Power
bb0c4a95df s4:torture:raw: fix 'Conditional jump or move' valgrind error.
smbtorture test raw.bench-tcon.bench-tcon produces the following valgrind
trace

==32163== Conditional jump or move depends on uninitialised value(s)
==32163==    at 0x1F9D61: rate_convert_secs (tconrate.c:149)
==32163==    by 0x1FA04C: torture_bench_treeconnect (tconrate.c:189)
==32163==    by 0x9553F62: wrap_simple_test (torture.c:632)
==32163==    by 0x955368F: internal_torture_run_test (torture.c:442)
==32163==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==32163==    by 0x260121: run_matching (smbtorture.c:110)
==32163==    by 0x25FFE3: run_matching (smbtorture.c:95)
==32163==    by 0x260242: torture_run_named_tests (smbtorture.c:143)
==32163==    by 0x261EC1: main (smbtorture.c:665)
==32163==
==32163== Use of uninitialised value of size 8
==32163==    at 0xFB0B0BB: _itoa_word (in /lib64/libc-2.19.so)
==32163==    by 0xFB0EAD2: vfprintf (in /lib64/libc-2.19.so)
==32163==    by 0xFB15598: printf (in /lib64/libc-2.19.so)
==32163==    by 0x1FA064: torture_bench_treeconnect (tconrate.c:188)
==32163==    by 0x9553F62: wrap_simple_test (torture.c:632)
==32163==    by 0x955368F: internal_torture_run_test (torture.c:442)
==32163==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==32163==    by 0x260121: run_matching (smbtorture.c:110)
==32163==    by 0x25FFE3: run_matching (smbtorture.c:95)
==32163==    by 0x260242: torture_run_named_tests (smbtorture.c:143)
==32163==    by 0x261EC1: main (smbtorture.c:665)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-25 10:35:15 +02:00
Noel Power
04d70f5206 s4:torture:raw: fix 'use of uninitialised value of size 8' valgrind errors
smbtorture test raw.acls.create_file.create_file produces the following
valgrind trace

==31783== Use of uninitialised value of size 8
==31783==    at 0xFB0B061: _itoa_word (in /lib64/libc-2.19.so)
==31783==    by 0xFB0EAD2: vfprintf (in /lib64/libc-2.19.so)
==31783==    by 0xFB36712: vasprintf (in /lib64/libc-2.19.so)
==31783==    by 0xAEBB348: ndr_print_debug_helper (ndr.c:314)
==31783==    by 0xAEB8ED1: ndr_print_uint16 (ndr_basic.c:1055)
==31783==    by 0x3E591A: ndr_print_security_ace (ndr_security.c:539)
==31783==    by 0x3E621A: ndr_print_security_acl (ndr_security.c:642)
==31783==    by 0x3E7A3F: ndr_print_security_descriptor (ndr_security.c:890)
==31783==    by 0xAEBB860: ndr_print_debug (ndr.c:409)
==31783==    by 0x20C91F: verify_sd (acls.c:89)
==31783==    by 0x20D8C3: test_nttrans_create_ext (acls.c:306)
==31783==    by 0x20E3A8: test_nttrans_create_file (acls.c:381)
==31783==    by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856)
==31783==    by 0x955368F: internal_torture_run_test (torture.c:442)
==31783==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==31783==    by 0x260108: run_matching (smbtorture.c:110)
==31783==    by 0x25FFCA: run_matching (smbtorture.c:95)
==31783==    by 0x25FFCA: run_matching (smbtorture.c:95)
==31783==    by 0x260229: torture_run_named_tests (smbtorture.c:143)
==31783==    by 0x261EA8: main (smbtorture.c:665)
==31783==
==31783== Conditional jump or move depends on uninitialised value(s)
==31783==    at 0xFB0B068: _itoa_word (in /lib64/libc-2.19.so)
==31783==    by 0xFB0EAD2: vfprintf (in /lib64/libc-2.19.so)
==31783==    by 0xFB36712: vasprintf (in /lib64/libc-2.19.so)
==31783==    by 0xAEBB348: ndr_print_debug_helper (ndr.c:314)
==31783==    by 0xAEB8ED1: ndr_print_uint16 (ndr_basic.c:1055)
==31783==    by 0x3E591A: ndr_print_security_ace (ndr_security.c:539)
==31783==    by 0x3E621A: ndr_print_security_acl (ndr_security.c:642)
==31783==    by 0x3E7A3F: ndr_print_security_descriptor (ndr_security.c:890)
==31783==    by 0xAEBB860: ndr_print_debug (ndr.c:409)
==31783==    by 0x20C91F: verify_sd (acls.c:89)
==31783==    by 0x20D8C3: test_nttrans_create_ext (acls.c:306)
==31783==    by 0x20E3A8: test_nttrans_create_file (acls.c:381)
==31783==    by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856)
==31783==    by 0x955368F: internal_torture_run_test (torture.c:442)
==31783==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==31783==    by 0x260108: run_matching (smbtorture.c:110)
==31783==    by 0x25FFCA: run_matching (smbtorture.c:95)
==31783==    by 0x25FFCA: run_matching (smbtorture.c:95)
==31783==    by 0x260229: torture_run_named_tests (smbtorture.c:143)
==31783==    by 0x261EA8: main (smbtorture.c:665)
==31783==

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-25 10:35:15 +02:00
Noel Power
de590daa1c s4:torture:raw: fix 'Syscall param writev(vector[...])' valgrind error
running smbtorture test raw.streams.createdisp.createdisp results in
the following valgrind trace

==30946== Syscall param writev(vector[...]) points to uninitialised byte(s)
==30946==    at 0xFBA2C87: writev (in /lib64/libc-2.19.so)
==30946==    by 0x106CB033: writev_handler (async_sock.c:340)
==30946==    by 0xF67812A: ??? (in /usr/lib64/libtevent.so.0.9.26)
==30946==    by 0xF6765F6: ??? (in /usr/lib64/libtevent.so.0.9.26)
==30946==    by 0xF6727FC: _tevent_loop_once (in /usr/lib64/libtevent.so.0.9.26)
==30946==    by 0x5AE3400: smbcli_request_receive (rawrequest.c:416)
==30946==    by 0x5AE343E: smbcli_request_simple_recv (rawrequest.c:430)
==30946==    by 0x5ADC8BC: smb_raw_close (rawfile.c:847)
==30946==    by 0x9BE60B4: smbcli_close (clifile.c:316)
==30946==    by 0x209F0D: create_file_with_stream (streams.c:1502)
==30946==    by 0x20A072: test_stream_create_disposition (streams.c:1527)
==30946==    by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856)
==30946==    by 0x955368F: internal_torture_run_test (torture.c:442)
==30946==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==30946==    by 0x2600D6: run_matching (smbtorture.c:110)
==30946==    by 0x25FF98: run_matching (smbtorture.c:95)
==30946==    by 0x25FF98: run_matching (smbtorture.c:95)
==30946==    by 0x2601F7: torture_run_named_tests (smbtorture.c:143)
==30946==    by 0x261E76: main (smbtorture.c:665)
==30946==  Address 0x187ebbc6 is 598 bytes inside a block of size 1,325 alloc'd
==30946==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==30946==    by 0xF464A73: _talloc_pooled_object (in /usr/lib64/libtalloc.so.2.1.5)
==30946==    by 0xF67366D: _tevent_req_create (in /usr/lib64/libtevent.so.0.9.26)
==30946==    by 0xB0D49FF: smb1cli_req_create (smbXcli_base.c:1322)
==30946==    by 0x5ADFAB7: smbcli_transport_setup_subreq (clitransport.c:254)
==30946==    by 0x5ADFC37: smbcli_transport_send (clitransport.c:326)
==30946==    by 0x5AE33C3: smbcli_request_send (rawrequest.c:400)
==30946==    by 0x5ADC869: smb_raw_close_send (rawfile.c:832)
==30946==    by 0x5ADC8AC: smb_raw_close (rawfile.c:846)
==30946==    by 0x9BE60B4: smbcli_close (clifile.c:316)
==30946==    by 0x209F0D: create_file_with_stream (streams.c:1502)
==30946==    by 0x20A072: test_stream_create_disposition (streams.c:1527)
==30946==    by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856)
==30946==    by 0x955368F: internal_torture_run_test (torture.c:442)
==30946==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==30946==    by 0x2600D6: run_matching (smbtorture.c:110)
==30946==    by 0x25FF98: run_matching (smbtorture.c:95)
==30946==    by 0x25FF98: run_matching (smbtorture.c:95)
==30946==    by 0x2601F7: torture_run_named_tests (smbtorture.c:143)
==30946==    by 0x261E76: main (smbtorture.c:665

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-25 10:35:15 +02:00
Noel Power
a22ccb04a0 s4:torture:raw: fix 'Syscall param writev(vector[...])' valgrind error
running smbtorture test raw.open.openx-over-dir.openx-over-dir results in
the following valgrind trace

==30597== Syscall param writev(vector[...]) points to uninitialised byte(s)
==30597==    at 0xFBA2C87: writev (in /lib64/libc-2.19.so)
==30597==    by 0x106CB033: writev_handler (async_sock.c:340)
==30597==    by 0xF67812A: ??? (in /usr/lib64/libtevent.so.0.9.26)
==30597==    by 0xF6765F6: ??? (in /usr/lib64/libtevent.so.0.9.26)
==30597==    by 0xF6727FC: _tevent_loop_once (in /usr/lib64/libtevent.so.0.9.26)
==30597==    by 0x5AE3400: smbcli_request_receive (rawrequest.c:416)
==30597==    by 0x5AE343E: smbcli_request_simple_recv (rawrequest.c:430)
==30597==    by 0x5ADC8BC: smb_raw_close (rawfile.c:847)
==30597==    by 0x9BE60B4: smbcli_close (clifile.c:316)
==30597==    by 0x1A57F0: test_openx_over_dir (open.c:1495)
==30597==    by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856)
==30597==    by 0x955368F: internal_torture_run_test (torture.c:442)
==30597==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==30597==    by 0x2600BD: run_matching (smbtorture.c:110)
==30597==    by 0x25FF7F: run_matching (smbtorture.c:95)
==30597==    by 0x25FF7F: run_matching (smbtorture.c:95)
==30597==    by 0x2601DE: torture_run_named_tests (smbtorture.c:143)
==30597==    by 0x261E5D: main (smbtorture.c:665)
==30597==  Address 0x187e41d6 is 598 bytes inside a block of size 1,325 alloc'd
==30597==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==30597==    by 0xF464A73: _talloc_pooled_object (in /usr/lib64/libtalloc.so.2.1.5)
==30597==    by 0xF67366D: _tevent_req_create (in /usr/lib64/libtevent.so.0.9.26)
==30597==    by 0xB0D49FF: smb1cli_req_create (smbXcli_base.c:1322)
==30597==    by 0x5ADFAB7: smbcli_transport_setup_subreq (clitransport.c:254)
==30597==    by 0x5ADFC37: smbcli_transport_send (clitransport.c:326)
==30597==    by 0x5AE33C3: smbcli_request_send (rawrequest.c:400)
==30597==    by 0x5ADC869: smb_raw_close_send (rawfile.c:832)
==30597==    by 0x5ADC8AC: smb_raw_close (rawfile.c:846)
==30597==    by 0x9BE60B4: smbcli_close (clifile.c:316)
==30597==    by 0x1A57F0: test_openx_over_dir (open.c:1495)
==30597==    by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856)
==30597==    by 0x955368F: internal_torture_run_test (torture.c:442)
==30597==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==30597==    by 0x2600BD: run_matching (smbtorture.c:110)
==30597==    by 0x25FF7F: run_matching (smbtorture.c:95)
==30597==    by 0x25FF7F: run_matching (smbtorture.c:95)
==30597==    by 0x2601DE: torture_run_named_tests (smbtorture.c:143)
==30597==    by 0x261E5D: main (smbtorture.c:665)
==30597==

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-25 10:35:15 +02:00
Noel Power
2a06c992c8 s4:torture:raw: fix 'Syscall param writev(vector[...])' valgrind error
running smbtorture test raw.open.chained-ntcreatex.chained-ntcreatex results
in the following valgrind trace

==30405== Syscall param writev(vector[...]) points to uninitialised byte(s)
==30405==    at 0xFBA2C87: writev (in /lib64/libc-2.19.so)
==30405==    by 0x106CB033: writev_handler (async_sock.c:340)
==30405==    by 0xF67812A: ??? (in /usr/lib64/libtevent.so.0.9.26)
==30405==    by 0xF6765F6: ??? (in /usr/lib64/libtevent.so.0.9.26)
==30405==    by 0xF6727FC: _tevent_loop_once (in /usr/lib64/libtevent.so.0.9.26)
==30405==    by 0x5AE3400: smbcli_request_receive (rawrequest.c:416)
==30405==    by 0x5AE343E: smbcli_request_simple_recv (rawrequest.c:430)
==30405==    by 0x5ADC8BC: smb_raw_close (rawfile.c:847)
==30405==    by 0x9BE60B4: smbcli_close (clifile.c:316)
==30405==    by 0x1A66B4: test_chained_ntcreatex_readx (open.c:1735)
==30405==    by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856)
==30405==    by 0x955368F: internal_torture_run_test (torture.c:442)
==30405==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==30405==    by 0x2600A4: run_matching (smbtorture.c:110)
==30405==    by 0x25FF66: run_matching (smbtorture.c:95)
==30405==    by 0x25FF66: run_matching (smbtorture.c:95)
==30405==    by 0x2601C5: torture_run_named_tests (smbtorture.c:143)
==30405==    by 0x261E44: main (smbtorture.c:665)
==30405==  Address 0x187e1196 is 598 bytes inside a block of size 1,325 alloc'd
==30405==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==30405==    by 0xF464A73: _talloc_pooled_object (in /usr/lib64/libtalloc.so.2.1.5)
==30405==    by 0xF67366D: _tevent_req_create (in /usr/lib64/libtevent.so.0.9.26)
==30405==    by 0xB0D49FF: smb1cli_req_create (smbXcli_base.c:1322)
==30405==    by 0x5ADFAB7: smbcli_transport_setup_subreq (clitransport.c:254)
==30405==    by 0x5ADFC37: smbcli_transport_send (clitransport.c:326)
==30405==    by 0x5AE33C3: smbcli_request_send (rawrequest.c:400)
==30405==    by 0x5ADC869: smb_raw_close_send (rawfile.c:832)
==30405==    by 0x5ADC8AC: smb_raw_close (rawfile.c:846)
==30405==    by 0x9BE60B4: smbcli_close (clifile.c:316)
==30405==    by 0x1A66B4: test_chained_ntcreatex_readx (open.c:1735)
==30405==    by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856)
==30405==    by 0x955368F: internal_torture_run_test (torture.c:442)
==30405==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==30405==    by 0x2600A4: run_matching (smbtorture.c:110)
==30405==    by 0x25FF66: run_matching (smbtorture.c:95)
==30405==    by 0x25FF66: run_matching (smbtorture.c:95)
==30405==    by 0x2601C5: torture_run_named_tests (smbtorture.c:143)
==30405==    by 0x261E44: main (smbtorture.c:665)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-25 10:35:15 +02:00
Stefan Metzmacher
bbb066a12a CVE-2016-2111: s4:torture/raw: don't use ntlmv2 for dos connection in raw.samba3badpath
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11749

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2016-04-12 19:25:24 +02:00
Günther Deschner
5544756733 s4-torture: fix gcc6 build warning.
source4/torture/raw/eas.c:322:17: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:18 +01:00
Jelmer Vernooij
512d15de56 Make libcli-smb-raw private, for now.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Stefan Metzmacher <metze@samba.org>
2016-01-13 04:43:23 +01:00
Mathieu Parent
c315fce17e Fix various spelling errors
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov  6 13:43:45 CET 2015 on sn-devel-104
2015-11-06 13:43:45 +01:00
Jeremy Allison
e4054f2118 s3-torture: Remove (incorrect) samba3-specific behavior in samba3.raw.unlink now the server is correct
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11452

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-10-21 08:25:26 +02:00
Volker Lendecke
893484602d torture-notify: Give nonrecursive updates 200ms
This is in line with the recursive updates before.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jul 13 15:00:26 CEST 2015 on sn-devel-104
2015-07-13 15:00:25 +02:00
Jeremy Allison
9d7ecb9fc3 s4: torture: Test for incorrect file size returned in the response of "FILE_SUPERSEDE Create".
https://bugzilla.samba.org/show_bug.cgi?id=11240

Signed-off-by: Kenny Dinh <kdinh@peaxy.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 30 22:12:22 CEST 2015 on sn-devel-104
2015-04-30 22:12:22 +02:00
Günther Deschner
9842a5d1d2 s4-torture: use torture_comment instead of printf in raw notify test.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-30 13:41:26 +02:00
Günther Deschner
c6f18b9535 s4-torture: use tctx variable name in raw notify test consistently.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
b3a688c1b7 s4:torture:raw:notify: torture_assert on creation of secondary tcon
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
65504bc8e4 s4:torture:raw:notify: use torture_assert instead of printf in test_notify_tree
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
8e4d1463cb s4:torture:raw:notify: let NOTIFY_MASK_TEST use torture_assert macros
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
cf2f75ca4a s4:torture:raw:notify: remove extra do-loop in NOTIFY_MASK_TEST macro.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
0aebd5f0fe s4:torture:raw:notify: use torture_assert instead of printf in failure case
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
60b7a6057d s4:torture:raw:notify: remove superfluous conditional goto
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
967a0cdbeb s4:torture:raw:notify: treat torture_open_connection calls with torture_assert
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
47d75aa1e5 s4:torture:raw:notify: use torture_assert with torture_setup_dir
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
1529f44ae3 s4:torture:raw:notify: add a few comments to torture_assert calls
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
1b305c8a35 s4:torture:raw:notify: improve the CHECK_WSTR() macro
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
17ce9f428c s4:torture:raw:notify: make check_rename_reply() properly use torture_result
Only change currently: the CHECK_WSTR calls report the line
number of this function now instead of the handed in
line of the callers. This could be fixed by turning this
function into a macro...

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
d9e01f1d77 s4:torture:raw:notify: remove CHECK_WSTR2.
The original CHECK_WSTR() macro was not setting torture failure,
leading to errors instead of propoer failures.

The original CHECK_WSTR2() macro was exactly like the CHECK_WSTR
macro but using propoer torture_result() calls.

This patch removes the original CHECK_WSTR(), renames CHECK_WSTR2
to CHECK_WSTR and adapts the callers, hence removing the source
of many potential missing torture_assert messages.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
8d1d1e0f06 s4:torture:raw:notify: remove CHECK_VAL.
This macro is not setting torture failure, leading to errors instead
of failures. Use torture_assert_ntstatus_(ok|equal)* macros.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
f0a113a06e s4:torture:raw:notify: remove CHECK_STATUS.
This macro is not setting torture failure, leading to errors instead
of failures. Use torture_assert_ntstatus_(ok|equal)* macros.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-30 13:41:26 +02:00
Michael Adam
b92d51f98c s4:torture: avoid free of uninitialized variables in error-case.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-03-23 16:04:19 +01:00
Stefan Metzmacher
116e3ef23c s4:torture/raw: avoid compiler warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-20 20:43:13 +01:00
Volker Lendecke
8c56989325 torture: Fix raw.open.chained-ntcreatex
sizeof(buf) is 5. On FreeBSD10/clang this overwrites "ret". Not good.

Same as 574750777a

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 Dec  9 19:43:31 CET 2014 on sn-devel-104
2014-12-09 19:43:31 +01:00
Volker Lendecke
574750777a torture: Fix raw.open.chained-openx
sizeof(buf) is 5. On FreeBSD10/clang this overwrites "ret". Not good.

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): Fri Nov 28 13:30:18 CET 2014 on sn-devel-104
2014-11-28 13:30:18 +01:00
Jeremy Allison
8db5150143 s4:torture: Add smb2.oplock test batch9a and raw.oplock test batch9a
Shows attribute(stat) access open can create a file,
and subsequent attribute(stat) opens don't break oplocks.

Can be extended to explore more varients.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-11-07 20:13:09 +01:00
Andrew Bartlett
01d4c0e804 torture: Provide enough space for test EA name in raw.eas test
The issue is that previously bad_ea_name[5] was the last element on
the array, and so when we later did a strlen() on it, we read past the
end of the stack array.  We need bad_ea_name[5] to be the second-last
element, followed by the \0 placed there by the strlcpy().

Found by AddressSanitizer

Change-Id: I871c08200aa2591c612dfa44da92b83132f83d88
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Sep 11 08:50:16 CEST 2014 on sn-devel-104
2014-09-11 08:50:16 +02:00
Andrew Bartlett
e93affbe1b torture: allow us to correctly use sizeof(buf) in raw.open tests
This changes the sizeof(buf) from sizeof(void *), 8 on 64-bit machines, to sizeof("test") (eg 5).

Found by AddressSanitizer

Andrew Bartlett

Change-Id: I01f18b35c041f3b16be9f6da8ae5d1917d7e24d9
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
2014-09-08 07:26:34 +02:00
Christof Schmitt
f796694aaa torture: Use torture_assert macro for value check in raw.read
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-30 00:27:13 +02:00
Christof Schmitt
d29362e85e torture: Use torture_assert macro for status check in raw.read
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-30 00:27:13 +02:00
Christof Schmitt
ba8bc46c46 torture: Use torture_fail macro in check_buffer for read requests
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-30 00:27:13 +02:00
Christof Schmitt
61dbb57475 torture: Add test for 16 bit alignment of readx data
MS-CIFS requires a one byte pad to guarantee 16 bit alignment of the
data:

Pad (1 byte): This field is optional. When using the NT LAN Manager
dialect, this field can be used to align the Data field to a 16-bit
boundary relative to the start of the SMB Header. If Unicode strings are
being used, this field MUST be present. When used, this field MUST be
one padding byte long.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-30 00:27:13 +02:00
Jeremy Allison
c324b9f03f s4: torture: Add a new lock test to show that the Samba SMB1 multi-lock implementation is (currently) correct.
Needed as there was a proposal to re-architect
our multi-lock to dispense with lock order precedence,
which isn't how Windows does it (unfortunately,
as the new code would have been cleaner :-).
Tested against the Win2k12 SMB1 implementation.

This test is designed to show that
lock precedence on the server is based
on the order received, not on the ability
to grant. For example:

A blocked lock request containing 2 locks
will be satified before a subsequent blocked
lock request over one of the same regions,
even if that region is then unlocked. E.g.

(a) lock 100->109, 120->129 (granted)
(b) lock 100->109, 120-129 (blocks)
(c) lock 100->109          (blocks)
(d) unlock 100->109

lock (c) will not be granted as lock (b)
will take precedence.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul  8 10:16:59 CEST 2014 on sn-devel-104
2014-07-08 10:16:59 +02:00
Volker Lendecke
0c97b7eb53 torture4: Make raw.lock.multilock fail after 20 seconds
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): Fri Jul  4 00:04:10 CEST 2014 on sn-devel-104
2014-07-04 00:04:10 +02:00
Volker Lendecke
4205463ef1 torture4: Adapt comment to code
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-03 21:41:12 +02:00
Jeremy Allison
64346a134d s4: smbtorture: Add multi-lock test. Regression test for bug #10684.
Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2014-07-03 21:41:12 +02:00
Volker Lendecke
8fa0cde05f torture4: Add a little test that truncate actually works :-)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Jun 25 13:37:24 CEST 2014 on sn-devel-104
2014-06-25 13:37:24 +02:00
Jeremy Allison
c4f7c02137 s4: torture: Add regression test case for #10671 - Samba file corruption as a result of failed lock check.
Adds a new test to raw.open.

Opens a file with SHARE_NONE, writes 1 byte at offset 1023,
attempts a second open with r/w access+truncate disposition,
then checks that open fails with SHARING_VIOLATION, and
the file is not truncated (is still size 1024). Correctly
detects the bug and fixed smbd for me.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-06-25 11:22:12 +02:00
Andrew Bartlett
dbe07a49c7 torture: convert raw.mux to use torture_comment() macros instead of printf()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:13 +02:00
Andrew Bartlett
794eb404e7 torture: convert raw.mux to use torture_assert() macros
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:13 +02:00
Andrew Bartlett
567e0a88db torture: convert CHECK_STATUS into torture_assert_ntstatus_equal in raw.mux tests
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:13 +02:00