VERSION: Bump version number up to 4.0.1.

And re-enable git snapshots.

Karolin
Fix bug #9196 - defer_open is triggered multiple times on the same request.

get_deferred_open_message_state_smb2() is buggy in that it is checking
the wrong things to determine if an open is in the deferred state.

It checks if (smb2req->async_te == NULL) which is incorrect,
as we're not always async in a deferred open - remove this.

It should check instead state->open_was_deferred as this
is explicity set to 'true' when an open is going deferred,
so add this check.

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Dec 18 14:19:13 CET 2012 on sn-devel-104
(cherry picked from commit 2148d86c7a2facd6e128b753aef98722843af3e1)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Wed Jan  2 12:18:40 CET 2013 on sn-devel-104
docs: Remove superfluous bracket.

Reviewed-by: Karolin Seeger <kseeger@samba.org>
(cherry picked from commit ab43e2db64ae3ef387ceb0e7e6a6f82c9e6d301d)

Fix bug 9528 - Superfluous bracket in samba.8.xml.
docs: Fix typo in vfs_tsmsm.8.xml.

Reviewed-by: Karolin Seeger <kseeger@samba.org>

Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Wed Jan  2 12:12:12 CET 2013 on sn-devel-104
(cherry picked from commit 6cb7c4f45e1657245443c3bcc6dab219e5f1d9b5)

Fix bug #9530 - Typo in vfs_tsmsm.8.xml.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Wed Jan  2 14:25:40 CET 2013 on sn-devel-104
smbd: Fix bug 9549 -- Memleak in the async echo handler

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan  8 23:30:41 CET 2013 on sn-devel-104
(cherry picked from commit 3d5c534f0cc7c6e3eead7462eef4a178c7035857)
s4:lib/messaging: terminate the irpc_servers_byname() result with server_id_set_disconnected() (bug #9540)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 8d9a77f8646cd26371dc2ec1d3ed52730ac19eb9)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Jan 10 11:46:05 CET 2013 on sn-devel-104
s4:scripting/python: always treat the highwatermark as opaque (bug #9508)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 257ae5443631e645842cfcc9c1cedce6c41d5afa)
s4:dsdb/repl_meta_data: always treat the highwatermark as opaque (bug #9508)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a37f46a9a83a03157276485eb583649b36fb6ee1)
s4:dsdb/repl_meta_data: store the last results and timestamps in the repsFrom

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 634f8cf7c43bd60507d842d35cf46c0017e34dce)
s4:dsdb/repl_meta_data: also update the last_sync_success in replUpToDateVector

This matches Windows 2008R2 and Windows 2012.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit ad43bb6086a7dbf48b405d0372ae85d2244384d9)
s4:dsdb/repl_meta_data: don't merge highwatermark and uptodatevector (bug #9508)

We should not do any magic regarding the highwatermark we got from
the source dsa. We need to treat it as opaque and not try to be smart
and merge it into the uptodatevector.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5ecbc892b5226d3d31da2c62ae5261a8d8a73072)
s4:dsdb/common: use LDB_SEQ_HIGHEST_SEQ for our entry in the uptodatevector

We should use the global highestCommittedUSN, not the per partition value.

This matches a Windows 2008R2 and 2012 server.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 81fa179b155a62f2f652fbb1fc4978c9f6eb5462)
s4:dsdb/common: use 01.01.1970 as last_sync_success for our entry in the uptodatevector

This matches a Windows 2008R2 and 2012 server.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit e7a26d02413005294180a1d9cd4c90d4ac4d9733)
s4:dsdb/drepl: update the source_dsa_obj/invocation_id in repsFrom

The highwatermark is relative to the source_dsa_invocation_id.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 2e9b06412b09163d4b851135ef509d73bb6d61fc)
s4:drsuapi: move struct drsuapi_getncchanges_state to the top of getncchanges.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 551bb2ccea6a1d82dbe0d4a21c19a8d8bd13ccbc)
s4:drsuapi: remove unused 'highest_usn' from drsuapi_getncchanges_state

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 30be17bc5d6b3cf2ee0aef6663af78b153b2ab9a)
s4:drsuapi: avoid a ldb_dn_copy() and use talloc_move() instead

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 025c6d62f3c1b0f760aaacb7b3960135319031da)
s4:drsuapi: always use the current uptodateness_vector

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 02de5b140cfe6ea31e0686e5f0ff726a22153020)
s4:drsuapi: add drsuapi_DsReplicaHighWaterMark_cmp()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7e511b58318cef1b325a8191685ee156a7fc0cb7)
s4:drsuapi: make sure we never return the same highwatermark twice in a replication cycle (bug #9508)

If the highwatermark given by the client is not the one we expect,
we need to start a new replication cycle. Otherwise the destination dsa
skips objects and linked attribute values.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 91f7f2c04fd00e281b0755a331ca632a4905e3b5)