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

123455 Commits

Author SHA1 Message Date
Jeremy Allison
e59c810f26 s3: smbd: Remove unused 'bool *ppath_contains_wcard' parameter from resolve_dfspath_wcard()
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:42 +00:00
Jeremy Allison
b3334eb9d8 s3: smbd: Remove the 'bool *ppath_contains_wcard' parameter from filename_convert_internal()
It's always ignored.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:42 +00:00
Jeremy Allison
eb60ed6b5e s3: smbd: The only caller of filename_convert_with_privilege() passes in NULL for the 'bool *ppath_contains_wcard' parameter.
Remove it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:42 +00:00
Jeremy Allison
ff4e8b2c84 s3: smbd: All callers to filename_convert() pass in NULL for the 'bool *ppath_contains_wcard' parameter.
Remove it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:42 +00:00
Jeremy Allison
4d7cdefb9d s3: smbd: As srvstr_get_path_internal() ignores the wcard parameter, use check_path_syntax() instead of check_path_syntax_wcard()
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
5ea69c262d s3: smbd: Rename srvstr_get_path_wcard_internal() -> srvstr_get_path_internal().
It now does nothing with wildcards.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
7a1839ab73 s3: smbd: All callers to srvstr_get_path_wcard_internal() pass 'ignore' as the last parameter.
Move it internal to srvstr_get_path_wcard_internal().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
9392b13dff s3: smbd: Remove the wrapper srvstr_get_path_req_wcard().
Rename srvstr_get_path_req_wcard() -> srvstr_get_path_req()
as it no longer gets ward status.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
26e8bd7e1e s3: smbd: Remove srvstr_get_path_wcard() - no longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
4f0ecc7dcc s3: smbd: srvstr_get_path_wcard_posix() is no longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
9c16729a7b s3: smbd: smb_file_rename_information() doesn't need to use the wildcard status of the destination.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
bf966dc2ca s3: smbd: SMB1 call_nt_transact_rename() never needs wcard bool.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
08d029c290 s3: smbd: SMB1 reply_copy(). Use srvstr_get_path_req() not srvstr_get_path_req_wcard()
Now we check the wildcard status elsewhere. Don't pass to filename_convert() either.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
9269e9c232 s3: smbd: SMB1 reply_copy() - set the xxx_has_wild flags from the processed names.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
079aec9d09 s3: smbd: SMB1 reply_mv() no longer needs the XX_has_wcard variables.
Use srvstr_get_path_req() not srvstr_get_path_req_wcard().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:41 +00:00
Jeremy Allison
b89c0a6d3f s3: smbd: SMB1 rename_internals() can figure out the wildcard status of the paths by itself.
No need to pass them as parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
83b17f4f3e s3: smbd: SMB1 reply_unlink() - use srvstr_get_path_req() not srvstr_get_path_req_wcard()
Now unlink_internals() checks its own wildcard on the mask.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
0fbce94863 s3: smbd: SMB1 call_trans2findnext() doesn't need the mask_contains_wcard bool.
dptr already knows this.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
ed0c07e298 s3: smbd: SMB1 call_trans2findfirst(). Don't need the wildcard status of the mask here.
dptr_create() can work this out all on its own.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
96b9842e31 s3: smbd: unlink_internals() can figure out if the mask has a wildcard on its own.
Doesn't need a parameter for that.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
49be6d3867 s3: smbd: SMB1 reply_fclose() doesn't need wcard, use srvstr_get_path_req() not srvstr_get_path_req_wcard().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
edee7198d9 s3: smbd: SMB1 reply_search(). Use srvstr_get_path_req() not srvstr_get_path_req_wcard()
If we have a wildcard is found by other means now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
e3611cc05f s3: smbd: SMB1 reply_search(). The dptr already knows if the mask has a wildcard.
Get the value from the dptr instead.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
97a4dfbd4a s3: smbd: SMB1 reply_search() doesn't actually care if the mask contains a wildcard or not.
Don't pass to filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
078f2d9456 s3: smbd: In SMB2 query directory we don't need to do full path resolution of the mask component.
get_original_lcomp() does all the name canonicalization required for the mask.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
525ccadd64 s3: smbd: srvstr_get_path_req_wcard() is now static to reply.c
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:40 +00:00
Jeremy Allison
db20ef392e s3: smbd: SMB1 reply_ntrename() - now we set dest_has_wcard separately we don't need to pass it to filename_convert().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
f43c04164d s3: smbd: SMB1 reply_ntrename() - now we set dest_has_wcard separately we can use srvstr_get_path_req() instead of srvstr_get_path_req_wcard().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
c518111e11 s3: smbd: SMB1 reply_ntrename() - set dest_has_wcard from the parsed last component.
We eventually want to remove the last_component_has_wcard out of the srvstr_get_pathXXX()
calls and just use srvstr_get_path_req().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
71c4c96d97 s3: smbd: SMB1 reply_ntrename() - Move the call to get_original_lcomp() to before filename_convert() for the destination name.
Simple code re-arrangement to make the next change clear.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
b7ca811ef5 s3: smbd: SMB1 reply_ntrename() - the source cannot have a wildcard.
Simplify the wildcard processing of the source name.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
5547cc803c s3: smbd: SMB1 comment out unused UCF_COND_ALLOW_WCARD_LCOMP flag.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
e188b74aa9 s3: smbd: SMB1 Remove the crazy semantics in filename_convert_internal() using UCF_COND_ALLOW_WCARD_LCOMP.
In the places where wildcards are allowed in SMB1
we always pass in UCF_ALWAYS_ALLOW_WCARD_LCOMP.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
8d11a87ea1 s3: smbd: MS-DFS - We no longer ever set UCF_COND_ALLOW_WCARD_LCOMP so don't check for it.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
5082423f18 s3: smbd: SMB1 reply_ntrename() - the UCF_COND_ALLOW_WCARD_LCOMP makes no sense.
There's either a wildcard in the last component or not. Always use
UCF_ALWAYS_ALLOW_WCARD_LCOMP for calls that can take a wildcard.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
10e034ec21 s3: smbd: SMB1 reply_copy() - the UCF_COND_ALLOW_WCARD_LCOMP makes no sense.
There's either a wildcard in the last component or not. Always use
UCF_ALWAYS_ALLOW_WCARD_LCOMP for calls that can take a wildcard.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
38bdb082b8 s3: smbd: SMB1 reply_mv() - the UCF_COND_ALLOW_WCARD_LCOMP makes no sense.
There's either a wildcard in the last component or not. Always use
UCF_ALWAYS_ALLOW_WCARD_LCOMP for calls that can take a wildcard.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
93fcb44961 s3: smbd: SMB1 reply_unlink() - the UCF_COND_ALLOW_WCARD_LCOMP makes no sense.
There's either a wildcard in the last component or not. Always use
UCF_ALWAYS_ALLOW_WCARD_LCOMP for calls that can take a wildcard.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Jeremy Allison
33fffcd270 s3: smbd: dptr_create() doesn't need a separate wcard_has_wild parameter.
It can figure this out by itself.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-30 20:46:39 +00:00
Simo Sorce
b8653f4ee7 Restrict GSSAPI query to the krb5 mechanism
Otherwise GSSAPI will consult other mechanisms if available and we can
only cope with krb5 credentials here.

