1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

140292 Commits

Author SHA1 Message Date
Ralph Boehme
8831eec914 docs-xml: enable SMB3 Unix Extensions by default
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Mar  7 20:06:31 UTC 2025 on atb-devel-224
2025-03-07 20:06:31 +00:00
Ralph Boehme
a2f127db4a s3/param: remove widelinks check and warning for SMB3 UNIX Extensions
SMB3 POSIX clients won't be able to create real symlinks, so we can relax these
checks.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2025-03-07 19:00:32 +00:00
Ralph Boehme
e8b49a59ee s3:locking: make sure brl_conflict_posix() is only called with 2 POSIX_LOCKS
Otherwise we hit the assert if the caller is a windows lock
and the conflicting one a posix lock.

Or in the non-developer build we don't enforce the windows locking
rules.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2025-03-07 19:00:32 +00:00
Ralph Boehme
0a1e363815 s3:locking: assert POSIX_LOCK in brl_[un]lock_posix()
This makes it clearer and prevents possible problems in future.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2025-03-07 19:00:32 +00:00
Stefan Metzmacher
c779bb7c85 s3:locking: init_strict_lock_struct() already calls lp_posix_cifsu_locktype()
There is no need to do it in the caller and pass an unused argument.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-07 19:00:32 +00:00
Ralph Boehme
2bdf72a822 smbd: fix lock_flav initialization in smbd_smb2_lock_send()
Right above we did

        if (posix_handle) {
                locks[i].lock_flav = POSIX_LOCK;
        } else {
                locks[i].lock_flav = WINDOWS_LOCK;
        }

which came in with commit f68fffa85d1de992384a210bb0b9261cda3fb168,
apparently forgetting to remove the previously existing initialization
locks[i].lock_flav=WINDOWS_LOCK.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2025-03-07 19:00:32 +00:00
Ralph Boehme
ce8a65054d smbd: fix check for POSIX opens in have_file_open_below()
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2025-03-07 19:00:32 +00:00
Ralph Boehme
6e662bf578 smbd: fix checks for POSIX opens in file_find_subpath()
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2025-03-07 19:00:32 +00:00
Anoop C S
a96f0542c8 vfs_ceph_new: Do not resolve by inode number
CephFS snapshots within snap directory shares the same inode number from
its parent. Until unless we resolve by name we may incorrectly point at
an inode which is not a snapshot directory. Therefore to be functionally
correct we avoid resolving by inode number but proper name.

For example:

path (ino = 3)
  |
  --- dir (ino = 4)
  |
  --- .snap (ino = 3)
        |
        --- snap1 (ino = 3)
              |
              --- dir (ino = 4)

In this case an attempt to resolve 'snap1' by inode number 3 results in
pointing at 'path' which is not the desired outcome.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Mar  7 18:20:47 UTC 2025 on atb-devel-224
2025-03-07 18:20:47 +00:00
Anoop C S
9341d7fb46 vfs_ceph_new: Handle absolute path in vfs_ceph_ll_walk
It can very well be the case that the incoming path is absolute in
nature which breaks the assumption inside vfs_ceph_ll_walk that it
is within the current working directory. Instead perform a check to
see whether the path includes current working directory path in its
components and accordingly trim it to make it relative in nature.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2025-03-07 17:15:35 +00:00
Anoop C S
ee1c3e1db9 vfs_ceph_new: Remove unused code in cephmount_mount_fs()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15818

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2025-03-07 17:15:35 +00:00
Anoop C S
c5ddd94a08 vfs_ceph_new: Remove redundant re-intialization to NULL
TALLOC_FREE() by default re-initializes the pointer to NULL after
corresponding memory is freed.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2025-03-07 17:15:35 +00:00
Stefan Metzmacher
0d7ea9cfb6 s4:auth: let auth_user_info_dc_expand_sids() add This Organization SID
We do that unless the Other Organization SID is already there.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Mar  6 17:35:50 UTC 2025 on atb-devel-224
2025-03-06 17:35:50 +00:00
Stefan Metzmacher
86ed8753fa s4:dsdb/tests: let the token_group.py test work against Windows 2025
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-06 16:32:35 +00:00
Volker Lendecke
864f392945 vfs: Simplify DBGs
Avoid casts: We have PRIu64, size_t is printed with %zu. Only off_t
must be cast to intmax_t, but for that we should not need a macro.

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): Wed Mar  5 18:42:03 UTC 2025 on atb-devel-224
2025-03-05 18:42:03 +00:00
Volker Lendecke
dd97a210d4 lib: Remove unused next_token()
Replaced by next_token_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:34 +00:00
Volker Lendecke
1362db6f07 torture4: Test next_token_talloc() instead of next_token()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:34 +00:00
Volker Lendecke
762cd4f759 nsswitch: Remove next_token() from torture4
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:34 +00:00
Volker Lendecke
ae5cda81af nsswitch: Remove next_token() from wbinfo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:34 +00:00
Volker Lendecke
d83d270cfa smbd: Remove unused recursive_rmdir()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:34 +00:00
Volker Lendecke
d7879ef848 vfs: Rewrite vfs_streams_depot
This started when I found vfs_streams_depot() is the last user of
recursive_rmdir() and ended as a pretty complete rewrite. Why? This
new version does not call the path-based NEXT_[L]STAT routines
anymore, it only uses FSTATAT. This is one tiny step towards getting
rid of the path-based calls we still have that implicitly depend on
the current working directory. In some distant future I want to get
rid of our chdir() calls and do everything relative to a O_PATH handle
that we opened on the share root when connecting to a share.

