Jeremy Allison [Wed, 25 Mar 2020 23:20:23 +0000 (16:20 -0700)]
s3: smbd: Add a dst_original_lcomp parameter to rename_internals_fsp().
Currently passed in as dst_fname->original_lcomp in all callers
but will eventually be converted to allow original_lcomp to be
removed from struct smb_filename.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 19:35:26 +0000 (12:35 -0700)]
s3: smbd: Extract large directory case normalization code into a utility function normalize_filename_case().
It is done before the original_lcomp is extracted
from the client pathname, so the new function that
will allow us to remove original_lcomp also needs
this logic.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
s4:selftest: run samba.tests.krb5.simple_tests against ad_dc_default
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Isaac Boukris <iboukris@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Mar 27 19:54:25 UTC 2020 on sn-devel-184
selftest: we no longer need '--use-dns-faking' on Linux and FreeBSD
For now I'll leave it arround for others I haven't tested.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Mar 27 10:39:32 UTC 2020 on sn-devel-184
selftest: {offlinebackupdc,restoredc,customdc} are disconnected from other environments
These restore copies of others and better use their own resolv.conf
and use '--use-samba-tool --no-credentials' for samba_dnsupdate in order
to avoid talking to the real environments.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
selftest: correctly use RESOLV_CONF from the DC environment or "no_resolv.conf"
It's important to have the correct $resolv_conf variable within
provision(), because it also sets "RESOLV_WRAPPER_CONF" if needed,
instead of just setting "RESOLV_CONF".
There's also no point in creating an resolv.conf with the ip addresses
for other roles than "active directory domain controller".
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Ralph Boehme [Thu, 26 Mar 2020 14:08:53 +0000 (15:08 +0100)]
smbd: use a helper variable in filename_convert_internal()
Avoids the complicated pointer-to-pointer dereferencing.
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 Mar 27 02:41:39 UTC 2020 on sn-devel-184
Ralph Boehme [Thu, 26 Mar 2020 13:49:33 +0000 (14:49 +0100)]
smbd: use filename_convert() in smb_file_rename_information()
Replaces direct calls to resolve_dfspath_wcard() and filename_convert(). On the
way to consolidate all callers of pathname processing onto filename_convert().
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 10:15:28 +0000 (11:15 +0100)]
tdbtorture: Use ARRAY_DEL_ELEMENT()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar 26 16:22:00 UTC 2020 on sn-devel-184
Volker Lendecke [Thu, 19 Mar 2020 16:00:59 +0000 (17:00 +0100)]
lib: Try nonblocking writes in writev_send()
All callers now use nonblocking sockets, so that we can optimize by
doing early writes
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Mar 25 10:41:29 UTC 2020 on sn-devel-184
Volker Lendecke [Fri, 20 Mar 2020 10:46:43 +0000 (11:46 +0100)]
libsmb: Make sure that the TCP socket is non-blocking
All traffic goes through smbXcli_base.c, and that is prepared to deal
with short writes via the conn->outgoing queue. Instead of making sure
that all callers properly set the socket nonblocking, do it here, so
that we can later optimize sending out data to the server.
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
third_party: Update resolv_wrapper to version 1.1.6
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Mar 25 08:33:17 UTC 2020 on sn-devel-184
Ralph Boehme [Mon, 23 Mar 2020 09:44:08 +0000 (10:44 +0100)]
vfs: remove SMB_VFS_OPENDIR()
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): Tue Mar 24 21:23:43 UTC 2020 on sn-devel-184
Ralph Boehme [Wed, 18 Mar 2020 15:01:17 +0000 (16:01 +0100)]
smbd: use open_internal_dirfsp_at() and OpenDir_fsp() in OpenDir()
This allows consolidating symlink safe processing of pathnames to the low-level
function non_widelink_open() used in the file open codepath via fd_open() and
the new utility function open_internal_dirfsp_at().
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Wed, 18 Mar 2020 14:59:11 +0000 (15:59 +0100)]
smbd: remove fdopendir() fallback
In order to get rid of SMB_VFS_OPENDIR, we have to require
fdopendir(). Everybody but macOS seems to have it, so RIP opendir() fallback.
This also prepares for a subsequent commit where we're going to start calling
OpenDir_fsp() from inside OpenDir(). Without removing the fallback this would
result in a recursion.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Tue, 17 Mar 2020 16:35:44 +0000 (17:35 +0100)]
smbd: simplify non_widelink_open()
As fsp->is_directory is already correctly populated by our callers, we can drop
the complicated and possibly broken logic that relies on O_DIRECTORY being
defined.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Wed, 18 Mar 2020 16:40:29 +0000 (17:40 +0100)]
vfstest: use OpenDir()
Note that as ReadDirName() returns translated names (in Windows "encoding"), in
cmd_translate_name() test we have to translate back to UNIX "encoding" to check
if the filename matches the user requested path which is also in UNIX
"encoding".
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Thu, 19 Mar 2020 10:19:48 +0000 (11:19 +0100)]
smbd: use canonicalize_connect_path() in create_conn_struct_as_root()
This fix ensures create_conn_struct_as_root() works the same way as
make_connection_snum() used in smbd for SMB sessions. Without this any caller of
create_conn_struct_as_root() will fail to use work on shares if the sharepath
contains a symlink.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>