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

131941 Commits

Author SHA1 Message Date
Volker Lendecke
4f69b76fa1 smbd: Move smb_set_posix_acl() to smb1_trans2.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
19c41395e5 smbd: Make get_posix_fsp() public
This will go static again soon.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
b0dfee968a smbd: smbd_do_qfilepathinfo() does not need lock_data anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
e53988cdea smbd: Handle SMB_QUERY_POSIX_LOCK() in call_trans2qfileinfo()
smbd_do_qfilepathinfo() does not use the lock data anymore, we can
pass NULL/0 now.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
ad453a3827 smbd: Remove two variables never set after initialization
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
2be0e68ec5 smbd: Move SMB_SET_FILE_UNIX_[BASIC|INFO2] to smb1_trans2.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
483aa41480 smbd: Make map_info2_flags_to_sbuf() public
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
1c21fc72e9 smbd: Make smb_set_file_size() public
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
765f9bcf66 smbd: Move handling smb_set_posix_lock() to smb1_trans2.c
Most of this is direct cut&paste without reformatting.

Don't pass SMB_SET_POSIX_LOCK through smbd_do_setfilepathinfo(),
directly handle it in call_trans2setfileinfo() where we know we have a
fsp.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
2cef6fcd6d smbd: Move smb_set_file_unix_hlink() to smb1_trans2.c
Most of this is direct cut&paste without reformatting.

Don't pass SMB_SET_FILE_UNIX_HLINK through smbd_do_setfilepathinfo(),
directly handle it in call_trans2setpathinfo() where we know we have a
path.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
5273c1da12 smbd: Move smb_set_file_unix_link() to smb1_trans2.c
Most of this is direct cut&paste without reformatting.

Don't pass SMB_SET_FILE_UNIX_LINK through smbd_do_setfilepathinfo(),
directly handle it in call_trans2setpathinfo() where we know we have a
path.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
cabef72469 smbd: Move smb_posix_unlink() to smb1_trans2.c
Most of this is direct cut&paste without reformatting.

Don't pass SMB_POSIX_PATH_UNLINK through smbd_do_setfilepathinfo(),
directly handle it in call_trans2setpathinfo() where we know we have a
path.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
bcc621a69f smbd: Make smb_set_file_disposition_info() public
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
38b15fada2 smbd: Move smb_posix_open() to smb1_trans2.c
Most of this is direct cut&paste without reformatting.

Don't pass SMB_POSIX_PATH_OPEN through smbd_do_setfilepathinfo(),
directly handle it in call_trans2setpathinfo() where we know we have a
path.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
58287995e5 smbd: Make store_file_unix_basic[_info2] public
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
bad8aa10cd smbd: Factor out handle_trans2qfilepathinfo_result()
The error handling will be used in other places.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
5f7d16dbef smbd: Simplify call_trans2qfilepathinfo()
Move the file/path specific preparations to the respective callers.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
d66dc81671 smbd: Fix qfileinfo profiling
This ran under qpathinfo profiling

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
3b76bc9689 smbd: Remove call_trans2setfilepathinfo()
What's left was just a simple wrapper around smbd_do_setfilepathinfo()
and handle_trans2setfilepathinfo_result()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
5f38f23668 smbd: Factor out handle_trans2setfilepathinfo_result()
This will be lifted up in the next patches. We can also remove the
REALLOC of *pparams, for this we only ever send 2 NULL bytes that we
stack-allocate now.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
f72572ff6f smbd: Simplify call_trans2setfilepathinfo()
Move the file/path specific preparations to the respective callers.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Volker Lendecke
6619b16fec smbd: Fix setfileinfo profiling
This ran under setpathinfo profiling

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-04 08:54:32 +00:00
Jeremy Allison
c9a6e242d1 s3: smbd: Strip any leading '\\' characters if the SMB2 DFS flag is set.
MacOS clients send SMB2 DFS pathnames as \server\share\file\name.

Ensure smbd can cope with this by stipping any leading '\\'
characters from an SMB2 packet with the DFS flag set.

Remove knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan  4 07:46:06 UTC 2023 on sn-devel-184
2023-01-04 07:46:06 +00:00
Jeremy Allison
d99d14cbc1 s3: smbtorture: Add SMB2-DFS-FILENAME-LEADING-BACKSLASH test.
Shows that we fail to cope with MacOSX clients that send a
(or more than one) leading '\\' character for an SMB2 DFS pathname.

