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

121885 Commits

Author SHA1 Message Date
Volker Lendecke
4a9fe4efef libsmb: Protect cli_RNetShareEnum() against rprcnt<6
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-05 15:35:35 +00:00
Volker Lendecke
ae91d67a24 libsmb: Fix indentation in cli_RNetShareEnum()
Also remove a level of indentation with a "goto done;"

Best review with "git show -b", almost no code change

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-05 15:35:35 +00:00
Volker Lendecke
1be128eeed smbd: Make share_mode_for_one_entry() use just a uint8*
"num_share_modes" is passed separately, so "data.dsize" was not used

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): Tue May  5 13:23:49 UTC 2020 on sn-devel-184
2020-05-05 13:23:49 +00:00
Volker Lendecke
733ae9cd95 smbd: Make share_mode_do_locked() use a const uint8_t *
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:40 +00:00
Volker Lendecke
14cc4a6576 smbd: Make parse_share_modes() use a const ptr
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:40 +00:00
Volker Lendecke
b2dfd4cc53 smbd: Make share_mode_memcache_fetch() use a const ptr
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:40 +00:00
Volker Lendecke
955b3c3de9 smbd: Convert get_share_mode_blob_header() to use a const ptr
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:40 +00:00
Volker Lendecke
7905afcd77 smbd: Make share_mode_entry_find() take a const pointer
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
6d3399906f smbd: Make sure share_mode_entry_do() maintains sorting order
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
7c3cce9888 smbd: Simplify reset_share_mode_entry()
This has more lines, but it's a lot simpler: reset_share_mode_entry is
only called during durable reconnect, which only works with a single
share mode entry. See durable_reconnect_fn(). Thus we don't have to
keep the share mode array sorted, there is just a single entry.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
7cd687fd05 smbd: Simplify share_mode_entry_get()
If we don't use a DATA_BLOB, we can more correctly state in the
prototype that the buffer we parse is constant.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
2e3be1394c libsmb: Add a NULL check
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
157554f3d8 libsmb: Align integer types in net_share_enum_rpc()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
3d2abb6772 libsmb: Use talloc_strndup() to cut a backslash
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
2d6448a3df libsmb: Add a NULL check after talloc_strdup()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
1226f43549 lib: Move push_skip_string() to clirap2.c
It's only used there

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
1814c14f71 librpc: Align integer types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
909c82fe03 net: Add g_lock dumpall
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
50a1e995cb net: "net g_lock locks" needs to print binary keys
In 2017 g_lock changed to take TDB_DATA as a key

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
abae5889d9 rpc_server3: Align integer types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:38 +00:00
Volker Lendecke
0ad9273961 lib: Fix a comment
The "deleted bit" went away with 341223a005

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:38 +00:00
Volker Lendecke
78737c6869 lib: Remove two unused macro definitions
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:38 +00:00
Volker Lendecke
d0deaf90e5 torture4: Move a variable declaration closer to its use
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:38 +00:00
Volker Lendecke
b3dec1bc1f registry3: Align a few integer types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:38 +00:00
Volker Lendecke
e96f6b0f88 locking: Move br_off typedef to where it's used
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:38 +00:00
Volker Lendecke
489023e481 locking: Move SMB_OFF_T_BITS macro to its only user
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:38 +00:00
Volker Lendecke
652242f542 vfs_virusfilter: Fix canonicalizing socket path
canonicalize_absolute_path() returns its result, the previous code was
a no-op

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:38 +00:00
Volker Lendecke
e3e902f570 vfs_widelinks: Fix small typos
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:38 +00:00
Jule Anger
0847f56f24 pytdb tests: add test for storev()
Signed-off-by: Jule Anger <ja@sernet.de>
Reviewed-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 May  5 11:24:52 UTC 2020 on sn-devel-184
2020-05-05 11:24:52 +00:00
Jule Anger
4d42497441 pytdb: add python binding for storev()
Signed-off-by: Jule Anger <ja@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-05-05 09:40:26 +00:00
Jeremy Allison
29cbfd0ba3 s3: smbd: Add a dirfsp parameter to smbd_calculate_maximum_allowed_access().
Not yet used. Currently always conn->cwd_fsp.

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 May  4 15:33:09 UTC 2020 on sn-devel-184
2020-05-04 15:33:08 +00:00
Jeremy Allison
976a60304a s3: smbd: Reformat users of smbd_calculate_maximum_allowed_access().
Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:34 +00:00
Jeremy Allison
a20d06675f s3: smbd: Add a dirfsp parameter to smbd_calculate_access_mask().
Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:34 +00:00
Jeremy Allison
c7144b7acd s3: smbd: Reformat users of smbd_calculate_access_mask().
Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:34 +00:00
Jeremy Allison
66a4e6b5c6 s3: smbd: Add a dirfsp parameter to check_parent_access().
Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:34 +00:00
Jeremy Allison
3e6e9e4281 s3: smbd: Reformat users of check_parent_access().
Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:34 +00:00
Jeremy Allison
c9c8c83ca2 s3: smbd: Add a dirfsp parameter to user_can_read_file().
Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:33 +00:00
Jeremy Allison
f24e1abeee s3: smbd: Reformat users of user_can_read_file().
Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:33 +00:00
Jeremy Allison
49ec754fca s3: smbd: Add a dirfsp parameter to smbd_check_access_rights().
Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:33 +00:00
Jeremy Allison
b4acf74049 s3: smbd: Reformat users of smbd_check_access_rights().
Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:33 +00:00
Jeremy Allison
7c1f1e5243 s3: smbd: Add dirfsp parameter to can_write_to_file().
Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:33 +00:00
Jeremy Allison
21d16fe212 s3: smbd: Reformat users of can_write_to_file().
Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:33 +00:00
Jeremy Allison
18f67e354f s3: smbd: Add dirfsp parameter to user_can_write_file().
Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:32 +00:00
Jeremy Allison
6d83b785cf s3: smbd: Reformat caller of user_can_write_file().
Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:32 +00:00
Jeremy Allison
839a2fb7a5 s3: smbd: Add dirfsp parameter to can_delete_file_in_directory().
Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:32 +00:00
Jeremy Allison
1a53b81a7b s3: smbd: Reformat definition and callers of can_delete_file_in_directory().
Makes future addition of parameter easier to see.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-04 13:55:32 +00:00
Andrew Bartlett
906aa7ddb8 CVE-2020-10700: dsdb: Do not permit the ASQ control for the GUID search in paged_results
ASQ is a very strange control and a BASE search can return multiple results
that are NOT the requested DN, but the DNs pointed to by it!