Signed-off-by: Simo Sorce <idra@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep 30 20:45:23 UTC 2020 on sn-devel-184
2020-09-30 20:45:23 +00:00
Volker Lendecke
9f24b5098f smbclient: Fix recursive mget
Make do_mget rely on do_list() already doing the recursion in a
breadth-first manner. The previous code called do_list() from within
its callback. Unfortunately the recent simplifications of do_list()
broke this, leading to recursive mget to segfault. Instead of figuring
out how this worked before the simplifications in do_list() (I did
spend a few hours on this) and fixing it, I chose to restructure
do_mget() to not recursively call do_list() anymore but instead rely
on do_list() to do the recursion. Saves quite a few lines of code and
complexity.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14517
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): Wed Sep 30 17:23:45 UTC 2020 on sn-devel-184
2020-09-30 17:23:45 +00:00
Volker Lendecke
254a5b034e test3: Add a test showing that smbclient recursive mget is broken
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14517
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-30 15:58:39 +00:00
Volker Lendecke
71bc4d4b8d smbclient: Slightly simplify do_mget()
Put the prompt query into a separate if-statement, move the "quest"
variable closer to its use

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14517
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-30 15:58:39 +00:00
Volker Lendecke
8fa451d2b0 smbclient: Remove the "abort_mget" variable
This was never set to true anywhere in the code

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14517
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-30 15:58:39 +00:00
Volker Lendecke
9d14187c95 lib: Remove an optimization in string_replace()
Why? This simplifies the code.

Why do I believe we can do this? I don't think this is a very common
operation in critical code paths. Also, next_codepoint() already has
the same optimization. If this turns out to be a measurable
performance issue, we should turn next_codepoint() into a static
inline function doing the 7-bit optimized code path inlined the same
way we did it for tdb_oob(). This way all callers would benefit from
this optimization.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-30 15:58:38 +00:00
Volker Lendecke
2c04e9a6f2 spoolss: Align some integer types
SPOOLSS_NOTIFY_MSG_CTR->num_groups is defined as uint32_t

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-30 15:58:38 +00:00
Volker Lendecke
44fd74476d spoolss: Align some integer types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-30 15:58:38 +00:00
Volker Lendecke
62237e6b97 smbd: process.c does not need libsmb.h
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-30 15:58:38 +00:00
Volker Lendecke
2915522da4 smbd: Align integer types in gid_in_use()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-30 15:58:38 +00:00
Volker Lendecke
f67c8f9562 libsmb: Make cli_smb2_list() prototype more descriptive
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-30 15:58:38 +00:00