1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

54516 Commits

Author SHA1 Message Date
Ralph Boehme
9edd7268b6 smbd: remove struct privilege_paths
The last user of this had been removed by
d485c43cc7.

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 31 19:32:12 UTC 2020 on sn-devel-184
2020-03-31 19:32:11 +00:00
Jeremy Allison
1cc250b46e s3: smbd: RIP smb_filename->original_lcomp.
Removed from struct smb_filename. You will not be missed :-).
Note that VFS ABI modified.

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 Mar 30 16:23:45 UTC 2020 on sn-devel-184
2020-03-30 16:23:45 +00:00
Jeremy Allison
d875f60e97 s3: smbd: Remove UCF_SAVE_LCOMP flag. Note it is no longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:31 +00:00
Jeremy Allison
e0d3190b4b s3: smbd: Remove all references to original_lcomp from name copying code.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:31 +00:00
Jeremy Allison
79b945d44e s3: smbd: Now we no longer use it, remove all references to original_lcomp from pathname processing code.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:31 +00:00
Jeremy Allison
5104ec8dec s3: smbd: Use get_original_lcomp() inside smb_file_rename_information().
Pass to rename_internals_fsp() and rename_internals().

Removes the last uses of the struct member original_lcomp
outside of the filename and struct util copying code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:31 +00:00
Jeremy Allison
d7f2143206 s3: smbd: Use get_original_lcomp() inside smb2_file_rename_information().
Pass to rename_internals_fsp(). Note this is a logic change,
as the original code only set smb_fname->original_lcomp if
it was doing a stream rename. Inside rename_internals_fsp()
we only look at original_lcomp in the stream rename case, so
this code worked. However, it is much safer to always correctly
create dst_original_lcomp than pass in a NULL here. It won't
hurt if it's not actually looked at.

Removes one more use of the struct member original_lcomp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:31 +00:00
Jeremy Allison
aa80e9732f s3: smbd: Use get_original_lcomp() inside reply_mv().
Pass to rename_internals().

Removes one more use of the struct member original_lcomp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:31 +00:00
Jeremy Allison
7d2cb52163 s3: smbd: Use get_original_lcomp() inside reply_ntrename().
Pass to rename_internals().

Removes one more use of the struct member original_lcomp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:30 +00:00
Jeremy Allison
d540819395 s3: smbd: Inside rename_internals() wildcard case, re-purpose dst_original_lcomp.
Pass to rename_internals_fsp() instead of using smb_fname_dst->original_lcomp.

Removes one more use of the struct member original_lcomp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:30 +00:00
Jeremy Allison
6c6e5d52ea s3: smbd: Add 'const char *dst_original_lcomp' parameter to rename_internals()
Pass through the existing smb_fname_dst->original_lcomp
parameter so no logic change. Preparing to remove the
use of original_lcomp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:30 +00:00
Jeremy Allison
6c53372a3e s3: smbd: Reformatting caller of rename_internals() to make it easer to see changed parameters.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:30 +00:00
Jeremy Allison
454ecaf3b4 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>
2020-03-30 14:45:30 +00:00
Jeremy Allison
614b300301 s3: smbd: Reformatting callers of rename_internals_fsp() to make it easer to see changed parameters.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:30 +00:00
Jeremy Allison
500037f218 s3: smbd: Remove use of smb_fname->original_lcomp from call_trans2findfirst().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:30 +00:00
Jeremy Allison
9d785ae517 s3: smbd: Remove use of smb_fname->original_lcomp from smb2 query directory.
Use get_original_lcomp() call. Removes one use of smb_fname->original_lcomp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:30 +00:00
Jeremy Allison
f88c36b394 s3: smbd: Add utility function get_original_lcomp().
Gets the last component from a client passed-in
filename. Copes with @GMT snapshot and MS-DFS names.

Preparing to remove original_lcomp from
struct smb_filename.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-30 14:45:30 +00:00
Jeremy Allison
dd015436b3 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>
2020-03-30 14:45:30 +00:00
Stefan Metzmacher
05d3a909d5 selftest: use 10.53.57.0/8 instead of 127.0.0.1/8
This makes our testing much more realistic and allows
the removal of some knowfail entries.

