Jeremy Allison [Wed, 2 May 2018 23:39:16 +0000 (16:39 -0700)]
s3: smbd: Remove the handling of offset == -1 in real_write_file().
All SMB1/2/3 offsets over the wire are absolute.
The only caller with offset == -1 is on a print-spool file
in reply_printwrite(), and write_file() redirects this
to print_spool_write(), which correctly handles the -1.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Mon, 30 Apr 2018 18:57:52 +0000 (11:57 -0700)]
s3: printing: Reformatting of parts of this file to modern coding standards.
This should not change the code behavior in any way, it is just being
done to make it easier for me to move this code to calling the
standard read_file() function later on, which takes a file offset
to read from (and uses pread internally).
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Garming Sam [Mon, 26 Mar 2018 23:19:31 +0000 (12:19 +1300)]
netlogon: Allow zero-GUID to act the same as NULL in GetDCNameEx2
This matches Windows behaviour and allows rpcclient to work against
Samba without knowing the GUID ahead of time. Errors related to this
don't appear to occur within selftest.
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Fri May 4 09:11:19 CEST 2018 on sn-devel-144
Garming Sam [Mon, 26 Mar 2018 01:32:07 +0000 (14:32 +1300)]
netlogon: Store the client site to clobber any plausibly returned via winbind
So far, I have never observed the case where the winbind call ever
bothered to return a proper site, but in case it ever does so, we
clobber it here. This has implications for returning a non-local domain
site name, but for now, we ignore them.
Garming Sam [Tue, 20 Mar 2018 22:25:19 +0000 (11:25 +1300)]
netlogon: Forward GetDCNameEx2 to winbind via IRPC
Here we simply forward everything without alteration (the same struct is
returned). This helps us to fix the case where the DC does not exist in
the target site, furthermore, this is supposed to work for trusted
domains.
In calling out to winbind, we now also notice if you provide a site
which exists in multiple domains and provide the correct domain (instead
of accidentally returning ourselves).
Garming Sam [Tue, 20 Mar 2018 22:25:19 +0000 (11:25 +1300)]
winbindd_irpc: Add an IRPC call to trigger a DC locate
Calling the top level winbindd API would probably be more appropriate,
but we lack certain structures. We introduce this call in order to
return the result to NETLOGON (in order to give site-aware and domain
aware DC location).
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Ralph Boehme [Tue, 1 May 2018 07:53:36 +0000 (09:53 +0200)]
s3:cleanupd: sends MSG_SMB_UNLOCK twice to interested peers
MSG_SMB_UNLOCK should be send to smbd that are waiting on blocked
byte-range-locks when a lock holder died.
In smbd_cleanupd_unlock() we do this twice: once via a broadcast and
then again via brl_revalidate() to processes that are actually recorded
in brlock.tdb.
As brl_revalidate() should already take care of signaling anyone who
would be interested in the message, there's no need to broadcast.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May 4 03:02:28 CEST 2018 on sn-devel-144
Ralph Boehme [Mon, 30 Apr 2018 17:03:41 +0000 (19:03 +0200)]
s3:cleanupd: use MSG_SMB_BRL_VALIDATE to signal cleanupd unclean process shutdown
Since 6423ca4bf293cac5e2f84b1a37bb29b06b5c05ed messaging_send_all()
broadcasts messages in a cluster, so cleanupd receives those broadcasts
and acts upon it by re-broadcasting the message. Result: message
storm.
By reactivating the currently unused MSG_SMB_BRL_VALIDATE for the
trigger message to cleanupd we avoid the storm.
Note that MSG_SMB_BRL_VALIDATE was unused only in the sense that noone
*listened* to it, but we were still *sending* the message in
smbd_parent_ctdb_reconfigured(). de6fe2a1dd6ab03b1c369b61da17fded72305b2d
removed listening for MSG_SMB_BRL_VALIDATE from cleanupd. This commits
brings it back.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Thu May 3 16:33:54 CEST 2018 on sn-devel-144
Gary Lockyer [Tue, 6 Mar 2018 02:30:10 +0000 (15:30 +1300)]
ldb: Prepare to allow tests to operate on ldb_mdb (by using the GUID index)
The LMDB backend requires the GUID index mode, so prepare for it
by setting a unique objectGUID on each record. Also prepare for the
index list to be optionally set as an attribute on the test object,
allowing the GUID index mode to be set later when LMDB is configured.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu May 3 11:08:12 CEST 2018 on sn-devel-144
Garming Sam [Thu, 4 Jan 2018 20:28:54 +0000 (09:28 +1300)]
tests: Replace some references to tdb with ldb://
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Gary Lockyer [Tue, 6 Mar 2018 02:11:23 +0000 (15:11 +1300)]
ldb: Introduce new generic ldb:// prefix to allow backend autodetection
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Gary Lockyer [Tue, 6 Mar 2018 02:27:51 +0000 (15:27 +1300)]
ldb_tdb: Make sure max_key_length != 0 requires a GUID index mode
We need to enforce the GUID index mode so end-users do not get a supprise
in mid-operation and we enforce a max key length of 511 so that the
index key trunctation is done correctly.
Otherwise the DB will appear to work until a very long key (DN or index)
is used, after which it will be sad.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andrew Bartlett [Mon, 30 Apr 2018 08:18:52 +0000 (20:18 +1200)]
gitlab-ci: split up gitlab-ci file
The "private" build environments are not available to most users so
remove this from the default build. Only developers with access
to private runners (rather than a shared runner) will have a runner
tagged as "private".
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Andrew Bartlett [Tue, 1 May 2018 21:04:51 +0000 (09:04 +1200)]
autobuild: Extend build combinations tested to include --without-ldap
This bumps --without-ads to the samba-nt4 job so that option alone is still covered.
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Richard Sharpe [Wed, 2 May 2018 22:12:44 +0000 (15:12 -0700)]
Fix some incorrect debug messages that look to be copy-paste issues.
Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu May 3 08:16:26 CEST 2018 on sn-devel-144
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 3 02:42:20 CEST 2018 on sn-devel-144
Jeremy Allison [Mon, 30 Apr 2018 17:15:49 +0000 (10:15 -0700)]
s3: VFS: Default. Move vfs_read_data() out of source3/smbd/vfs.c to the printing code, which is the only caller.
Make static.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed May 2 22:20:23 CEST 2018 on sn-devel-144
Jeremy Allison [Sat, 28 Apr 2018 00:06:10 +0000 (17:06 -0700)]
s3: VFS: Remove fsync_fn() from the VFS and all modules. VFS ABI change.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed May 2 01:06:28 CEST 2018 on sn-devel-144
Martin Schwenke [Thu, 19 Apr 2018 11:57:07 +0000 (21:57 +1000)]
ctdb-scripts: Remove function rewrite_ctdb_options()
This is no longer necessary after the removal of support for
CTDB_DBDIR=tmpfs.
File-local variable ctdb_rundir is no longer used, so drop it.
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue May 1 16:20:37 CEST 2018 on sn-devel-144
Martin Schwenke [Thu, 19 Apr 2018 11:54:11 +0000 (21:54 +1000)]
ctdb-scripts: Drop support for CTDB_DBDIR=tmpfs
CTDB has no business mounting filesystems. Instead, documentation
for the new configuration system will include a recommendation that a
tmpfs be mounted on the volatile database directory.
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Volatile databases now have their own subdirectory. This makes things
easier if we later recommend mounting a tmpfs on the volatile database
directory, rather than supporting the current CTDB_DBDIR=tmpfs magic.
No need to create database directories for local daemon tests. ctdbd
will do that.
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 30 Apr 2018 10:26:20 +0000 (20:26 +1000)]
ctdb-scripts: Fix location of persistent databases
If CTDB_DBDIR_PERSISTENT is not set then set the default relative to
CTDB_VARDIR. The persistent database directory is not (necessarily)
relative to the volatile one.
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 30 Apr 2018 10:24:40 +0000 (20:24 +1000)]
ctdb-tests: Fix location of persistent databases
Always use CTDB_DBDIR_PERSISTENT, which is setup by the test
infrastructure. The persistent database directory is
not (necessarily) relative to the volatile one.
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Sat, 14 Apr 2018 11:38:32 +0000 (21:38 +1000)]
ctdb-scripts: Drop warning when there is no recovery lock
After configuration changes ctdbd_wrapper will no longer see the
CTDB_RECOVERY_LOCK option. The daemon already logs a warning if the
recovery lock is not set, so simply drop this extra warning.
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Thu, 29 Mar 2018 04:11:04 +0000 (15:11 +1100)]
ctdb-scripts: Drop CTDB_NOTIFY_SCRIPT configuration option
Notification scripts are installed into $CTDB_BASE/notify.d/ and are
always run by notify.sh. Leave notify.sh where it is for now but no
longer consider it a configuration file. This is an interim measure
and will be changed again soon.
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Thu, 29 Mar 2018 03:50:17 +0000 (14:50 +1100)]
ctdb-daemon: Set ctdb->notification_script directly
This doesn't need a wrapper function. It gets in the way if building
a value involves allocating memory (e.g. talloc_asprintf()) and then
ctdb_set_notification_script() duplicates that memory.
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Apr 30 21:48:55 CEST 2018 on sn-devel-144
Noel Power [Fri, 27 Apr 2018 07:15:28 +0000 (08:15 +0100)]
python/samba: Py2/Py3 compat change '/' to '//' to ensure int result
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon Apr 30 18:25:25 CEST 2018 on sn-devel-144