1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00

39 Commits

Author SHA1 Message Date
Noel Power
1ae19203e2 s4:torture:smb2: fix Use of 'uninitialised value of size 8' valgrind error.
smbtorture test smb2.create.aclfile.aclfile produces the following
valgrind trace

==6025== Use of uninitialised value of size 8
==6025==    at 0xFB0B061: _itoa_word (in /lib64/libc-2.19.so)
==6025==    by 0xFB0EAD2: vfprintf (in /lib64/libc-2.19.so)
==6025==    by 0xFB36712: vasprintf (in /lib64/libc-2.19.so)
==6025==    by 0xAEBB348: ndr_print_debug_helper (ndr.c:314)
==6025==    by 0xAEB8ED1: ndr_print_uint16 (ndr_basic.c:1055)
==6025==    by 0x3E5951: ndr_print_security_ace (ndr_security.c:539)
==6025==    by 0x3E6251: ndr_print_security_acl (ndr_security.c:642)
==6025==    by 0x3E7A76: ndr_print_security_descriptor (ndr_security.c:890)
==6025==    by 0xAEBB860: ndr_print_debug (ndr.c:409)
==6025==    by 0x45FCB6: smb2_util_verify_sd (util.c:598)
==6025==    by 0x502246: test_create_acl_ext (create.c:634)
==6025==    by 0x506E13: test_create_acl_file (create.c:1232)
==6025==    by 0x48B420: wrap_simple_1smb2_test (smb2.c:52)
==6025==    by 0x955368F: internal_torture_run_test (torture.c:442)
==6025==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==6025==    by 0x26013F: run_matching (smbtorture.c:110)
==6025==    by 0x260001: run_matching (smbtorture.c:95)
==6025==    by 0x260001: run_matching (smbtorture.c:95)
==6025==    by 0x260260: torture_run_named_tests (smbtorture.c:143)
==6025==    by 0x261EDF: main (smbtorture.c:665)
==6025==
==6025== Conditional jump or move depends on uninitialised value(s)
==6025==    at 0xFB0B068: _itoa_word (in /lib64/libc-2.19.so)
==6025==    by 0xFB0EAD2: vfprintf (in /lib64/libc-2.19.so)
==6025==    by 0xFB36712: vasprintf (in /lib64/libc-2.19.so)
==6025==    by 0xAEBB348: ndr_print_debug_helper (ndr.c:314)
==6025==    by 0xAEB8ED1: ndr_print_uint16 (ndr_basic.c:1055)
==6025==    by 0x3E5951: ndr_print_security_ace (ndr_security.c:539)
==6025==    by 0x3E6251: ndr_print_security_acl (ndr_security.c:642)
==6025==    by 0x3E7A76: ndr_print_security_descriptor (ndr_security.c:890)
==6025==    by 0xAEBB860: ndr_print_debug (ndr.c:409)
==6025==    by 0x45FCB6: smb2_util_verify_sd (util.c:598)
==6025==    by 0x502246: test_create_acl_ext (create.c:634)
==6025==    by 0x506E13: test_create_acl_file (create.c:1232)
==6025==    by 0x48B420: wrap_simple_1smb2_test (smb2.c:52)
==6025==    by 0x955368F: internal_torture_run_test (torture.c:442)
==6025==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==6025==    by 0x26013F: run_matching (smbtorture.c:110)
==6025==    by 0x260001: run_matching (smbtorture.c:95)
==6025==    by 0x260001: run_matching (smbtorture.c:95)
==6025==    by 0x260260: torture_run_named_tests (smbtorture.c:143)
==6025==    by 0x261EDF: main (smbtorture.c:665)
==6025==

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
Ralph Boehme
cd86f20e24 s4:torture: add SMB2 test for directory creation initial allocation size
Test that directory creation with an initial allocation size > 0
succeeds.

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

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

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sun Jan 24 01:20:52 CET 2016 on sn-devel-144
2016-01-24 01:20:52 +01:00
Jeremy Allison
969d043596 s4: torture: Test mkdir race condition.
Found by Max of LoadDynamix <adx.forum@gmail.com>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 24 06:13:22 CEST 2015 on sn-devel-104
2015-09-24 06:13:22 +02:00
Jeremy Allison
937d35bd18 s4: torture : Add test case to show that a bad impersonation level causes an error on a regular file open.
An invalid impersonation level is only allowed for durable handle reopen.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 18 09:42:43 CEST 2014 on sn-devel-104
2014-06-18 09:42:42 +02:00
Andreas Schneider
4cf8f10500 s4-torture: Relax time checking in CHECK_NTTIME.
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>
2013-11-12 17:33:12 +01:00
Andreas Schneider
702049ef55 torture: Fix smb2.create.blob test.
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Nov  9 14:53:27 CET 2012 on sn-devel-104
2012-11-09 14:53:27 +01:00
Stefan Metzmacher
e6c600aa2c s4:torture/smb2: improve the smb2.create.blob test
metze
2012-09-19 21:21:36 +02:00
Andrew Tridgell
d21f7783f6 torture: don't check the NOINDEXED bit in attribute comparison
this bit is dependent on user settings on the filesystem

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-02-27 07:36:05 +01:00
Simo Sorce
b120c5f288 torture: use tevent_ functions names instead of the legacy event_ ones 2011-08-13 09:54:15 -04:00
Jelmer Vernooij
35fbc7bbda s4-smbtorture: Make test names lowercase and dot-separated.
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
2010-12-11 04:16:13 +01:00
Andrew Tridgell
ca847b593d torture: fixed a valgrind error in SMB2-CREATE
the lock structure had uninitialised elements, so we sent a random
length.

