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

92368 Commits

Author SHA1 Message Date
Michael Adam
6685e6512e s3:modules:shadow_copy2: remove redundant documentation comment block
and refer to the manual page instead

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-07 07:43:50 +13:00
Michael Adam
bffaf17d48 s3:modules:shadow_copy2: improve headline comment
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-07 07:43:48 +13:00
Michael Adam
b5b5674287 s3:module:shadow_copy2: add my (C)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-07 07:43:45 +13:00
Michael Adam
5173322007 s4:torture:smb2: add new durable-v2-open.reopen1a test
- open session1 on tcp connection conn1
- open a durable handle on a session1
- do a session reconnect on a new tcp connection conn2
- doing a durable reconnect on session1 gives
  USER_SESSION_DELETED
- doing a durable reconnect on session2 succeeds

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Dec  6 15:59:15 CET 2013 on sn-devel-104
2013-12-06 15:59:15 +01:00
Michael Adam
a46059d534 s4:torture:smb2: add new durable-open.reopen1a test
- open session1 on tcp connection conn1
- open a durable handle on a session1
- do a session reconnect on a new tcp connection conn2
- doing a durable reconnect on session1 gives
  USER_SESSION_DELETED
- doing a durable reconnect on session2 succeeds

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-12-06 14:01:34 +01:00
Garming Sam
df9df74195 cldap: quieten error when abandon packet is sent
The specification indicates that no response needs to be sent when receiving
an abandon request packet.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Dec  6 07:13:29 CET 2013 on sn-devel-104
2013-12-06 07:13:29 +01:00
Jelmer Vernooij
43c021512c pyntdb: Add tests for Python API.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-06 05:21:03 +01:00
Jelmer Vernooij
9a67bfa834 pyntdb: Don't segfault when passing in None as filename (for memory db)
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-06 05:21:03 +01:00
Jelmer Vernooij
4111f31eac pyntdb: Don't allow access after a database is closed.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-06 05:21:03 +01:00
Jelmer Vernooij
28b5b7e28e tdb tests: Remove custom code for "tdb2", which has been split out into ntdb.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-06 05:21:03 +01:00
Christof Schmitt
8c3bf7b849 selftest: Remove samba3.smb2.lock.*.rw-exclusive from flapping file
This test demonstrates a problem with byte range locks and AIO.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec  6 05:19:37 CET 2013 on sn-devel-104
2013-12-06 05:19:37 +01:00
Christof Schmitt
d551d5256f selftest: Run smb2.lock tests also against AIO share
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-05 18:22:16 -08:00
Christof Schmitt
63727c1545 selftest: Introduce share for testing AIO
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-05 18:22:16 -08:00
Christof Schmitt
eadb2a54d1 s3: Return correct error code from SMB2 AIO read failure
This is similar to commit 27e20d5d60 which
fixed the same case for SMB2 writes: When sending the AIO read fails,
return the real error instead of mapping it to NT_STATUS_FILE_CLOSED.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-05 18:22:16 -08:00
Christof Schmitt
dfef0701c3 s3-aio: Use correct locking context for SMB2
The synchronous SMB2 reads and writes use open_persistent_id. The AIO
codepathes have to use the same, otherwise a write will conflict with a
lock on the same open file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-05 18:22:16 -08:00
Andreas Schneider
30231b256d s3-torture: Call cli_flush().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Dec  6 03:07:32 CET 2013 on sn-devel-104
2013-12-06 03:07:32 +01:00
Andreas Schneider
5f92c81fb6 krb5_wrap: Move function declaration outside the function.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
1461d873a4 s3-libsmb: Fix a memory leak in get_pdc_ip().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
143907025b s3-torture: Make sure status is used initialized.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
1d7b909bd2 s3-torture: Fix several memory leaks in delete_fn().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
c5e73bccd5 s3-utils: Fix a memory leak in smbget.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
4f06c681b9 s4-torture: Use talloc for asprintf.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
b871c3907a s4-torture: Fix out of bound array access.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
34f498525c s3-torture: Comment out dead code in spoolss test.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
3b3b52c013 s4-torture: Fix some compile warnings in spoolss.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
09cc58c1a7 s4-torture: Make sure handles are correctly initialized.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
ef2cd51586 s4-torture: Make sure the handles are initialized correctly.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
13e33ab98e s4-torture: Make sure the handles are not used uninitialized.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
9d53d9f7e5 s4-libcli: Add smb2_util_handle_empty().
Will be used in the next commit.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
David Disseldorp
5be0995d98 torture: match Windows responses to bad shadow copy IDs
test_fsrvp_bad_id() issues DeleteShareMapping requests with invalid
shadow copy IDs, expect Windows Server 2012 return codes.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
David Disseldorp
dbb6f07728 torture: test duplicate shares in FSRVP shadow-copy set
MS-FSRVP 3.1.4.4 documents the requirement for failure when duplicate
volume names are encountered on AddToShadowCopySet.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Volker Lendecke
c1b7cf5481 smbd: Fix a panic when a smb2 brlock times out
Found by Peter Somogyi.

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): Thu Dec  5 21:21:35 CET 2013 on sn-devel-104
2013-12-05 21:21:35 +01:00
Jeremy Allison
48f426b22d smbtorture: New torture test for bug #9870.
Not fetching the latest modification time on a folder if we have read locks on it.