This patch removes a few lines, and I don't see a reasonable way to do
this in micro-steps. Structurally it should be simple though:
Everything works off streams_depot_rootdir_pathref(), which gives a
pathref fsp to the ".streams" directory, stream_dir_pathref() turns
this into a pathref of the actual per-file subdirectory.

We also have to remove the special handling of absolute paths in
vfs_shadow_copy2, streams_depot does not send absolute paths anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:34 +00:00
Volker Lendecke
b1748dcc0a vfs: Slightly simplify streams_depot_fstreaminfo()
Use metadata_fsp()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:34 +00:00
Volker Lendecke
c3687ed939 smbd: Make recursive_rmdir_fsp() public
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:34 +00:00
Volker Lendecke
7240a7483d vfs: We expect sane callers of SMB_VFS_RENAMEAT
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:34 +00:00
Volker Lendecke
0164041e01 libsmb: Save lines with a direct variable initialization
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:34 +00:00
Volker Lendecke
3f0d96bc8f libsmb: Simplify smbXcli_req_unset_pending()
We have ARRAY_DEL_ELEMENT() for this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-05 17:41:33 +00:00
Felix Bussmann
e3830f2fe4 smbclient3: Replacing Echos in the cli status check with TCP status check.
Replacing the echoes, which were being sent every 5 seconds by the client for a CLI status check, with a method that checks the status of the file descriptor instead, for a POLLHUP, POLLRDHUP, or a timeout.

Signed-off-by: Felix Bussmann <feb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Mar  5 16:21:34 UTC 2025 on atb-devel-224
2025-03-05 16:21:34 +00:00
Ralph Boehme
a3f129f663 s3:smbd: disable "vfs mkdir use tmp name = auto" on OpenBSD
This is the simplest way to avoid a regression.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Mar  5 12:37:40 UTC 2025 on atb-devel-224
2025-03-05 12:37:40 +00:00
Martin Schwenke
9675d8aed8 ctdb-utils: Fix incorrect FSF address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15820

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Mar  5 03:40:15 UTC 2025 on atb-devel-224
2025-03-05 03:40:15 +00:00
Douglas Bagnall
92078188ef ldb: remove unused test-sqlite3.sh
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2025-03-05 02:37:39 +00:00
Douglas Bagnall
ebea46ae51 codespellrc: remove reference to non-existent file
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2025-03-05 02:37:39 +00:00
Douglas Bagnall
7be3832950 ldb: doxygen: don't mention sqlite
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2025-03-05 02:37:39 +00:00
Douglas Bagnall
6526db804b ldb:manpages: ldbedit: update url schemes
no sqlite://, but ldaps:// ldb://, mdb://.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2025-03-05 02:37:39 +00:00
Douglas Bagnall
62eca00b61 ldb: remove obsolete copy of https://ldb.samba.org
lib/ldb/web/index.html used to be the source for
https://ldb.samba.org/, but the web page has continued to evolve in
minor ways without git keeping up.

