summaryrefslogtreecommitdiff
path: root/source4/torture/raw/open.c
Commit message (Collapse)AuthorAgeFilesLines
* s4-torture: fix truncation warningsUri Simchoni2017-11-241-1/+1
| | | | | | | | Fix various places where there is potential truncation while doing time / size calculations. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4-torture: fix file time checksUri Simchoni2017-11-221-1/+1
| | | | | | | | | NTTIME is an unsigned quantity. When comparing two of them, first calculate a signed difference, then take absolute value. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:raw: fix 'Syscall param writev(vector[...])' valgrind errorNoel Power2016-04-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* s4:torture:raw: fix 'Syscall param writev(vector[...])' valgrind errorNoel Power2016-04-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* s4: torture: Test for incorrect file size returned in the response of ↵Jeremy Allison2015-04-301-0/+102
| | | | | | | | | | | | | "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
* torture: Fix raw.open.chained-ntcreatexVolker Lendecke2014-12-091-2/+2
| | | | | | | | | | | | 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
* torture: Fix raw.open.chained-openxVolker Lendecke2014-11-281-2/+2
| | | | | | | | | | 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
* torture: allow us to correctly use sizeof(buf) in raw.open testsAndrew Bartlett2014-09-081-3/+3
| | | | | | | | | | | | 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>
* torture4: Add a little test that truncate actually works :-)Volker Lendecke2014-06-251-0/+13
| | | | | | | | 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
* s4: torture: Add regression test case for #10671 - Samba file corruption as ↵Jeremy Allison2014-06-251-0/+73
| | | | | | | | | | | | | | | | | | 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>
* s4-torture: Relax time checking in CHECK_NTTIME.Andreas Schneider2013-11-121-1/+1
| | | | | | | | | NTTIME has a nanosecond resolution. We should be tolerate if the system is busy writing and reading the value. To reproduce this problem just run the test under valgrind. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* torture: Fix memcmp of short buffer.Andreas Schneider2013-02-221-2/+2
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s4:torture: fix use of non-existent word (existant)Michael Adam2012-06-121-2/+2
|
* s4-torture: Improve torture test boilerplate, use torture_assert()Andrew Bartlett2012-05-181-48/+16
| | | | | | | | | This ensures that if this fails, it is reported as a subunit error correctly. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri May 18 09:35:13 CEST 2012 on sn-devel-104
* torture: use tevent_ functions names instead of the legacy event_ onesSimo Sorce2011-08-131-2/+2
|
* s4:torture - always cast correctly when using the "%x" format string argumentMatthias Dieter Wallnöfer2011-05-211-5/+5
| | | | Signed-off-by: Metze
* Clean up some const and other compiler warnings.Jeremy Allison2011-05-051-1/+1
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu May 5 00:59:40 CEST 2011 on sn-devel-104
* source4/torture/raw: Fix prototypes for all functions.Jelmer Vernooij2011-03-191-0/+1
|
* s4-smbtorture: Make test names lowercase and dot-separated.Jelmer Vernooij2010-12-111-19/+19
| | | | | | | | This is consistent with the test names used by selftest, should make the names less confusing and easier to integrate with other tools. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Dec 11 04:16:13 CET 2010 on sn-devel-104
* s4:torture/raw/open.c - remove unused variables and fix error handlingMatthias Dieter Wallnöfer2010-05-211-8/+3
|
* s4-torture: using typeof() is not portableAndrew Tridgell2010-03-311-17/+10
| | | | this failed to compile on solaris8 with cc
* s4 torture: Add RAW-OPEN-NTCREATEDIR to test error checking for open ↵Tim Prouty2010-01-071-0/+198
| | | | directories as files
* s4 torture: Convert RAW-OPEN to suite formZach Loafman2009-12-151-81/+99
|
* s4-torture: ran minimal_includes.pl over source4/tortureAndrew Tridgell2009-10-201-5/+0
| | | | This reduces compile time somewhat.
* s4-smb: declare root_fid as a file handleAndrew Tridgell2009-10-151-7/+7
| | | | | | In order to implement root_fid in the s4 SMB server we need to declare it as a handle type, just as for other fnum values in SMB. This required some extensive (but simple) changes in many bits of code.
* s4/torture: Add two new SMB RAW-OPEN testsAravind Srinivasan2009-10-011-1/+170
| | | | | | | | | * Add chained NTCREATEX_READX test which first tries to open/read a non-existant file failing on the open, then attempts the same operation on a file that does exist, opening and reading successfully. * Add test for open_dispositions on directories.
* s4/torture: convert printf to torture_comment() in RAW-OPENAravind Srinivasan2009-10-011-58/+103
| | | | Allows "make test" and other harnesses to print cleaner output.
* Added torture test for doing an openX over a directoryJeremy Allison2008-12-131-0/+47
| | | | | to ensure we get the correct error message. Jeremy.
* Remove unused include param/param.h.Jelmer Vernooij2008-10-241-1/+0
|
* Add test to show you can open for delete a readonly file.Jeremy Allison2008-09-261-0/+59
| | | | Jeremy.
* RAW-OPEN: be more strict in create_option checkingStefan Metzmacher2008-08-141-2/+11
| | | | | metze (This used to be commit d548f5dee5980eae0aea25f1314238eb4f963568)
* expanded the SMB2-CREATE and RAW-OPEN tests to explore more of how theAndrew Tridgell2008-08-141-0/+35
| | | | | create options fields are supposed to work (This used to be commit 0576875eccaa21ad529c9db41db91781ad400d0f)
* Fix RAW-OPEN against Samba3Volker Lendecke2008-07-191-0/+1
| | | | | | | | | | | | This test assumed that fnums are recycled immediately after a close. This is not true on Samba 3. Andrew B., I assume this is just a bug in the test. Assuming recycled fnums might be true on Windows and Samba 4, but I don't think we should assume this everywhere. Volker (This used to be commit a4c3a59d47b2b1c794eda556d252c61907be1b3c)
* More 'must be ignored' options from the MS-SMB doc.Andrew Bartlett2008-07-181-34/+22
| | | | | | | | | | | Also in particular the 'sync' flags (which Samba has traditionally ignored). Thanks to Olivier Salamin <olivier.salamin@gmail.com> for pointing out more flags that needed to be handled. Andrew Bartlett (This used to be commit 370bb39cd79fe49efd36a1ceb3e896d386e6d3ce)
* Ignore and handle more NT Create & X options.Andrew Bartlett2008-07-161-0/+56
| | | | | | | | | | | | | | The MS-SMB document explains that some of these options should be ignored. The test proves it. /* Must be ignored by the server, per MS-SMB 2.2.8 */ /* Must be ignored by the server, per MS-SMB 2.2.8 */ If we implement HSM in samba4 (likely) we should honour this bit. /* Don't pull this file off tape in a HSM system */ Andrew Bartlett (This used to be commit 502739ff90d56d2c9aabe8e224317f6ceb175c17)
* Remove event context tracking from the credentials struct.Jelmer Vernooij2008-04-171-6/+4
| | | | (This used to be commit 4d7fc946b2ec50e774689c9036423b6feef99b8e)
* Install public header files again and include required prototypes.Jelmer Vernooij2008-04-021-0/+1
| | | | (This used to be commit 47ffbbf67435904754469544390b67d34c958343)
* this is in secondsAndrew Tridgell2008-01-251-3/+2
| | | | (This used to be commit 019dd9a3d7d9af8ab71a10802c728f5ab5cf781d)
* r26249: Remove a couple more uses of global_loadparm.Jelmer Vernooij2007-12-211-2/+2
| | | | (This used to be commit 80a61200508a00d5b16a3e748ce92d54b9fefcd2)
* r26238: Add a loadparm context parameter to torture_context, remove more ↵Jelmer Vernooij2007-12-211-90/+90
| | | | | | uses of global_loadparm. (This used to be commit a33a5530545086b81a3b205aa109dff11c546926)
* r25554: Convert last instances of BOOL, True and False to the standard types.Jelmer Vernooij2007-10-101-110/+110
| | | | (This used to be commit 566aa14139510788548a874e9213d91317f83ca9)
* r25430: Add the loadparm context to all parametric options.Jelmer Vernooij2007-10-101-4/+4
| | | | (This used to be commit fd697d77c9fe67a00939a1f04b35c451316fff58)
* r25035: Fix some more warnings, use service pointer rather than service ↵Jelmer Vernooij2007-10-101-4/+4
| | | | | | number in more places. (This used to be commit df9cebcb97e20564359097148665bd519f31bc6f)
* r25026: Move param/param.h out of includes.hJelmer Vernooij2007-10-101-0/+1
| | | | (This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31)
* r24735: Use torture API in more places.Jelmer Vernooij2007-10-101-24/+14
| | | | (This used to be commit 1319d88c099496be29dd9214fa2492c81e848369)
* r23792: convert Samba4 to GPLv3Andrew Tridgell2007-10-101-3/+2
| | | | | | There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa)
* r22969: fix some more places where we could end up with more than one eventAndrew Tridgell2007-10-101-1/+3
| | | | | | context. We now have an event context on the torture_context, and we can also get one from the cli_credentials structure (This used to be commit c0f65eb6562e13530337c23e3447a6aa6eb8fc17)
* r20497: Two changes to RAW-OPEN that Samba does not fulfil:Volker Lendecke2007-10-101-5/+25
| | | | | | | | | | Samba3 returns the SPARSE flag for files with size > allocation, and on many configs Samba3 does not support EAs. Cope with both. Tridge, please check this is acceptable for this test. Volker (This used to be commit 4df4d37c3d4d9e6c430afd36e88684f02c73700e)
* r18103: add torture test for 'RAW_OPEN_OPENX without a leading slash on the ↵Derrell Lipman2007-10-101-0/+46
| | | | | | path', known to fail on NetApp filers (This used to be commit 9a8c7b0a7673c36a8a48a28ea7ea21caf0c521fa)
* r16907: Add an index parameter to torture_open_connection. Next step is to ↵Volker Lendecke2007-10-101-1/+1
| | | | | | | | | | enable the unclist parameter for all tests that do two connections, to enable cluster testing. Volker (This used to be commit a5d6db09244d444986f8fded3fc6e72c74c8ca1f)