This also adds a 1 byte write, so there is real data that is being
truncated with the 2nd open
2010-09-25 10:38:44 -07:00
Jelmer Vernooij
7da94cc4a6 subunit: Support formatting compatible with upstream subunit, for consistency.
Upstream subunit makes a ":" after commands optional, so I've fixed any
places where we might trigger commands accidently. I've filed a bug
about this in subunit.
2010-04-11 20:57:33 +02:00
Matthias Dieter Wallnöfer
5b824eb17b s4:torture - remove unused variables 2010-04-06 14:54:11 +02:00
Tim Prouty
f717a79eff s4 torture: Add a new torture:hide_on_access_denied parameter
It appears some newer versions of windows return
NT_STATUS_OBJECT_NAME_NOT_FOUND on a createfile when access is denied
rather than NT_STATUS_ACCESS_DENIED.  I'm not sure how this translates
to directory enumeration yet, but for now make this a parameter that
can be checked in the various torture tests.

This also gets RAW-ACLS and SMB2-CREATE passing against win7.
2009-12-07 16:54:17 -08:00
Tim Prouty
f4aa47b5ab s4 torture: win 7 doesn't like the sequential_only flag for directories
Remove it for now
2009-12-07 16:54:16 -08:00
Zack Kirsch
d252d23ff1 s4 torture: Port RAW-ACLS tests to SMB2
- The smblsa calls had to be commented out for now and should be fixed
  later, but they aren't crucial to the test.
- The first two tests from RAW-ACLS were already ported to
  torture_smb2_setinfo() and test_create_acl(). Modifications were
  made similar to the RAW-ACLS changes.
- test_sd_get_set() was ported, but does not pass against XP or Vista;
  it is not added to the SMB2-ACLS test suite.
- printf -> torture_comment / torture_warning / torture_result
2009-12-07 16:54:16 -08:00
Tim Prouty
2738e31674 s4 torture: Move target macros to a common header instead of redefining them in multiple files 2009-12-01 11:12:51 -08:00
Andrew Tridgell
d1efaf39f5 smb2-torture: samba4 allows SEC_FLAG_SECURITY to be used with privileges 2009-10-18 07:13:47 +11:00
Aravind Srinivasan
2f379d70ff s4/torture: Ported SMBv1 RAW-OPEN tests to SMB2-CREATE
Four tests were ported from raw/open.c