The current difference is all http:// have been converted to https://
and a few URL domains and paths have changed.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2025-03-05 02:37:39 +00:00
Douglas Bagnall
1e1503e1f8 ldb: remove unused nssldb
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2025-03-05 02:37:39 +00:00
Douglas Bagnall
25502486b1 ldb: remove unused sqlite backend
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2025-03-05 02:37:39 +00:00
Shachar Sharon
4ae9224138 vfs_ceph_new: use libcephfs nonblocking API for async-io ops
Use libcephfs non-blocking API (ceph_ll_nonblocking_readv_writev[1]) in
combination with smb VFS async hooks ({pread,pwrite,fsync}_send/_recv).
Fills libcephfs' struct ceph_ll_io_info with single iovec and
submit/complete the operation asynchronously on libcephfs side, with
corresponding tevent schedule-immediate upon completion on smbd side.

Control nonblocking/normal I/O mode via config parameter. The common
parts of async I/O (with/without HAVE_CEPH_ASYNCIO) are united.
Specifically, use same struct vfs_ceph_aio_state and common code via
helper function for all async I/O hooks. When HAVE_CEPH_ASYNCIO
is True _and_ config option 'asyncio = yes' use libcephfs asynchronous
I/O API. Otherwise, fake async operation using normal blocking APIs.

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

[1] b4e39f3ecc

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Mar  4 16:53:21 UTC 2025 on atb-devel-224
2025-03-04 16:53:21 +00:00
Pavel Filipenský
6b7b0ec970 docs-xml: Update description of dns hotsname (G)
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Mon Mar  3 10:36:29 UTC 2025 on atb-devel-224
2025-03-03 10:36:29 +00:00
9be96cf602 s3-waf: Enable build of MO files for localization
waf will now generate .mo files for pam_winbind and net when gettext support is enabled and gettext tools are available

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

Signed-off-by: Ivan Korytov <korytovip@basealt.ru>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Fri Feb 28 13:26:45 UTC 2025 on atb-devel-224
2025-02-28 13:26:45 +00:00
fa559114c3 s3:locale:pam_winbind: Update Russian translation
Unused translations are left for reference in future updates

Signed-off-by: Ivan Korytov <korytovip@basealt.ru>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2025-02-28 12:28:34 +00:00
Douglas Bagnall
f06525afff bootstrap: remove wintest-only dependency
Nobody has run Wintest in the last 10 years, and we don't need it
in our CI tests.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>

Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu Feb 27 01:00:10 UTC 2025 on atb-devel-224
2025-02-27 01:00:10 +00:00
Douglas Bagnall
deb80a60f3 bootstrap: python-cryptography is not just for tests
Relating to, but not fixing, these distro bugs:

https://bugs.launchpad.net/ubuntu/+source/samba/+bug/2099895
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1086768

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-02-27 00:02:38 +00:00
Douglas Bagnall
6c3bdb0747 smbd: avoid work in unix token debug no-op
When the debug level is too low to print, we don't need to allocate
the strings.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15737

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Pair-programmed-with: Volker Lendecke <vl@samba.org>
2025-02-27 00:02:38 +00:00
Volker Lendecke
b25e63710e libcli: avoid work in security token debug no-op
When the debug level is too low to print, we don't need to allocate
the strings.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15737

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2025-02-27 00:02:38 +00:00
Andrea Venturoli
7e083a6b3a python:tdb_util: "samba-tool domain backup offline" hangs
GNU getopt(3) is by default non-POSIX compliant and accepts options after
positional arguments (unless forced with POSIXLY_CORRECT). This is not portable,
e..g., on FreeBSD. Put options first and then positional arguments.

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

Signed-off-by: Andrea Venturoli <ml@netfence.it>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-02-27 00:02:38 +00:00
Douglas Bagnall
84919f47e1 s3:torture: report kilobytes per second as kB/s, not kb/s
https://bugzilla.samba.org/show_bug.cgi?id=11023

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-02-27 00:02:38 +00:00
Douglas Bagnall
1f6cc7f98c smbclient: report kilobytes per second as kB/s, not kb/s
https://bugzilla.samba.org/show_bug.cgi?id=11023

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-02-27 00:02:38 +00:00
Douglas Bagnall
365f4cf30d build: --disable-warnings-as-errors avoids some warning config checks
This fixes compilation with some versions of Honggfuzz.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-02-27 00:02:38 +00:00
Volker Lendecke
125862c617 vfs: Fix vfs_streams_depot's fstatat
a24c7d566f2 does not cover subdirectories

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15816
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Feb 26 09:00:34 UTC 2025 on atb-devel-224
2025-02-26 09:00:34 +00:00
Stefan Metzmacher
2dba2a31c2 python:tests/krb5: let create_trust() take {ingress,egress}_claims_tf_rules
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Feb 24 10:28:02 UTC 2025 on atb-devel-224
2025-02-24 10:28:02 +00:00