Thanks to Andrei Popa <andrei.popa@next-gen.ro> for finding,
reporting and working with us to diagnose this issue!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14331

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>

Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Mon May  4 10:14:28 UTC 2020 on sn-devel-184
2020-05-04 10:14:28 +00:00
Andrew Bartlett
c309e6b2a7 CVE-2020-10700: ldb: Always use ldb_next_request() in ASQ module
We want to keep going down the module stack, and not start from the top again.

ASQ is above the ACL modules, but below paged_results and we do not wish to
re-trigger that work.

Thanks to Andrei Popa <andrei.popa@next-gen.ro> for finding,
reporting and working with us to diagnose this issue!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14331

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2020-05-04 08:19:41 +00:00
Andrew Bartlett
5603d26770 CVE-2020-10700: dsdb: Add test for ASQ and ASQ in combination with paged_results
Thanks to Andrei Popa <andrei.popa@next-gen.ro> for finding,
reporting and working with us to diagnose this issue!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14331

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2020-05-04 08:19:41 +00:00
Gary Lockyer
bac809348a CVE-2020-10704 libcli ldap: Check search request lengths.
Check the search request lengths against the limits passed to
ldap_decode.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Mon May  4 04:40:10 UTC 2020 on sn-devel-184
2020-05-04 04:40:10 +00:00