]>
git.ipfire.org Git - thirdparty/samba.git/log
Ralph Boehme [Tue, 2 Apr 2019 16:34:24 +0000 (18:34 +0200)]
s4:lib/http: move to the toplevel
This is going to be used from the s3 RPC server soon...
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Ralph Boehme [Wed, 3 Apr 2019 12:33:12 +0000 (14:33 +0200)]
s4:lib/http: add support for http POST
Even though GET would work as well, only adding POST, as that's the only method
that's going to be exersized in code and tests (RPC mdssvc elasticsearch
backend).
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Ralph Boehme [Tue, 6 Aug 2019 10:33:40 +0000 (12:33 +0200)]
s4:lib/http: use http_conn in http_send_request_send() and http_read_response_send()
Works, tested with
$ bin/smbtorture -W RIVERSIDE --realm=RIVERSIDE.SITE -s /dev/null \
-U Administrator%Passw0rd \
ncacn_http:10.10.11.164[HttpProxy=10.10.11.164:593,HttpUseTls=false,HttpAuthOption=basic,HttpConnectOption=UseHttpProxy] \
rpc.epmapper.epmapper.Lookup_simple
I get an ACCESS_DENIED error, but I get it over HTTP. :)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Ralph Boehme [Thu, 28 Mar 2019 14:36:00 +0000 (15:36 +0100)]
s4:librpc/rpc: use http_connect_send/recv in ncacn_http
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Ralph Boehme [Tue, 26 Mar 2019 14:04:28 +0000 (15:04 +0100)]
s4:lib/http: remove stream and send_queue from state
They're not used, so remove them.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Ralph Boehme [Tue, 26 Mar 2019 13:53:21 +0000 (14:53 +0100)]
s4:lib/http: move struct http_read_response_state to the implementation
This is only used by the implemementation of http_send_request_send/recv, no
need to have this in the header file.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Ralph Boehme [Tue, 26 Mar 2019 13:53:21 +0000 (14:53 +0100)]
s4:lib/http: move struct http_send_request_state to the implementation
This is only used by the implemementation of http_send_request_send/recv, no
need to have this in the header file.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Ralph Boehme [Mon, 25 Mar 2019 13:39:59 +0000 (14:39 +0100)]
s4:lib/http: add http_[dis]connect_send and recv
Not used for now, that comes later.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Ralph Boehme [Tue, 9 Apr 2019 11:34:39 +0000 (13:34 +0200)]
charset: add tests for Unicode NFC <-> NFD conversion
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Aug 7 07:25:39 UTC 2019 on sn-devel-184
Ralph Boehme [Tue, 9 Apr 2019 09:21:57 +0000 (11:21 +0200)]
charset: add support for Unicode normalisation with libicu
This adds a direct conversion hook using libicu to perform NFC <-> NFD
conversion on UTF8 strings. The defined charset strings are "UTF8-NFC" and
"UTF8-NFD", to convert from one to the other the caller calls smb_iconv_open()
with the desired source and target charsets, eg
smb_iconv_open("UTF8-NFD", "UTF8-NFC");
for converting from NFC to NFD.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Ralph Boehme [Tue, 23 Apr 2019 14:47:45 +0000 (16:47 +0200)]
torture: add torture_assert_errno_equal_goto()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Michael Hanselmann [Wed, 3 Apr 2019 23:10:11 +0000 (01:10 +0200)]
Add fuzzing binary for oLschema2ldif
Use the oLschema2ldif library functions introduced in commit
0c7c44a284a26790081c000f5b8f4ed32f9f21d7 to implement a fuzzing utility.
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Michael Hanselmann [Wed, 3 Apr 2019 23:03:58 +0000 (01:03 +0200)]
Add fuzzing binary for tiniparser
The "tiniparser_load" function is made into a wrapper for the newly
added "tiniparser_load_stream" function which accepts a FILE pointer.
This way no actual files have to be opened for fuzzing (memfd_create(2)
isn't readily available on all systems yet).
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Michael Hanselmann [Wed, 3 Apr 2019 22:23:07 +0000 (00:23 +0200)]
Add fuzzing support to build system
LibFuzzer, Honggfuzz and other programs implement simple interfaces for
fuzzing appropriately prepared code. Samba contains quite a lot of
parsing code, often a good target for fuzzing.
With this change the build system is amended to support building fuzzing
binaries (added in later changes).
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Volker Lendecke [Tue, 6 Aug 2019 15:27:12 +0000 (17:27 +0200)]
smbd: Assert that INTERNAL_OPEN_ONLY never gets real oplocks
Slightly simplify assumptions in the code
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 Aug 6 23:06:41 UTC 2019 on sn-devel-184
Volker Lendecke [Tue, 30 Jul 2019 05:20:42 +0000 (07:20 +0200)]
smbd: Remove deferred_open_record_create()
This hides a talloc off the NULL context: The caller needs to make sure
this is put on a real talloc context later. Make that more
obvious. Also, it passes down a boolean flag, making its purpose a bit
opaque to the caller sites.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 30 Jul 2019 05:16:12 +0000 (07:16 +0200)]
smbd: Remove "delayed_for_oplocks" from deferred_open_record_create()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 29 Jul 2019 19:42:12 +0000 (21:42 +0200)]
smbd: Remove "deferred_open_record->delayed_for_oplocks"
Nobody used this
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 26 Jul 2019 17:18:37 +0000 (19:18 +0200)]
smbd: Remove "id" from deferred_open_record_create()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 26 Jul 2019 17:16:09 +0000 (19:16 +0200)]
smbd: Remove "deferred_open_record->id"
Nobody used this
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 6 Aug 2019 08:45:27 +0000 (10:45 +0200)]
smbd: Clean up leases.tdb if set_share_mode() fails
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 5 Aug 2019 16:50:08 +0000 (18:50 +0200)]
smbd: Factor out remove_lease_if_stale()
remove_lease_if_stale() does not have the check
if (e == e2) {
/* Not ourselves. */
continue;
}
that remove_share_mode_lease() had. However, remove_share_mode_lease()
has already set e->op_type=NO_OPLOCK, so that the
if (e->op_type != LEASE_OPLOCK) {
continue;
}
statement has the same effect.
Why? The next commit will need it for proper error path cleanup.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 5 Aug 2019 16:18:41 +0000 (18:18 +0200)]
smbd: Inline remove_oplock_under_lock() into its only caller
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 5 Aug 2019 15:05:20 +0000 (17:05 +0200)]
smbd: Make remove_oplock_under_lock static
We have support for nested get_share_mode_lock calls, so we can avoid
this additional function.
It's one more talloc/free per close, but I hope this can't be
measurable. Our open/close path is pretty expensive anyway.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 5 Aug 2019 12:59:18 +0000 (14:59 +0200)]
smbd: Slightly simplify set_share_mode()
The fsp carries all required information also for leases. There's no
need to pass that as additional parameters
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 5 Aug 2019 12:57:28 +0000 (14:57 +0200)]
smbd: Move fsp_client_guid() to locking/
Yes, this adds another peek from locking/ back into smbd/proto.h, but
locking/locking.c does the same already.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 26 Jul 2019 14:20:17 +0000 (16:20 +0200)]
smbd: Slightly optimize reply_open_and_X()
Well, this is just a drive-by patch: We don't use "mtime" if we
exit early. So it's not really a worthwhile optimization, to me
it's more a code clarity thing.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 14:22:51 +0000 (16:22 +0200)]
smbd: Remove "share_access" from fcb_or_dos_open()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 14:20:04 +0000 (16:20 +0200)]
smbd: Remove "share_access" from dup_file_fsp()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 14:15:46 +0000 (16:15 +0200)]
smbd: Remove "share_access" from files_struct
Nobody used this (except vfs_gpfs, which did not need it really). If
you *really* need this, you can always look in locking.tdb, but this
should never happen in any hot code path, as no runtime decisions are
made on the share access after the open is done.
Bump VFS interface number to 42.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 12:50:35 +0000 (14:50 +0200)]
vfs_gpfs: Avoid "fsp->share_access" in vfs_gpfs_kernel_flock()
This was in vfs_gpfs.c from day one, no idea why both "share_mode" and
"fsp->share_access" were used as if they were two different things.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 14:08:35 +0000 (16:08 +0200)]
smbd: Pass share_access/access_mask explicitly to grant_fsp_oplock_type()
Why? While restructuring open_file_ntcreate() I found the data flow for
these values confusing: grant_fsp_oplock_type() depends on
fsp->access_mask, which changes its value inside
open_file_ntcreate(). I find the data flow easier to follow if it
happens in explicit variables.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 13:01:37 +0000 (15:01 +0200)]
smbd: Pass share_access/access_mask explicitly to set_share_mode()
Makes the interface more obvious to me. Also, I want to remove
fsp->share_access, which is not really used anywhere after the fsp has
been fully established.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 26 Jul 2019 14:28:39 +0000 (16:28 +0200)]
smbd: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 23 Jul 2019 15:46:22 +0000 (17:46 +0200)]
smbd: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 2 Aug 2019 10:02:24 +0000 (12:02 +0200)]
smbd: Enhance debugging in push_deferred_open_message_smb()
Real timestamps are easier to read
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 1 Aug 2019 11:24:49 +0000 (13:24 +0200)]
smbd: Use timeval_str_buf() in defer_open()
Also make this a hires timestamp for better debugging.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 30 Jul 2019 05:10:28 +0000 (07:10 +0200)]
smbd: Fix a signed/unsigned warning
For whatever reason, "st_size" in "struct stat" is an off_t, which is a
signed integer. Negative sizes don't really make sense, so this cast
should be safe.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 30 Jul 2019 04:55:45 +0000 (06:55 +0200)]
smbd: Fix a signed/unsigned comparison
In the 2nd for-loop we need a signed int as we are comparing to >=0.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 10:04:49 +0000 (12:04 +0200)]
smbd: Remove a false comment
Looking at the code we do respect the kernel_flock failure.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 09:39:19 +0000 (11:39 +0200)]
torture3: Don't duplicate set_blocking()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 09:38:36 +0000 (11:38 +0200)]
lib: Remove a duplicate prototype for set_blocking()
This is now in lib/util/blocking.h
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 31 Jul 2019 10:19:24 +0000 (12:19 +0200)]
build: Only check rpc/xdr.h in tirpc if required
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 31 Jul 2019 10:18:42 +0000 (12:18 +0200)]
vfs: Fix the nfs4acl build on FreeBSD
FreeBSD needs rpc/types.h before rpc/xdr.h
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 31 Jul 2019 10:14:03 +0000 (12:14 +0200)]
build: Correctly detect rpc/xdr.h on FreeBSD
FreeBSD needs rpc/types.h included before rpc/xdr.h
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 31 Jul 2019 09:45:31 +0000 (11:45 +0200)]
wscript: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 31 Jul 2019 09:40:20 +0000 (11:40 +0200)]
winbind: Fix the clang build
clang complains that lm_resp and nt_resp is used uninitialized. This
is true for the "goto done;" in line 2644. This directly calls
log_authentication without having initialized those two blobs.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 31 Jul 2019 09:37:59 +0000 (11:37 +0200)]
vfs: Fix the FreeBSD nfs4acl build
I get error messages telling SMB4ACL_T isn't defined in the
prototype. Take the easy way to just define that anonymously.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 31 Jul 2019 09:08:40 +0000 (11:08 +0200)]
dsdb: Fix the FreeBSD build
My FreeBSD install does not have __compar_fn_t. libreplace has the
QSORT_CAST for systems that do.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 31 Jul 2019 08:42:24 +0000 (10:42 +0200)]
smbd: Fix the build with clang
clang correctly complains that "close_fsp" is used uninitialized if
"get_posix_fsp" fails and we end up in "goto out;".
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 1 Aug 2019 15:00:45 +0000 (17:00 +0200)]
smbd: Pass in "struct smb_request" to request_timed_out()
It seems more natural to pass in a request to a routine called
request_timed_out(), and it's a few bytes less .text
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 1 Aug 2019 14:42:59 +0000 (16:42 +0200)]
smbd: Use "req->request_time" in schedule_async_open()
All callers passed that in
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 1 Aug 2019 14:42:59 +0000 (16:42 +0200)]
smbd: Use "req->request_time" in schedule_async_open()
The one caller passed that in.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 1 Aug 2019 14:42:59 +0000 (16:42 +0200)]
smbd: Use "req->request_time" in setup_kernel_oplock_poll_open()
Both callers passed that in.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 1 Aug 2019 14:42:59 +0000 (16:42 +0200)]
smbd: Use "req->request_time" in defer_open()
Both callers passed that in.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 1 Aug 2019 14:42:59 +0000 (16:42 +0200)]
smbd: Use "req->request_time" in schedule_defer_open()
Both callers passed that in.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 1 Aug 2019 14:36:48 +0000 (16:36 +0200)]
smbd: Avoid a separate "request_time" variable in open_file_ntcreate
We have "smb_request->request_time" that is already set up by
init_smb_request().
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Sun, 4 Aug 2019 16:26:05 +0000 (18:26 +0200)]
tdb: Inline the common part of tdb_oob
When you set
in tdbtorture.c to make it more similar to locking.tdb use,
bin/tdbtorture -m -n 1 -l 100000 -s
becomes twice as fast. This is a pretty extreme case, but all other
tests that I did improve significantly as well.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Sun, 4 Aug 2019 10:18:19 +0000 (12:18 +0200)]
tdb: Speed up tdb_oob()
This is common between both implementations of tdb_oob(). It's
faster if we don't have to dereference function pointers.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Sun, 4 Aug 2019 10:15:14 +0000 (12:15 +0200)]
tdb: Introduce tdb_oob()
Initially just encapsulate the pointer dereferences
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Sun, 4 Aug 2019 10:10:03 +0000 (12:10 +0200)]
tdb: Rename tdb_oob() to tdb_notrans_oob()
tdb_oob() will become a public function encapsulating the pointer
dereferences.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Douglas Bagnall [Thu, 1 Aug 2019 23:29:55 +0000 (23:29 +0000)]
pidl/ndr/python: avoid memory errors in getsetters
This:
$ python3 -c'from samba.dcerpc import lsa; x = lsa.EnumAccounts(); x.in_handle'
should not raise a MemoryError, which is very unfriendly given that
'x.in_handle' is just named, not called, as far as the user is
concerned. Returning None is the proper thing.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Aug 6 18:17:11 UTC 2019 on sn-devel-184
Douglas Bagnall [Thu, 1 Aug 2019 04:02:05 +0000 (16:02 +1200)]
s4/messaging/py: don't DECREF borrowed references
This made Message.deregister() a decref machine, with talloc crashes
and segfaults available thus:
from samba import messaging
m = messaging.Messaging()
for i in range(20):
m.deregister(m)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
Douglas Bagnall [Thu, 7 Mar 2019 23:12:00 +0000 (12:12 +1300)]
ldb_dn: free dn components on explode failure
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
Ralph Boehme [Mon, 5 Aug 2019 09:11:14 +0000 (11:11 +0200)]
s3:smbd: Fix sync dosmode fallback in async dosmode codepath
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14070
RN: Fix sync dosmode fallback in async dosmode codepath
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 Aug 6 15:40:18 UTC 2019 on sn-devel-184
Ralph Boehme [Mon, 5 Aug 2019 08:59:22 +0000 (10:59 +0200)]
s3:smbd: Incomplete conversion of former parametric options
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14069
RN: Incomplete conversion of former parametric options
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Ralph Boehme [Fri, 12 Jul 2019 08:49:13 +0000 (10:49 +0200)]
ctdb: fix compilation on systems with glibc robust mutexes
On older systems like SLES 11 without POSIX robust mutexes, but with glib robust
mutexes where all the functions are available but have a "_np" suffix,
compilation fails in:
ctdb/tests/src/test_mutex_raw.c.239.o: In function `worker':
/root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:129: undefined reference to `pthread_mutex_consistent'
ctdb/tests/src/test_mutex_raw.c.239.o: In function `main':
/root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:285: undefined reference to `pthread_mutex_consistent'
/root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:332: undefined reference to `pthread_mutexattr_setrobust'
/root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:363: undefined reference to `pthread_mutex_consistent'
collect2: ld returned 1 exit status
This could be fixed by using libreplace system/threads.h instead of pthreads.h
directly, but as there has been a desire to keep test_mutex_raw.c standalone and
compilable without other external depenencies then libc and libpthread, make the
tool developer build only. This should get the average user over the cliff.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14038
RN: Fix compiling ctdb on older systems lacking POSIX robust mutexes
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Ralph Boehme [Sun, 4 Aug 2019 07:29:44 +0000 (09:29 +0200)]
s3: smbd: fix a comment in fd_close()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sun, 4 Aug 2019 07:21:55 +0000 (09:21 +0200)]
s3: smbd: inline dptr_close_internal()
There's now only one caller left.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sun, 4 Aug 2019 07:15:47 +0000 (09:15 +0200)]
s3: smbd: simplify dptr_CloseDir()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sun, 4 Aug 2019 07:13:34 +0000 (09:13 +0200)]
s3: smbd: remove redundant smb_dname arg from dptr_create()
Now that dptr_create() is handle based, we can simply used the fsp name.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 21:59:00 +0000 (14:59 -0700)]
s3: smbd: Remove call to dptr_closecnum() on connection shutdown.
Now all client enumerations use fsp file handles we will
aleady close them in file_close_conn() above.
The only user of dptr_closecnum() is for the strange old OS/2
semantics, so I can't get rid of it until SMB1 is removed.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 21:58:25 +0000 (14:58 -0700)]
s3: smbd: Remove dptr_close().
No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 21:56:42 +0000 (14:56 -0700)]
s3: smbd: Remove dptr_close() from dptr_closecnum().
Now we're handle-based close_file() already does
what is needed to shut down directory enumeration.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:55:25 +0000 (13:55 -0700)]
s3: smbd: Remove dptr_close() from reply_findclose().
Now we're handle-based close_file() already does
what is needed to shut down directory enumeration.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:54:43 +0000 (13:54 -0700)]
s3: smbd: Remove dptr_close() from call_trans2findnext().
Now we're handle-based close_file() already does
what is needed to shut down directory enumeration.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:53:33 +0000 (13:53 -0700)]
s3: smbd: Remove dptr_close() from call_trans2findfirst().
Now we're handle-based close_file() already does
what is needed to shut down directory enumeration.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:37:02 +0000 (13:37 -0700)]
s3: smbd: Remove dptr_close() from reply_fclose().
Now we're handle-based close_file() already does
what is needed to shut down directory enumeration.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:35:57 +0000 (13:35 -0700)]
s3: smbd: Remove dptr_close() from reply_search().
Now we're handle-based close_file() already does
what is needed to shut down directory enumeration.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:45:16 +0000 (13:45 -0700)]
s3: smbd: Remove dptr_fsp(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:43:43 +0000 (13:43 -0700)]
s3: smbd: Replace dptr_fsp() with dptr_fetch_lanman2_fsp() in reply_findclose().
Now we have no users of dptr_fsp() left.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:28:53 +0000 (13:28 -0700)]
s3: smbd: Remove dptr_fetch_lanman2() - unused.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:26:40 +0000 (13:26 -0700)]
s3: smbd: Convert call_trans2findnext() to use dptr_fetch_lanman2_fsp().
dptr_fetch_lanman2() is now no longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:20:08 +0000 (13:20 -0700)]
s3: smbd: Add dptr_fetch_lanman2_fsp() - to replace dptr_fetch_lanman2().
Not yet used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:16:37 +0000 (13:16 -0700)]
s3: smbd: Remove dptr_fetch() - replace internals with dptr_fetch_fsp().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:11:57 +0000 (13:11 -0700)]
s3: smbd: Replace dptr_fetch() with dptr_fetch_fsp() in reply_search().
We now no longer use dptr_fetch().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:07:33 +0000 (13:07 -0700)]
s3: smbd: Replace dptr_fetch() with dptr_fetch_fsp() in reply_fclose().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 20:05:43 +0000 (13:05 -0700)]
s3: smbd: Add dptr_fetch_fsp() for SMB1 code. We will use this to replace dptr_fetch().
Not yet used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Tue, 16 Jul 2019 16:44:25 +0000 (09:44 -0700)]
s3: smbd: Remove now unused dptr_activecnum().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Tue, 16 Jul 2019 16:43:04 +0000 (09:43 -0700)]
s3: smbd: All directory enumeration is now via file handles - remove unneeded code in idle connections.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Tue, 16 Jul 2019 16:41:39 +0000 (09:41 -0700)]
s3: smbd: Remove now unused dptr_closepath().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Tue, 16 Jul 2019 16:39:54 +0000 (09:39 -0700)]
s3: smbd: Now we properly open file handles for directory enumerations, we don't need this code in SMB1rmdir.
The share mode exclusion will prevent deletion of open directory
enumeration handles.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 22:25:11 +0000 (15:25 -0700)]
s3: smbd: Now we are always using fsp handle-based client searches, simplify smb_Dir_destructor().
We know we always have a dir_hnd->dir and dir_hnd->fsp.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 22:21:21 +0000 (15:21 -0700)]
s3: smbd: Now we're using OpenDir_fsp() all the time, make sure we don't leak file handles.
We must always set dir_hnd->fsp, even in the fallback to
SMB_VFS_OPENDIR() case. Remember if we had to fall back
and fix the destructor to close the additional file
descriptor if we did.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 18:21:12 +0000 (11:21 -0700)]
s3: smbd: Now we always use handle for directory enumeration, we can delete the fallback code.
The code inside open_dir_safely() is root safe
and can replace the deleted open_dir_with_privilege()
fallback code.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Tue, 16 Jul 2019 00:13:33 +0000 (17:13 -0700)]
s3: smbd: Convert SMB1 reply_search() to use handle-based directory enumeration.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Tue, 16 Jul 2019 00:06:52 +0000 (17:06 -0700)]
s3: smbd: Convert SMB1 call_trans2findfirst() to use handle-based directory enumeration.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 17:46:09 +0000 (10:46 -0700)]
s3: smbd: Prepare for SMB1 directory handle opens in call_trans2findnext()
Call close_file() on any SMB1 directory handle once the dptr is closed.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 17:45:14 +0000 (10:45 -0700)]
s3: smbd: Prepare for SMB1 directory handle opens in call_trans2findfirst()
Call close_file() on any SMB1 directory handle once the dptr is closed.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 17 Jul 2019 17:42:21 +0000 (10:42 -0700)]
s3: smbd: Prepare for SMB1 directory handle opens in reply_findclose()
Call close_file() on any SMB1 directory handle once the dptr is closed.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>