Prove we should just rely on the mtime value from the underlying
filesystem, even with an open handle.

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

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 Dec  5 10:05:06 CET 2013 on sn-devel-104
2013-12-05 10:05:06 +01:00
Jeremy Allison
a926d0f461 smbd - allow updates on directory write times on open handles.
If we set a non-null 'old timestamp' in the share mode database
when creating a directory handle, this prevents mtime (write time)
updates from being seen by clients, as we will always return the
timestamp stored in the database whilst the handle is open.

For files this is ok, as we update the stored timestamp
ourselves when we write to the handle. For directories
we should just rely on the mtime value from the underlying
filesystem.

Torture test to follow.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-12-05 08:12:09 +01:00
Volker Lendecke
97e8b56250 idmap_cache: Use gencache_parse
This avoids a few tallocs and brings down user CPU a bit more

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Dec  5 03:06:10 CET 2013 on sn-devel-104
2013-12-05 03:06:10 +01:00
Volker Lendecke
89013af15a idmap_cache: Use an fstring instead of talloc_asprintf
In a test doing one million uid2sid calls this brings down user CPU from
1.3 seconds to 0.9 seconds. And it saves a few code lines.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 01:10:25 +01:00
Volker Lendecke
051fb91556 messaging3: Do not go through messages.tdb for self-sends
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 01:09:54 +01:00
David Disseldorp
549b70eb43 torture: enum snapshots after FSRVP creation
Issue an SMB2 ENUM_SNAPSHOTS ioctl following FSRVP snapshot creation to
cover Explorer previous file version use-cases.

This test will fail against Windows Server 2012, as FSRVP created
snapshots are not exposed via the ENUM_SNAPSHOTS ioctl.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:48:33 +01:00
David Disseldorp
29b730a448 test: add fake_snap.pl for snapshot simulation
The script simulates snapshots by simply copying file data from the base
path to a snapshot path located under .snapshots/@GMT-%Y.%m.%d-%H.%M.%S/

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:47:52 +01:00
Michael Adam
b0bbb59c49 ctdb:tests: update README
explain how to run individual tests and test collections and remove mention of
tests/scripts/run_tests which does not exist any more.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2013-12-05 00:47:43 +01:00
Martin Schwenke
3c81066105 ctdb/tests/scripts: Promote scripts/run_tests
The wrapper is not needed anymore.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:46:46 +01:00
Martin Schwenke
318f2cf912 ctdb/tests/scripts: Simplify the top-level test scripts
At the moment run_tests.sh has quite fragile argument processing.  It
needs that annoying "--" between options and tests.  The random
default (mktemp -d) for TEST_VAR_DIR is wrong and is worked around in
various places.

Instead:

* Change the default behaviour to print a summary, add new option -N
  to turn off summary, and remove old -s option.

* Change the default behaviour to run integration tests with local
  daemons, add new options -c to run on a cluster, remove old -l
  option.

* Make $testdir/var the default if the tests are not installed, and
  $(mktemp -d ) the default if tests are installed.

* Move the default tests for local/cluster into scripts/run_tests.

run_tests.sh (and the run_cluster_tests.sh symlink) should behave as
before but with slightly more reasonable defaults.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:46:04 +01:00
Martin Schwenke
bbd46e8634 ctdb/tests/scripts: Sort command-line options
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:44:12 +01:00
Martin Schwenke
f67a1043b3 ctdb/tests/integration: Decentralise the daemon restart code
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:43:55 +01:00
Martin Schwenke
f05db5edc4 ctdb/tests/integration: Update daemons shutdown pseudo-test
Don't scatter the TEST_LOCAL_DAEMONS logic around the code.  Limit it
to the local daemons file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:43:12 +01:00
Martin Schwenke
6b15fe247c ctdb/tests/simple: Local daemons version of setup_ctdb() overrides
setup_ctdb() doesn't need to do anything on a cluster.  To avoid a
conditional, just override it for local daemons.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:41:50 +01:00
Martin Schwenke
85a711f5a8 ctdb/tests/integration: Remove some unused functions
This was the start of some refactorisation that was never completed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:41:25 +01:00
Martin Schwenke
a3fd8ddf35 ctdb/tests/integration: Remove the time logging code
This hasn't been required for a long time and is probably broken.  If
it is needed in future then we know where to find it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:40:37 +01:00
Martin Schwenke
28acce2862 ctdb/tests/simple: Move the local daemons code to its own file
This is just a straight move.  The clever stuff will follow.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:39:59 +01:00
Martin Schwenke
ef0e8cc192 ctdb/tests/integration: Update NFS tickles test and supporting code
This currently requires an eventscript to be dynamically installed.
This eventscript is only used to help determine when a monitor event
has occurred.  This code is horrible and fragile.

A better way is to just monitor the output of "ctdb scriptstatus".
When changes it changes then a monitor event has occurred.

Also remove the old code that checks for tickle information in shared
storage.  CTDB hasn't done things this way for a long time.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:39:21 +01:00