One new tests added LEADING-SLASH, which tests that a server provides
the proper error when a relative path is given to a CREATE PDU
with a leading "/".
2009-10-07 14:20:25 -07:00
Aravind Srinivasan
0bff2ced79 s4/torture: convert all printf to torture_comments 2009-10-07 12:18:44 -07:00
Zach Loafman
211e255569 s4 torture: Win7 has a slightly different allowed access mask
Still investigating.
2009-03-17 13:43:28 -07:00
Jelmer Vernooij
23302413b3 Remove unused include param/param.h. 2008-10-24 16:37:56 +02:00
Andrew Tridgell
9a50009430 check error code for zero desired_access in SMB2 create 2008-09-24 18:10:22 -07:00
Stefan Metzmacher
affba1f75c SMB2-CREATE: add a special test for FILE_ATTRIBUTE_ENCRYPTED
Some standalone server (and samba4) doesn't support this.

metze
(This used to be commit 6d8fd4c0089d7e632ec91027a77321aca8c6acc7)
2008-08-14 13:13:52 +02:00
Stefan Metzmacher
d6abf13510 SMB2-CREATE: be more strict in checking file attributes
metze
(This used to be commit ba9d0f6b3c60346df757e7c4c3f5704c0bf26d11)
2008-08-14 13:13:51 +02:00
Stefan Metzmacher
80f2f10839 SMB2-CREATE: be more strict in error checking
metze
(This used to be commit d7d4df78c1de19d0cd7a63daaa2fa0863a243a12)
2008-08-14 13:13:51 +02:00
Andrew Tridgell
336f6810ce expanded the SMB2-CREATE and RAW-OPEN tests to explore more of how the
create options fields are supposed to work
(This used to be commit 0576875eccaa21ad529c9db41db91781ad400d0f)
2008-08-14 17:26:30 +10:00
Andrew Tridgell
523a0fccf3 check maximal_access here too
(This used to be commit 8159b1598e21daee730e185d025694e27df18d1b)
2008-05-29 19:30:11 +10:00
Andrew Tridgell
215fd9764f test the maximal access return
(This used to be commit 23ffec5d140463c8307fd7e444ae25781ea3d792)
2008-05-29 19:16:44 +10:00
Andrew Tridgell
c793faf998 check the set of file attributes which are ignored
(This used to be commit c818f56d8ea3ddc6f4cc61e9d5ed6fd195280a5d)
2008-05-28 22:44:54 +10:00
Andrew Tridgell
91069754f8 add testing of creating a file with an initial ACL on SMB2
(This used to be commit e957e86a03baa0c0daf3bfe1aaeceb7a08e3c24e)
2008-05-28 18:48:23 +10:00
Andrew Tridgell
0eb4ecc81a test unknown tags and bad tag lengths
(This used to be commit 72902c1d0f85048adf3088b4f90bbc34858b8658)
2008-05-28 16:59:12 +10:00
Andrew Tridgell
082272e49d added testing of SMB2 create blobs
(This used to be commit a48cbec6b90c6ba9db870fc33eed06b36612d8ff)
2008-05-28 16:28:50 +10:00
Andrew Tridgell
6cdfbd8380 fixed uninitialised variable
(This used to be commit 8d2e20fcb984c122fbf98cfe712b3145941d881d)
2008-05-27 20:16:00 +10:00
Andrew Tridgell
ed3a095a5a fixed file_attributes test
(This used to be commit 791ce0fe39a9d9e0d40b9850ff6f0cc9077fe2f1)
2008-05-27 19:10:35 +10:00
Andrew Tridgell
7ae464b548 another gentest derived test
(This used to be commit bb546ab3779b235c5276ef9a714d1ca57b6815c9)
2008-05-27 15:00:05 +10:00
Andrew Tridgell
6e265867ff SEC_STD_SYNCHRONIZE is only invalid on SMB2
(This used to be commit 067f1271adaa13d537bbc92b19fe8d633cbaaf50)
2008-05-27 14:30:42 +10:00
Andrew Tridgell
95afe46a0e expanded the SMB2 create testing
(This used to be commit 71915128498674d9937780b9278fd2ac1eb06ba8)
2008-05-27 14:07:27 +10:00
Andrew Tridgell
0d8d6dbfd7 the start of a SMB2 create test suite
(This used to be commit 16787e99f3de7255e315651c095486f90f65f2ca)
2008-05-27 12:41:50 +10:00