I missed this in earlier tests as Windows, Linux, and
libsmbclient clients do NOT send a leading backslash
for SMB2 DFS paths. Only MacOSX (sigh:-).

Passes against Windows. Adds a knownfail for smbd.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2023-01-04 06:50:37 +00:00
Andrew Walker
01cdc5e00b lib/replace - add extra check to bsd_attr_list
The FreeBSD extattr API may return success and truncated
namelist. We need to check for this in bsd_attr_list to
ensure that we don't accidentally read off the end of the
buffer. In the case of a truncated value, the pascal
strings for attr names will reflect the lengths as if
the value were not truncated. For example:
`58DosStrea`

In case of short read we now set error to ERANGE and
fail.

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

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Jan  2 14:27:23 UTC 2023 on sn-devel-184
2023-01-02 14:27:23 +00:00
Stefan Metzmacher
a6136b8817 Happy New Year 2023!
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Jan  1 00:24:02 UTC 2023 on sn-devel-184
2023-01-01 00:24:02 +00:00
Stefan Metzmacher
f28553105b s3:rpc_server/srvsvc: make sure we (re-)load all shares as root.
This fixes a regression in commit f03665bb7e

The use of reload_services() has a lot of side effects, e.g. reopen of
log files and other things, which are only useful in smbd, but not in rpcd_classic.
It was also unloading the user and registry shares we loaded a few lines
above.

We need to do all (re-)loading as root, otherwise we won't be able
to read root only smb.conf files, access registry shares, ...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Walker <awalker@ixsystems.com>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Dec 29 21:14:02 UTC 2022 on sn-devel-184
2022-12-29 21:14:02 +00:00
Stefan Metzmacher
a00c7395fb selftest: add samba3.blackbox.registry_share
This demonstrates the regression introduced by
f03665bb7e, where
registry shares are no longer listed.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Walker <awalker@ixsystems.com>
2022-12-29 20:12:28 +00:00
Andreas Schneider
08be04bb93 s4:setup:tests: Use system ldbdump if we build with system ldb
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Dec 23 15:31:31 UTC 2022 on sn-devel-184
2022-12-23 15:31:31 +00:00
Andreas Schneider
6b4cc4ccbc python:tests: Use system ldbsearch if we built against system libldb
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
9ac8dac6db python:tests: Use system ldbdump if we build with system ldb
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
11be7d802d python:tests: Use system ldbsearch if we build with system libldb
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
5bed51fc6f nsswitch:tests: Use system_or_builddir_binary() for test_rfc2307_mapping
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
eb6f74bd74 testprogs: Use system_or_builddir_binary() for upgradeprovision-oldrelease
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
40eeec0fff testprogs: Use system_or_builddir_binary() for tombstones-expunge
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
39468deb73 testprogs: Use system_or_builddir_binary() for test_trust_token
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
1106ef7189 testprogs: Use system_or_builddir_binary() for test_special_group
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
7c46c79a22 testprogs: Use system_or_builddir_binary() for test_primary_group
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
605155f296 testprogs: Use system_or_builddir_binary() for test_pkinit_simple
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
56b9723816 testprogs: Use system_or_builddir_binary() for test_pkinit_pac
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
c6cd126327 testprogs: Use system_or_builddir_binary() for test_old_enctypes
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
535bc5dca7 testprogs: Use system_or_builddir_binary() for test_net_ads_dns
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
376ca5a108 testprogs: Use system_or_builddir_binary() for test_net_ads
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
d891e59088 testprogs: Use system_or_builddir_binary() for test_ldb_simple
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
c11f1912c9 testprogs: Use system_or_builddir_binary() for test_ldb
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
7baa3e13f2 testprogs: Use system_or_builddir_binary() for test_ktpass
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
fa5cba8f6f testprogs: Use system_or_builddir_binary() for test_kinit_mit
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
c9ca0f796c testprogs: Use system_or_builddir_binary() for test_kinit_heimdal
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
6b7e505963 testprogs: Use system_or_builddir_binary() for test_client_kerberos
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00
Andreas Schneider
6847110004 testprogs: Use system_or_builddir_binary() for renamedc
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-12-23 14:35:31 +00:00