Volker Lendecke [Sun, 30 Jun 2019 07:15:48 +0000 (09:15 +0200)]
smbd: Set SHARE_MODE_HAS_READ_LEASE when granting a read lease
Lazy update of the flag: Whenever we add a read lease, we have to set
the flag. Nobody except contend_level2_oplocks_begin will remove that
flag again, as this would mean a full lease traverse when removing
one. And contend_level2_oplocks_begin traverses the leases anyway
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Sun, 30 Jun 2019 06:54:20 +0000 (08:54 +0200)]
smbd: Add file_has_read_lease()
This caches share_mode_data->flags in the fsp, cache flush happening
on tdb_seqnum change.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Fri, 28 Jun 2019 05:48:45 +0000 (07:48 +0200)]
smbd: Add flags to the beginning of share_mode_data
They are put at the beginning for easy parsing without reading the
full struct. First step to remove the number of read oplocks/leases
from brlock.tdb, where it does not belong.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:56:27 +0000 (15:56 +0200)]
smbd: Send do_lock() through share_mode_do_locked()
We need to maintain the locking hierarchy locking.tdb->brlock.tdb at
all times. vfs_fruit directly calls do_lock(), which might fail to
maintain the locking hierarchy: In brlock.c we call
contend_level2_oplocks_begin(), which will soon look at the
locking.tdb record.
For the SMB1 and SMB2 callers we already have the share mode locked,
we might want to watch that record for unlocks. For those callers
share_mode_do_locked() is practically free to call, we share the
underlying db_record.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 27 Jun 2019 15:23:07 +0000 (17:23 +0200)]
smbd: Add share_mode_do_locked()
This is made for efficient locking of share mode records in
locking.tdb. Right now we already need that when accessing leases.tdb,
and soon it will be required for brlock.tdb as well. It does not give
direct access to the parsed share mode entry, but the record is
available for dbwrap_watched_wakeup() within downgrade_lease().
It can be freely nested with get_share_mode_lock calls, the record
will be shared and proper nesting should be checked.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 27 Jun 2019 14:58:54 +0000 (16:58 +0200)]
smbd: Introduce static_share_mode_record
The next commit will introduce share_mode_do_locked(), which allocates
a share mode record on the stack. We have to expect nested
get_share_mode_lock() calls from within share_mode_do_locked() for
which we need to share a db_record.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 27 Jun 2019 12:40:08 +0000 (14:40 +0200)]
smbd: Simplify share_mode_lock.c
Do explicit refcounting instead of talloc_reference(). A later patch
will introduce a share_mode_do_locked() routine that can be nested
arbitrarily with get_share_mode_lock(). To do sanity checks for proper
nesting, share_mode_do_locked needs to be aware of the reference
counts for "static_share_mode_lock".
Why is share_mode_memcache_delete() gone? In parse_share_modes() we
already move the data out of the cache, share_mode_lock_destructor()
we don't even bother re-adding the share_mode_data to the cache if
it does not have share entries, because the next opener will invent a
new seqnum anyway.
Also: Less talloc_reference(), less lines of code.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Fri, 24 May 2019 13:00:45 +0000 (15:00 +0200)]
dbwrap: Add publically available dbwrap_watch_wakeup()
Without this, to notify watchers you need to actually store data. This
might be a waste of resources. locking.tdb waiters might actually wait
for leases.tdb or brlock.tdb changes, and locking.tdb records can be
large.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Fri, 24 May 2019 12:49:47 +0000 (14:49 +0200)]
dbwrap: Rename dbwrap_watched_wakeup()
In the next step I want to make dbwrap_watched_wakeup() publically
available under that canonical name.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Andrew Bartlett [Thu, 4 Jul 2019 05:43:35 +0000 (17:43 +1200)]
WHATSNEW: add news the sad passing of python2 support
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jul 4 11:25:07 UTC 2019 on sn-devel-184
Andrew Bartlett [Thu, 4 Jul 2019 05:43:20 +0000 (17:43 +1200)]
WHATSNEW: add news about Samba AD at 100,000 scale
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Gary Lockyer [Wed, 3 Jul 2019 22:00:03 +0000 (10:00 +1200)]
WHATSNEW: ldb_batch mode and join performance
Document the join performance improvement, and the ldb "batch_mode"
option.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Wed, 3 Jul 2019 04:41:59 +0000 (16:41 +1200)]
domain join: set ldb "transaction_index_cache_size" option
Set the "transaction_index_cache_size" on a join to improve
performance. These setting reduced a join to a 100k user domain from
105 minutes to 44 minutes.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Tue, 2 Jul 2019 00:31:52 +0000 (12:31 +1200)]
domain join: enable ldb batch mode
Enable ldb "batch_mode" transactions duting a join to improve
performance.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Thu, 4 Jul 2019 02:37:31 +0000 (14:37 +1200)]
ldb: Release ldb 2.0.5
* add ldb_options_get
add a function to get the options passed in ldb connect.
* add "batch_mode" option.
This options stops sub transactions being started for key value
operations. It is intended to improve the performance in batch
operations. As it bypasses the protections on operations if an
operation fails, the entire transaction will be aborted by a commit.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Thu, 4 Jul 2019 04:49:29 +0000 (16:49 +1200)]
ldb: Rework index_transaction_cache_size to allow caller to specify a larger size
The previous code would override the caller with the DB size
estimate rather than allowing the caller to force the bigger size.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Tue, 2 Jul 2019 04:42:44 +0000 (16:42 +1200)]
ldb ldb_key_value: test ldb batch
Test the the ldb "batch_mode" option sets batch mode operation.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Tue, 2 Jul 2019 00:30:44 +0000 (12:30 +1200)]
ldb key_value: Add batch_mode option
When performing a join the overhead of the sub transactions protecting
key value operations becomes significant. This commit adds a new
"batch_mode" option that disables the sub transactions around key value
operations.
The operation level index cache is also disabled, which means the
overall transaction level index cache can become inconsistent if an
operation fails. To protect against this and other possible on disk
inconsistencies, if any operation fails during a batch_mode
transaction the commit will fail and transaction will be rolled back.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Thu, 4 Jul 2019 02:22:29 +0000 (14:22 +1200)]
s4 samdb: pass ldb options to ldb_module_connect_backend
Pass the ldb options into ldb_module_connect_backend, to ensure ldb
options such as "batch mode" and "transaction index cache size" get passed
through to the backend modules.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Thu, 4 Jul 2019 04:44:21 +0000 (16:44 +1200)]
ldb: Add new internal helper function ldb_options_get()
This is needed for modules to access the ldb->options array, as this in in ldb_private.h
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Andrew Bartlett [Thu, 4 Jul 2019 02:52:27 +0000 (14:52 +1200)]
ldb: Fix dependency on ldb_key_value_sub_txn_{mdb_}test
ldb_tdb can be a module, but the test is actually looking for ltdb_err_map() in
ldb_tdb_err_map.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Andrew Bartlett [Thu, 4 Jul 2019 01:50:22 +0000 (13:50 +1200)]
ldb: Try to explain the confusing overload of the LDB_FLG_MOD_* enumeration and other flags
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jul 4 03:51:58 UTC 2019 on sn-devel-184
Andrew Bartlett [Thu, 4 Jul 2019 01:30:36 +0000 (13:30 +1200)]
ldb: Add tests for Ldb.write_ldif() including the FLG_SHOW_BINARY and FLAG_FORCE_NO_BASE64_LDIF
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Andrew Bartlett [Thu, 4 Jul 2019 01:26:20 +0000 (13:26 +1200)]
pyldb: Apply flags specified by ldb.Ldb(flags=...) even if the URL is not set
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Björn Baumbach [Thu, 28 Mar 2019 19:39:41 +0000 (20:39 +0100)]
doc: add documentation for "samba-tool" contact management
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Wed, 20 Mar 2019 16:17:05 +0000 (17:17 +0100)]
samba-tool tests: add tests for contact management
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Tue, 19 Mar 2019 16:55:37 +0000 (17:55 +0100)]
samba-tool: implement contact management commands
Usage: samba-tool contact <subcommand>
Contact management.
Available subcommands:
create - Create a new contact.
delete - Delete a contact.
edit - Modify a contact.
list - List all contacts.
move - Move a contact object to an organizational unit or container.
show - Display a contact.
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Thu, 28 Mar 2019 19:31:48 +0000 (20:31 +0100)]
doc: add samba-tool group command to samba-tool man page
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Mon, 18 Mar 2019 12:31:04 +0000 (13:31 +0100)]
samba-tool tests: add test for 'samba-tool group edit' command
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Wed, 13 Mar 2019 20:20:29 +0000 (21:20 +0100)]
samba-tool group: add 'edit' command to edit an AD group object
Same like the samba-tool user edit command.
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Mon, 18 Mar 2019 11:00:24 +0000 (12:00 +0100)]
samba-tool tests: add test for 'samba-tool computer edit' command
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Thu, 28 Mar 2019 19:34:20 +0000 (20:34 +0100)]
doc: add samba-tool computer command to samba-tool man page
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Wed, 13 Mar 2019 20:40:25 +0000 (21:40 +0100)]
samba-tool computer: add 'edit' command to edit an AD computer object
Similar to the samba-tool user edit command.
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Fri, 15 Mar 2019 13:20:05 +0000 (14:20 +0100)]
samba-tool user edit: avoid base64 encoded strings in editable ldif if possible
Use clear text arguments strings if possible. Makes it more comfortable
for users to edit the user objects attributes.
Remove test from knownfail:
samba.tests.samba_tool.user_edit.change_attribute_force_no_base64
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Fri, 15 Mar 2019 11:59:09 +0000 (12:59 +0100)]
samba-tool tests: add test for 'samba-tool user edit', using LDB_FLAG_FORCE_NO_BASE64_LDIF
Test to edit a user: Change attributes with LDB_FLAG_FORCE_NO_BASE64_LDIF
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Wed, 13 Mar 2019 16:40:37 +0000 (17:40 +0100)]
samba-tool user edit: simplify code
Use "None"-changetype here, instead of "Add". This avoids the need to
remove the changetype line afterwards.
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Fri, 15 Mar 2019 13:19:35 +0000 (14:19 +0100)]
samba-tool user edit: use ldb methods to create ldif to modify user
Remove tests from knownfail:
samba.tests.samba_tool.user_edit.add_attribute_base64
samba.tests.samba_tool.user_edit.add_attribute_base64_control
samba.tests.samba_tool.user_edit.change_attribute_base64_control
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14003
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Thu, 14 Mar 2019 13:04:28 +0000 (14:04 +0100)]
samba-tool tests: add additional tests for "samba-tool user edit" command
Especially test handling of base64 encoded attribute values here.
Add selftest/knownfail.d/samba_tool.user_edit.
Tests fail, because:
- can not work with ldif without a trailing new line
- can not handle base64 strings
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14003
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Tue, 19 Feb 2019 11:29:58 +0000 (12:29 +0100)]
ldb/ldb_ldif: add LDB_FLAG_FORCE_NO_BASE64_LDIF flag
Flag is used to enforce binary encoded attribute values per attribute.
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Tue, 19 Feb 2019 11:14:37 +0000 (12:14 +0100)]
ldb/ldb_ldif: add copy_raw_bytes helper variable to ldb_ldif_write_trace()
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Thu, 14 Mar 2019 15:55:42 +0000 (16:55 +0100)]
samba-tool user edit test: use testit instead of subunit_start_test, pass/failed
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Thu, 14 Mar 2019 11:29:13 +0000 (12:29 +0100)]
samba-tool tests: remove probably outdated comment
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Thu, 14 Mar 2019 15:47:36 +0000 (16:47 +0100)]
samba-tool tests: rename "user edit" test from edit.sh to user_edit.sh
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Björn Baumbach [Thu, 21 Mar 2019 13:15:22 +0000 (14:15 +0100)]
samba-tool: fix format of command description (help messages)
Need to quote the backslash '\'.
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Samuel Cabrero [Tue, 18 Jun 2019 09:03:41 +0000 (11:03 +0200)]
bootstrap: Add OpenSUSE 15.1 image
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Ralf Habacker [Mon, 24 Jun 2019 07:25:48 +0000 (09:25 +0200)]
winbind: fix crash in fill_domain_username_talloc() if specified username is NULL
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul 3 19:24:52 UTC 2019 on sn-devel-184
Amit Kumar [Mon, 24 Jun 2019 22:20:42 +0000 (03:50 +0530)]
docs: Correct 'net ads dns unregister --help' description
This change corrects the content of 'net ads dns unregister --help'
command. Updated output would be:
Usage:
net ads dns unregister [hostname]
Remove all IP Address entires for a given
hostname from the Active Directory server.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14005
Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jul 3 15:12:50 UTC 2019 on sn-devel-184
Isaac Boukris [Wed, 3 Apr 2019 16:45:02 +0000 (19:45 +0300)]
Add PrimaryGroupId to group array in DC response
This is a simplified version of the original patch by:
Felix Botner <botner@univention.de>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11362
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul 3 13:52:55 UTC 2019 on sn-devel-184
Isaac Boukris [Fri, 31 May 2019 14:22:50 +0000 (17:22 +0300)]
selftest: check for PrimaryGroupId in DC returned group array
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11362
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Isaac Boukris [Fri, 31 May 2019 17:02:30 +0000 (20:02 +0300)]
selftest: remote_pac: s/s2u4self/s4u2self/g
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11362
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 18 Jun 2019 15:09:29 +0000 (17:09 +0200)]
s3:modules: Use hash_inode() in vfs_streams_xattr
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jul 3 12:37:12 UTC 2019 on sn-devel-184
Andreas Schneider [Tue, 18 Jun 2019 14:58:29 +0000 (16:58 +0200)]
s3:modules: Use hash_inode() in vfs_fruit
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Andreas Schneider [Mon, 1 Jul 2019 14:36:13 +0000 (16:36 +0200)]
s3:modules: Allow SHA1 usage for file IDs in FIPS mode
This is non-cryptographic use!
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Andreas Schneider [Tue, 18 Jun 2019 14:56:43 +0000 (16:56 +0200)]
s3:modules: Add hash_inode() function based on SHA1
This should use SHA1 as modern CPUs have SHA NI instruction support.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 19:07:55 +0000 (21:07 +0200)]
lib: Fix return of server_id_db_prune_name()
The tdb routines return 0/-1 and return the specific error via
tdb_error(). server_id_db_prune_name() is expected to return an errno,
not 0/-1.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Jul 3 10:51:32 UTC 2019 on sn-devel-184
Volker Lendecke [Mon, 1 Jul 2019 19:02:21 +0000 (21:02 +0200)]
tdb: Adapt _tdb_transaction_cancel() to README.Coding
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 19:00:23 +0000 (21:00 +0200)]
tdb: Adapt tdb_rescue() to README.Coding
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Noel Power [Tue, 2 Jul 2019 08:29:47 +0000 (09:29 +0100)]
lib/krb5_wrap: Fix leaking using mkstemp
commit:
8b92539997a9df8e0d217790fd82fc8f59ea50cc introduced a leak
by replacing mktemp with mkstemp (mkstemp returns an open fd)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Volker Lendecke [Mon, 24 Jun 2019 11:48:10 +0000 (13:48 +0200)]
smbd: Simplify filename_convert_internal()
Use a direct struct assignment
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 Jul 2 18:17:39 UTC 2019 on sn-devel-184
Volker Lendecke [Mon, 1 Jul 2019 13:42:56 +0000 (15:42 +0200)]
smbd: Remove unused "msg_ctx" from smbd_smb1_do_locks_send()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:41:07 +0000 (15:41 +0200)]
smbd: Remove unused "msg_ctx" from smbd_do_locks_try()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:35:19 +0000 (15:35 +0200)]
smbd: Remove unused "msg_ctx" from locking_close_file()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:33:58 +0000 (15:33 +0200)]
smbd: Remove unused "msg_ctx" from do_unlock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:31:04 +0000 (15:31 +0200)]
smbd: Remove unused "msg_ctx" from brl_close_fnum()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:28:10 +0000 (15:28 +0200)]
smbd: Remove unused "msg_ctx" from brl_unlock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:25:27 +0000 (15:25 +0200)]
vfs: Remove unused "msg_ctx" from SMB_VFS_BRL_UNLOCK_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:18:58 +0000 (15:18 +0200)]
smbd: Remove unused "msg_ctx" from brl_unlock_posix()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:17:27 +0000 (15:17 +0200)]
smbd: Remove unused "msg_ctx" from do_lock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:15:41 +0000 (15:15 +0200)]
smbd: Remove unused "msg_ctx" from brl_lock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 13:13:59 +0000 (15:13 +0200)]
smbd: Remove unused "msg_ctx" from brl_lock_posix
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 12:58:35 +0000 (14:58 +0200)]
smbd: Remove unused "blocking_lock" from brl_lock_windows_default()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 12:55:42 +0000 (14:55 +0200)]
vfs: Remove "blocking_lock" from SMB_VFS_BRL_LOCK_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 12:42:50 +0000 (14:42 +0200)]
smbd: brl_lock() never sees blocking locks anymore
This is now all handled in protocol-specific layers
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 12:42:50 +0000 (14:42 +0200)]
smbd: do_lock() never sees blocking locks anymore
This is now all handled in protocol-specific layers
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 12:30:15 +0000 (14:30 +0200)]
smbd: Make do_lock() return NTSTATUS
This routine did a NO-GO: It returned something on talloc_tos(), for
later consumption by push_blocking_lock_request. This is now gone, no
caller uses the "struct byte_range_lock" returned anymore.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 12:23:27 +0000 (14:23 +0200)]
smbd: Avoid casts in do_lock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 1 Jul 2019 12:19:16 +0000 (14:19 +0200)]
smbd: Ensure initialized vars in do_lock
brl_lock does not initialize these variables in all cases
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 2 Jul 2019 11:54:38 +0000 (13:54 +0200)]
librpc/idl: fix build with --enable-spotlight
Fix regression introduced by
88bb8fe43ad30247a78d088fad9c840a7a63bd97.
Pair-programmed-with: Volker Lendecke <vl@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jul 2 14:52:17 UTC 2019 on sn-devel-184
Gary Lockyer [Wed, 5 Jun 2019 23:40:08 +0000 (11:40 +1200)]
kcc: default to logging to DBGLVL_WARNING
If the "-d" debug level parameter is not supplied, default to DBGLVL_WARNING.
Overiding the "log level" set in smb.conf.
When samba runs the kcc command stderr output is logged at DBGLVL_ERR,
the default log destination is stderr. As a result any log messages
generated by the kcc command, are effectively logged at DBGLVL_ERR.
This causes issues if auth or audit logging are enabled in smb.conf.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Tim Beale <timbeale@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jul 2 05:49:43 UTC 2019 on sn-devel-184
Douglas Bagnall [Thu, 20 Jun 2019 00:13:56 +0000 (12:13 +1200)]
docs/smbclient: document -Tcn
BUG:https://bugzilla.samba.org/show_bug.cgi?id=2352
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Mon, 3 Jun 2019 11:02:57 +0000 (23:02 +1200)]
man net: include --json option
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Mon, 3 Jun 2019 14:37:44 +0000 (02:37 +1200)]
net idmap check: correct spelling of --force
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Sun, 17 Mar 2019 04:17:28 +0000 (17:17 +1300)]
s4/scripting/smbstatus: approach py3 compatibility
It is still unused and untested, probably not working.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Sun, 17 Mar 2019 02:38:04 +0000 (15:38 +1300)]
pytests/subunitrun: not usefully executable
it only defines classes and fiddles with signals.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Sun, 17 Mar 2019 01:57:06 +0000 (14:57 +1300)]
s4/tests/dsdb_schema: not usefully executable as script
You could run the script, but it wouldn't do anything.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Sun, 17 Mar 2019 01:50:44 +0000 (14:50 +1300)]
s4/script/rodcdns: str type doesn't need decoding
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Sun, 17 Mar 2019 01:49:14 +0000 (14:49 +1300)]
wintest: py3 telnet.sendline() doesn't like string with ^Z
Try using bytes instead.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Sun, 17 Mar 2019 02:38:43 +0000 (15:38 +1300)]
script/bisect-test: fix for py3
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Thu, 14 Mar 2019 10:12:38 +0000 (23:12 +1300)]
s4/scripting/autoidl: another py3 incompatible except
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Tim Beale [Mon, 1 Jul 2019 01:41:14 +0000 (13:41 +1200)]
repl_md: Avoid dropping cross-partition links
Cross-partition links could still be dropped if GET_TGT was already
previously set for the replication.
This was due to a slight error in the order of logic. We never want to
ignore cross-partition links (regardless of whether the TARGETS_UPTODATE
/GET_TGT flag is set). We should only be returning early in the
GET_TGT case if the objects are both in the same partition.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14022
RN: When the AD domain contained a linked attribute that spanned
partitions, DRS replication could drop the link. This dropped link could
then result in subtle differences in behaviour between DCs, as some DCs
would have the link and others wouldn't. When this issue occurred, the
dropped link would be logged in a warning message:
"<target-dn> is Unknown but up to date. Ignoring link from <source-dn>"
This issue would not always occur - it depended a lot on the database
contents. Typically, it would only potentially occur when joining a new
DC to the domain (doing an ldapcmp after the join would also highlight
the problem, if it occurred). This issue has now been resolved.
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Tim Beale [Mon, 1 Jul 2019 02:16:13 +0000 (14:16 +1200)]
tests: Add getncchanges test for cross-partition links + TGT
This adds a test-case to highlight a bug in the client side GetNCChanges
handling.
These tests mostly exercise the server-side behaviour of sending the
GetNCChanges, however, there's a bug in the client-side code when we try
to handle a missing cross-partition link target *in combination* with
the GET_TGT flag already having been set.
The test is exercising the client-side code by using the 'samba-tool drs
replicate' command. By adding a one-way link to a deleted target object,
we force the client code to retry with the GET_TGT flag set.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14022
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Sun, 30 Jun 2019 23:44:36 +0000 (11:44 +1200)]
WHATSNEW.txt: samba-tool --backend-size-parameter
Document the --backend-store-size option added to the samba-tool sub
commands:
* domain provision
* domain join
* domain dcpromo
* drs clone-dc-database
And the removal os the join subdomain option.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Tue Jul 2 04:19:29 UTC 2019 on sn-devel-184
Gary Lockyer [Fri, 28 Jun 2019 03:13:13 +0000 (15:13 +1200)]
samba-tool domain join: remove the subdomain option
Remove the sub domain option from join, as it currently does not work.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Fri, 28 Jun 2019 03:11:11 +0000 (15:11 +1200)]
join subdomain: changes for --backend-store-size
Pass the 'backend_store_size' parameter through to DCJoinContext.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Fri, 28 Jun 2019 03:12:31 +0000 (15:12 +1200)]
samba-tool domain dcpromo: add --backend-store-size option
Add a new "samba-tool domain dcpromo" option "backend-store-size".
This allows the lmdb map size to be set during a promotion, instead of
hard-wiring it to 8Gb.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Fri, 28 Jun 2019 03:14:51 +0000 (15:14 +1200)]
samba-tool dcpromo tests: add --backend-store-size option
Add a new "samba-tool domain dcpromo" option "backend-store-size".
This allows the lmdb map size to be set during a promotion, instead of
hard-wiring it to 8Gb.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Thu, 27 Jun 2019 20:56:31 +0000 (08:56 +1200)]
samba-tool clone-dc-database: Add --backend-store-size option
Add a new "samba-tool drs clone-dc-database" option "backend-store-size".
This allows the lmdb map size to be set during a clone, instead of
hard-wiring it to 8Gb.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>'
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Thu, 27 Jun 2019 20:54:31 +0000 (08:54 +1200)]
clone-dc-database tests: Add --backend-store-size option
Add a new "samba-tool drs clone-dc-database" option "backend-store-size".
This allows the lmdb map size to be set during a clone, instead of
hard-wiring it to 8Gb.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>'
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Thu, 27 Jun 2019 20:52:50 +0000 (08:52 +1200)]
samba-tool domain join: Add --backend-store-size option
Add a new "samba-tool domain join" option "backend-store-size".
This allows the lmdb map size to be set during a provision, instead of
hard-wiring it to 8Gb.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Gary Lockyer [Wed, 26 Jun 2019 22:19:51 +0000 (10:19 +1200)]
domain join tests: Add --backend-store-size option.
Tests for the new "samba-tool domain join" option
"backend-store-size". This allows the lmdb map size to be set during a
provision, instead of hard-wiring it to 8Gb.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>