It also means the testing with network namespaces on Linux
can use the same addresses as our socket wrapper testing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-03-27 09:02:38 +00:00
Stefan Metzmacher
1c0eed6ba7 s3:util_sec: fix the build on non-linux platforms
This fixes a regression introduced by
"util_sec.c: Move __thread variable to global scope"
(5a80f399b5).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-03-27 09:02:37 +00:00
Ralph Boehme
fe78216b1c 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
2020-03-27 02:41:39 +00:00
Ralph Boehme
41fbfc279b 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>
2020-03-27 01:06:30 +00:00
Ralph Boehme
cd8c229d24 smbd: modernize DEBUG in unix_convert()
I'm also consolidating on level 10 instead of 5 for "debug" level messages, as
that what's tend to be the canonical debug level these days.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-27 01:06:30 +00:00
Ralph Boehme
855a354686 smbd: turn (*orig_path != '/') assert into a normal if check
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-27 01:06:30 +00:00
Ralph Boehme
c77530a04f smbd: consolidate comments in unix_convert()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-27 01:06:30 +00:00
Ralph Boehme
63cbc330ea smbd: modernize unix_convert() replacing True with true
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-27 01:06:30 +00:00
Ralph Boehme
8185745084 smbd: modernize unix_convert() replacing False with false
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-27 01:06:30 +00:00
Ralph Boehme
c4897903be smbd: initialize end to NULL in unix_convert()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-27 01:06:30 +00:00
Ralph Boehme
9565c8f99a smbd: leave start at NULL, it's not used before being set to smbfname->basename
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-27 01:06:29 +00:00
Volker Lendecke
356fdb0b65 vfs_fruit: Use ARRAY_DEL_ELEMENT() in del_fruit_stream()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Volker Lendecke
85cb86d7c6 vfs_fruit: Use ARRAY_DEL_ELEMENT() in filter_empty_rsrc_stream()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Volker Lendecke
eadbaabca1 libsmb: Use ARRAY_DEL_ELEMENT() in remove_duplicate_addrs2()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Volker Lendecke
29b591d972 smbd: Use ARRAY_DEL_ELEMENT() in merge_default_aces()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Volker Lendecke
a6de3d2046 smbd: Use ARRAY_DEL_ELEMENT() in smbd_smb1_blocked_locks_cleanup()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Volker Lendecke
4ac624086b smbd: Use ARRAY_DEL_ELEMENT() in brl_unlock_windows_default()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Volker Lendecke
ac71d6b2f8 smbcacls: Use ARRAY_DEL_ELEMENT() in sort_acl()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Volker Lendecke
0f53715a55 sharesec: Use ARRAY_DEL_ELEMENT() in sort_acl()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Volker Lendecke
487ca0754d libsmb: Use ARRAY_DEL_ELEMENT() in sort_acl()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Volker Lendecke
0e14156c92 lib: Use ARRAY_DEL_ELEMENT in messaging_dispatch_waiters()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Volker Lendecke
8946531f1f winbind: Set the parent->child sock nonblocking
The parent goes through wb_simple_trans_send(), which deals with short
writes fine.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-03-25 09:04:28 +00:00
Ralph Boehme
2a5d994b1a 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
2020-03-24 21:23:43 +00:00
Ralph Boehme
54e0f25071 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>
2020-03-24 19:48:41 +00:00
Ralph Boehme
45f62cece0 smbd: add open_internal_dirfsp_at()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-24 19:48:41 +00:00
Ralph Boehme
af62268311 smbd: reformat OpenDir() function definition
Gives a nicer diff in the next commit. No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-24 19:48:41 +00:00
Ralph Boehme
b6bcc4bddc smbd: update smb_Dir_destructor() to cope with fsp->dptr not being set
Currently the only caller of OpenDir_fsp() is dptr_create() which means
fsp->dptr will always be set by dptr_create().

A subsequent commit will add another caller so that fsp->dptr will end up being
NULL.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-24 19:48:41 +00:00
Ralph Boehme
6dccfd63a8 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>
2020-03-24 19:48:41 +00:00
Ralph Boehme
d961608ce9 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>
2020-03-24 19:48:41 +00:00
Ralph Boehme
38cce1bccb vfs_shadow_copy2: use create_internal_dirfsp_at() and SMB_VFS_FDOPENDIR()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-24 19:48:41 +00:00
Ralph Boehme
974ea2ce34 smbd: add create_internal_dirfsp_at()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-24 19:48:41 +00:00
Ralph Boehme
4d28b614af vfs_shadow_copy: use OpenDir() in shadow_copy_get_shadow_copy_data()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-24 19:48:41 +00:00