s4-dsdb: Reduce calls to the ldb layer by reloading less often

We do not need to reload the partition list to get the global sequence
number, as that number is stored in the metadata.tdb, not the ldb files.

Andrew Bartlett
s4-dsdb: simplify migration of old-style seqence numbers to metadata.tdb

This simple operation does not need to be encased in generic ldb extended operations.

Andrew Bartlett
s4-dsdb: Remove ldb_sequence_type argument from partition_primary_sequence_number

We always want LDB_SEQ_HIGHEST_SEQ here.

Andrew Bartlett
s4-dsdb: Change talloc parent

This matches the rest of the function.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 06:26:36 CEST 2012 on sn-devel-104
s4-pydsdb: Provide control of if we should write index attributes when reloading a schema

This allows us to carefully control the loading of the schema.

Andrew Bartlett
s4-dsdb: Ensure we have indexing enabled during the provision

Because we set the schema before we connected the ldb to a file, the @INDEX records
were not added until next startup.  This cost 100% more time in running provision on
my laptop.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 08:20:36 CEST 2012 on sn-devel-104
s3:smb2_server: do central file_id check if the operation requires it

Note that it's fine to call file_fsp_smb2() twice, the 2nd call
just returns smb2req->compat_chain_fsp without a 2nd lookup.

metze
s3:smb2_server: check the session before we could response with an error.

metze
s3:smbXsrv.idl: add encryption_required to smbXsrv_tcon_global0

metze
s3:smb2_sesssetup: set global->encryption_required and enforce it

This the account or client doesn't support encryption we should
reject the session setup.

metze
s3:smb2_tcon: set global->encryption_required and enforce it

This the account or client doesn't support encryption we should
reject the tree connect.

metze
s3:smb2_server: add smbd_smb2_request->do_encryption

For now it's always false...

metze
s3:smb2_read: don't try sendfile if encryption is used

metze
s3:smb2_sesssetup: setup global->[en|de]cryption_key

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Aug  9 09:59:02 CEST 2012 on sn-devel-104
s4-dsdb: Do not reload partition metadata except on transaction start

This ensures that we do not add objects that should go into a partition, but we
simply return that an object is not present if the connection was created
before the partition was loaded.  It is rare to create a new partition.

Andrew Bartlett
s4-dsdb: Remove strcasecmp() fallback in replmd_ldb_message_element_attid_sort

In all callers, we must already have a attributeID for each of the
values or else we would have already given an error, or could not have
obtained the message over DRS.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 11:39:54 CEST 2012 on sn-devel-104
lib/ldb: Use tdb_exists() rather than tdb_fetch()/talloc_free()

This avoids pulling the record and doing an allocation when we just
want to know if it exists.

Andrew Bartlett
s3-events: Do not vasprintf() the tevent debug messages that will not be shown

This malloc() and free() actually shows up quite high on a call profile of
provision of the AD DC (and this is the matching patch for source3).

Andrew Bartlett
s4-events: Do not vasprintf() the tevent debug messages that will not be shown

This malloc() and free() actually shows up quite high on a call profile of
provision of the AD DC.

Andrew Bartlett
lib/ldb: Do not vasprintf() the tevent debug messages that will not be shown

This malloc() and free() actually shows up quite high on a call profile of
provision of the AD DC.

This allows the debug handler to decide if the argument list should be
printed.

Andrew Bartlett