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

138855 Commits

Author SHA1 Message Date
Anoop C S
b7843d0f42 vfs_shadow_copy2: Use VFS interface to derive mount point
shadow_copy2_find_mount_point() does direct stat() calls locally while
trying to automatically detect the mount point. This cannot be always
true as there are virtual file systems like CephFS, GlusterFS etc.
without their share path locally available on the system. Instead use
the VFS interface to make the stat calls hit the underlying file system
irrespective of their local presence in the system.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: John Mulligan <jmulligan@samba.org>

Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Feb  7 06:23:12 UTC 2025 on atb-devel-224

(cherry picked from commit c7d0adade09fa264201a125b28dd76c163451260)

Autobuild-User(v4-21-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-21-test): Fri Mar  7 10:29:28 UTC 2025 on atb-devel-224
2025-03-07 10:29:28 +00:00
Martin Schwenke
cb88260955 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

(cherry picked from commit 9675d8aed8e3368f0a797490f3bf85d8026e5acc)

Autobuild-User(v4-21-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-21-test): Wed Mar  5 17:40:45 UTC 2025 on atb-devel-224
2025-03-05 17:40:45 +00:00
Andrea Venturoli
480f27625d 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>
(cherry picked from commit 7e083a6b3a12933b79ef19ccbd4c13bfa0203498)

Autobuild-User(v4-21-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-21-test): Tue Mar  4 13:36:01 UTC 2025 on atb-devel-224
2025-03-04 13:36:01 +00:00
Douglas Bagnall
fdb73ecba3 provision: always use a large transaction index cache
A larger cache costs more per transaction, but makes a large number
of operations within a transaction faster. We expect to be dealing
with the latter case here, regardless of the batch_mode parameter
and the database size. 200000 is chosen because it is also used in
join and schemaupgrade, and should be sufficient in most cases.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Tue Feb  4 22:47:35 UTC 2025 on atb-devel-224

(cherry picked from commit e705dbbc6765454813375fee9f6a3365b947e021)

Autobuild-User(v4-21-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-21-test): Thu Feb 27 12:10:52 UTC 2025 on atb-devel-224
2025-02-27 12:10:52 +00:00
Andréas Leroux
15232a6287 netcmd: Increase the transaction_index_cache_size to 200k for schemaupgrade
Increasing this value greatly improve the performances of schema
upgrade for large domains (>200k entries).

The value 200000 is chosen because it is already used in join.py, and
should be sufficient for known domains.

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

Signed-off-by: Andréas Leroux <aleroux@tranquil.it>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5092d7f46b8491e4a2d973a00aff4d6c0e77945e)
2025-02-27 10:50:24 +00:00
Jule Anger
6dbb7b0b10 VERSION: Bump version up to Samba 4.21.5...
and re-enable GIT_SNAPSHOT.

Signed-off-by: Jule Anger <janger@samba.org>
2025-02-17 16:46:51 +01:00
Jule Anger
0b084c0bc6 VERSION: Disable GIT_SNAPSHOT for the 4.21.4 release.
Signed-off-by: Jule Anger <janger@samba.org>
samba-4.21.4
2025-02-17 16:46:41 +01:00
Jule Anger
d79cf425c0 WHATSNEW: Add release notes for Samba 4.21.4.
Signed-off-by: Jule Anger <janger@samba.org>
2025-02-17 16:44:19 +01:00
Ralph Boehme
1fe10a03c5 mdssvc: support a few more attributes
This adds support for the following Spotlight Metadata Attributes:

  _kMDItemFileName (another alias for kMDItemFSName and kMDItemDisplayName)
  kMDItemLastUsedDate
  kMDItemContentCreationDate
  kMDItemLogicalSize (another alias for kMDItemFSSize)

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 0ba1a8d77694182058d1c01b54a8759bdf0e28a6)

Autobuild-User(v4-21-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-21-test): Mon Feb 17 11:04:23 UTC 2025 on atb-devel-224
2025-02-17 11:04:23 +00:00
Ralph Boehme
7b31e8ea82 vfs_gpfs: add gpfs:clamp_invalid_times
The timestamp validation added as part of the fix for bug 15151 causes hard
failures for certain clients that seem to use a temporary timestamp initially
when creating files, changing in a later step.

Clamp invalid timestamps to the allowed range 0..UINT32_MAX if
"gpfs:clamp_invalid_times = yes" is set.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Wed Feb  5 23:42:15 UTC 2025 on atb-devel-224

(cherry picked from commit 0a48167044bb1ffd9e19cb2e23de9834d0551be1)
2025-02-17 09:53:26 +00:00
Douglas Bagnall
e3b3db3617 ndr: fix coda logic around in ndr_pull_security_ace()
Sometimes an access allowed object ACE has unneeded trailing bytes,
like this:

                      aces: struct security_ace
                          type                     : SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT (5)
                          flags                    : 0x00 (0)
                                 0: SEC_ACE_FLAG_OBJECT_INHERIT
                                 0: SEC_ACE_FLAG_CONTAINER_INHERIT
                                 0: SEC_ACE_FLAG_NO_PROPAGATE_INHERIT
                                 0: SEC_ACE_FLAG_INHERIT_ONLY
                                 0: SEC_ACE_FLAG_INHERITED_ACE
                              0x00: SEC_ACE_FLAG_VALID_INHERIT (0)
                                 0: SEC_ACE_FLAG_SUCCESSFUL_ACCESS
                                 0: SEC_ACE_FLAG_FAILED_ACCESS
                          size                     : 0x0048 (72)
                          access_mask              : 0x00000100 (256)
                          object                   : union security_ace_object_ctr(case 1)
                          object: struct security_ace_object
                              flags                    : 0x00000001 (1)
                                     1: SEC_ACE_OBJECT_TYPE_PRESENT
                                     0: SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT
                              type                     : union security_ace_object_type(case 1)
                              type                     : edacfd8f-ffb3-11d1-b41d-00a0c968f939
                              inherited_type           : union security_ace_object_inherited_type(case 0)
                          trustee                  : S-1-3-0
                          coda                     : union security_ace_coda(case 5)
                          ignored                  : DATA_BLOB length=32
  [0000] 00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00   ........ ........
  [0010] 00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00   ........ ........

which we need to pull in order to ignore.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Feb 13 15:15:40 UTC 2025 on atb-devel-224

(cherry picked from commit 67b09b481b06080d3f46878d60095f188ff18fb8)
[bugzilla link added in backport]
2025-02-17 09:53:26 +00:00
Douglas Bagnall
b222d6ec73 pytest: add ndr packing tests for security descriptors
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15738

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 455a0558c89312061f3b9ccaa577a4a60df7ee77)
[bugzilla link added in backport]
2025-02-17 09:53:26 +00:00
Pavel Filipenský
cead38fb09 docs: Update documentation for 'sync machine password to keytab'
Use specifier 'spn_prefixes=host' instead of 'host'

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Sat Feb 15 19:21:56 UTC 2025 on atb-devel-224

(cherry picked from commit 7cae7aad1ca6dcd5e0a3a102f36af74fa49a2c2b)
2025-02-17 09:53:26 +00:00
Pavel Filipenský
63b115a009 s3:libads: Remove specifier for 'host' principal from 'sync machine password to keytab'
Use specifier 'spn_prefixes=host' instead of 'host'

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit ccc3b2b2fba7b5d223c79bffc0f655490aed19cf)
2025-02-17 09:53:26 +00:00
Pavel Filipenský
8d5384e965 docs-xml:smbdotconf: Document new options for 'sync machinepassword to keytab'
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15759

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Thu Feb 13 18:45:21 UTC 2025 on atb-devel-224

(cherry picked from commit 7a662e097be5e0d3f7779fa544486968b8f57063)
2025-02-17 09:53:26 +00:00
Pavel Filipenský
58a7666b67 s3: Add new keytab specifiers
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15759

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 15e191736d3eaba83b2fb4b901e1df2214526b64)
2025-02-17 09:53:26 +00:00
Shweta Sodani
5517372190 vfs_ceph_new:minor logging improvement
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15703

Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-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 Feb 14 10:57:50 UTC 2025 on atb-devel-224

(cherry picked from commit 6430e0a9fb7e9c368a3170f9cddd688a49aedb23)
2025-02-17 09:53:26 +00:00
Shachar Sharon
81d4b6467b vfs_ceph_new: add smbprofile for async-ops
Commit fcd3fc34b2ec5e ("vfs_ceph_new: add profiling support") added
PROFILE accounting for non-async VFS hooks. Add also SMBPROFILE for
async (read/write/fsync) hooks.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-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 Jan 17 16:47:28 UTC 2025 on atb-devel-224

(cherry picked from commit 775e08ec7b6a32086266a0f7eba4a107869b1cf6)
2025-02-17 09:53:26 +00:00
Shweta Sodani
5de7646e7f vfs_ceph_new: add profiling support
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15703

Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-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): Mon Jan 13 21:26:34 UTC 2025 on atb-devel-224

(cherry picked from commit fcd3fc34b2ec5e00ad24aaa7276338c9a473c086)
2025-02-17 09:53:26 +00:00
Shachar Sharon
2aae61a8ad vfs_ceph_new: log open-flags upon release-fh
Store the set of open O_XXX flags as part of the referenced file-handle
to allow more verbose debug-logging info upon close. This should ease
the developer's logging analysis where same inode is opened multiple
times but with different flags set.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 341ff48a5a787ed358a28037b5ec751b7b530e20)
2025-02-17 09:53:26 +00:00
Shachar Sharon
a828997221 vfs_ceph_new: improved vfs-opers logging
Have more verbose and explicit values in various DBG_DEBUG logging. In
particular, do not use the redundant '__func__' argument as it's info is
already provided via the DBG_ logging macros.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 73d5503a90e3bd5b1d1cfc6322d7de10955faf6c)
2025-02-17 09:53:26 +00:00
Shachar Sharon
12394b895a vfs_ceph_new: improved mount logging
Add extra debug-logging to mount/umount flows, with more verbose info.
Try to make logging messages follow a 'key=value' format.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 2153bedc8eb53e5d9f44ef677bd1781d934abd34)
2025-02-17 09:53:26 +00:00
Shachar Sharon
6e0ca05796 vfs_ceph_new: improve mount cache-entry add
Use boolean return value from cephmount_cache_add, to align code-style
with other caphmount helper functions. Returns false in case of memory
allocation failure, true otherwise (success).

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 866b872cdb2b08a8b5e6a9015cde9b34c4bcdf01)
2025-02-17 09:53:26 +00:00
Shachar Sharon
0aea2e374d vfs_ceph_new: improve mount cache-entry ref-count
Use singed int32_t for cached mount-entries reference counting. Define
helper function for inc/dec ref-count which also provides proper
logging. Prefer boolean return-value for 'cephmount_cache_remove' as
'int' is often used as error indicator within the context of libcephfs
and this VFS module.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 29a9d18d2d21842bb38bcdc6b9e366abac458ed9)
2025-02-17 09:53:26 +00:00
Shachar Sharon
79d6da01ca vfs_ceph_new: avoid setting errno in cephmount_cache_update
Do not set 'errno' to ENOENT in cephmount_cache_update. Setting this
errno value upon newly inserted entry may cause vfs_ceph_connect to
change errno to non-zero value even though the final result is OK.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 1f7581c9edb32a2a63bf032f7e167be8a401c3d5)
2025-02-17 09:53:26 +00:00
Shachar Sharon
ab29d3eb6e vfs_ceph_new: refactor error-case in cephmount_mount_fs
Align code-style of 'cephmount_mount_fs' with rest of the code: use
'goto' for bail-out upon error case (with proper cleanups). For the
common case of successful operation complete execution and return final
value. Added extra debug-logging for good-path case.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit d9b872afeee4dee49de2e6eb86e4b59e07804363)
2025-02-17 09:53:26 +00:00
Shachar Sharon
3e00ee5a1c vfs_ceph_new: switch to ceph_readdir_r
Prefer a safe version of ceph_readdir, where the directory entry struct
is allocated by the caller. Use a dynamic-allocated 'struct dirent'
which is associated with a directory vfs_ceph_fh (optional), which is
allocated on-the-fly upon start of READDIR and released at the end or
CLOSEDIR (or unlikely readdir error).

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>

Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Oct 25 10:29:44 UTC 2024 on atb-devel-224

(cherry picked from commit ce459ddbcd0f32252858a7640f6871057eb14645)
2025-02-17 09:53:26 +00:00
Anoop C S
7302ea418a docs_xml/vfs_ceph_new: Add new proxy option
Update man page to describe new 'proxy' module option.

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

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

Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Sep 12 16:51:14 UTC 2024 on atb-devel-224

(cherry picked from commit 12ad4832a74a6fba3fb8954a8630b900f5763f18)
2025-02-17 09:53:26 +00:00
Anoop C S
378f28e66a wscript_build: Do not link vfs_ceph_new against libcephfs
vfs_ceph_new dynamically loads the appropriate libcephfs shared
libraries which means that we don't statically link against it.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 095ece43a2edbdeb498e8bef07bdf09f9836bb40)
2025-02-17 09:53:26 +00:00
Anoop C S
50047d6fe6 vfs_ceph_new: Use function pointers for API calls
Replace direct function calls with pointers holding their equivalent
addresses.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 962a40a6ff51f33adc39e466f1479dfb35ac0926)
2025-02-17 09:53:26 +00:00
Anoop C S
08e5081465 vfs_ceph_new: Pass module config to userperm helpers
userperm helpers will switch to function references instead of direct
invocation of APIs. This would mean the matching config structure is
passed to those helpers.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit d5926cf492b1cb81c90b27e0537ec3f1b1a10f80)
2025-02-17 09:53:26 +00:00
Anoop C S
8183c2cbf2 vfs_ceph_new: Hold a config reference in vfs_ceph_fh
This is required to perform the cleanup when fsp extension destructor is
called as part of VFS_REMOVE_FSP_EXTENSION where mount information and
function references are to be used in upcoming changes.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 250af54250bed87928250b95db663ff13cc1f42a)
2025-02-17 09:53:26 +00:00
Anoop C S
c176fe4c97 vfs_ceph_new: Call vfs_ceph_userperm_new with handle->conn
vfs_ceph_userperm_new() only need connection structure from handle
for fetching the current unix token. Therefore modify the signature
to accept just handle->conn.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 8c1d774c7e206bb413284d500c5aa950ac3dd3d5)
2025-02-17 09:53:26 +00:00
Guenther Deschner
254c084611 vfs_ceph_new: Populate function pointers with addresses
Use dlysm() for assigning addresses to already declared libcephfs
low-level API function pointers.

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

Pair-Programmed-With: Anoop C S <anoopcs@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit e4fc1df4b4486f5eed095135f905bdbf10bb1793)
2025-02-17 09:53:26 +00:00
Guenther Deschner
8f04869051 vfs_ceph_new: Add required function pointers to config
Declare necessary libcephfs low-level APIs as function pointers to be
assigned with corresponding loadable addresses.

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

Pair-Programmed-With: Anoop C S <anoopcs@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 0d2ad13d8e5191f4b01584afa0bcdbf1114042b8)
2025-02-17 09:53:26 +00:00
Guenther Deschner
58631b66bf vfs_ceph_new: Dynamically open library for 'proxy' mode
Use dlopen() to load either of the shared libraries(libcephfs.so or
libcephfs_proxy.so) based on the configuration for 'proxy' module
parameter. Further down the line we will define the required APIs
as function pointers within the config structure.

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

Pair-Programmed-With: Anoop C S <anoopcs@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 47812a279118befbaeffdd6c81e3d49b071f04c5)
2025-02-17 09:53:26 +00:00
Guenther Deschner
7d6d1fa4c0 vfs_ceph_new: Introduce new parametric option 'proxy'
Provide early support for consuming yet to come libcephfs proxy[1] for
optimized resource utilization. For better control we make use of an
additional module specific option 'proxy' to specify the intent to load
proxy library. With the default value 'no' a regular cephfs connection
is established. There is also an 'auto' mode which can fall back to the
regular connection if proxy requirements are not met.

[1] https://github.com/ceph/ceph/pull/58376

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 90464bdcafda0f0f0e4d2b549fd1675c076ee188)
2025-02-17 09:53:26 +00:00
Guenther Deschner
5f6622e04b vfs_ceph_new: Add a new struct to hold ceph module config
Consolidate all required configuration related data under a dedicated
structure named vfs_ceph_config. As of now it includes the location of
configuration file, file system name, ceph client user id and mount
related information. This is expected to grow in future with more
details as and when required. Apart from that small cleanups are also
done to make code more robust.

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

Pair-Programmed-With: Anoop C S <anoopcs@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit f1d418181d12bd513204cf2b77c37990939e2041)
2025-02-17 09:53:26 +00:00
Shachar Sharon
9aa97eb93b vfs_ceph_new: implement DFS hooks using libcephfs low-level APIs
Refactor the VFS hooks 'create_dfs_pathat_fn' and 'read_dfs_pathat_fn'
in 'vfs_ceph_new.c' to use libcephfs low-level APIs: instead of using
path-based operations (as done in legacy 'vfs_ceph.c') use inode based
operations to create and read msdfs symbolic-links values.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-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): Wed Sep 11 19:09:41 UTC 2024 on atb-devel-224

(cherry picked from commit 0cedd74e47ab919528420761a5bd2acb198f084c)
2025-02-17 09:53:26 +00:00
Günther Deschner
512514bbae s3-libnet: avoid using lp_dns_hostname() in join code
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15777

This codepath is also used for provisiong non-local machines into AD
during offlinejoin operations. When creating accounts for non-local
machines we certainly need to be able to use arbitrary hostname other
than lp_netbios_name() (which is used internally by lp_dns_hostname()).
This partly reverts 0e96092c1895ecb41d4064111566b4ada71fe457.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 30 07:35:05 UTC 2025 on atb-devel-224

(cherry picked from commit 062dc07e9b9c8e260548d0bca4d02819bdc60326)

Autobuild-User(v4-21-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-21-test): Wed Feb 12 10:37:56 UTC 2025 on atb-devel-224
2025-02-12 10:37:56 +00:00
Günther Deschner
6e4c35f800 selfest: add test for non-local offlinejoin provision
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15777

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 6d4ad4d6824e81ef85dd924d550222dd6a322a15)
2025-02-12 09:26:16 +00:00
Günther Deschner
33edcf2cad s3-libads: dump ADS_MODSLIST before attempting the LDAP modify
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15777

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit f02a4002d5c3cfcd7f36b3bcf13310ffd155de90)
2025-02-12 09:26:16 +00:00
Vinit Agnihotri
1f24b3ff23 sharesec: Check if share exists in configuration
Load config from registry without share info and check if sharename
exists from configuration. This results into lesser delay for the same.

In case of view we load config with all shares to ensure we get all
shares for diplay purpose.

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

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: John Mulligan <jmulligan@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Jan 10 10:45:30 UTC 2025 on atb-devel-224

(cherry picked from commit 1410803713440caf29a40aec30516489d1944665)

Autobuild-User(v4-21-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-21-test): Wed Feb  5 10:43:01 UTC 2025 on atb-devel-224
2025-02-05 10:43:01 +00:00
Vinit Agnihotri
22b7b4bd72 sharesec: Add function to check existence of share from config
Add function to detect if a share name exists in the registry or config file.

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

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: John Mulligan <jmulligan@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 78eb293e1cdd3635de0bcf46ffb9d842f27bcc9f)
2025-02-05 09:32:17 +00:00
Vinit Agnihotri
2588668e44 param: Add API to load registry without share info
As number of shares increases loading entire registry configuration along with
share information becomes very costly operation.
Since we may not require share information all time, we can optimise
this by using API just loading configuration without any share info.

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

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: John Mulligan <jmulligan@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 2927dba0434b960e4c381329bdc9fe474fb930ce)
2025-02-05 09:32:17 +00:00
Vinit Agnihotri
a564f5dbad sharesec: Fix warning frame not freed in order
This change should fix following warning:
Freed frame ../../source3/utils/sharesec.c:515, expected ../../source3/utils/sharesec.c:637

Frame was not getting freed in case of servicename is NULL.

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

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: John Mulligan <jmulligan@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 04531e1b1d25d114c470922547bee769b07e5e60)
2025-02-05 09:32:17 +00:00
Guenther Deschner
087972fded s3-sharesec: Add Test to verify command option "--view-all"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15780

Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: John Mulligan <jmulligan@samba.org>
(cherry picked from commit 0a12254ea8b3414deebc3e6329025052c650356e)
2025-02-05 09:32:17 +00:00
Stefan Metzmacher
816f312a7f s4:rpc_server/lsa: let LookupSids* behave like Windows 2022/2025
The important part is the INVALID_SID should not
cause an early exit of the loop.

We need to return the intact names array with the
correct count. And only return INVALID_SID
if we would otherwise return NONE_MAPPED.

For SOME_NOT_MAPPED we need to ignore invalid sids
and just pretend they are not mapped.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry picked from commit 218a0f067c894cbf61cde6183a269c0474d64ddc)

Autobuild-User(v4-21-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-21-test): Mon Feb  3 20:01:38 UTC 2025 on atb-devel-224
2025-02-03 20:01:38 +00:00
Stefan Metzmacher
40145184e9 libcli/security: let dom_sid_lookup_predefined_sid() behave like Windows 2008R2
Windows 2008R2 (172.31.9.133) returns the following:

 #> rpcclient 172.31.9.133 -Uadministrator%A1b2C3d4 -c 'lookupsids S-1-22-1 S-1-22-1-0;lookupsids S-1-22;lookupsids S-1-3-0 S-1-3-99;lookupsids S-1-3'
 S-1-22-1 *unknown*\*unknown* (8)
 S-1-22-1-0 *unknown*\*unknown* (8)
 result was NT_STATUS_INVALID_SID
 S-1-3-0 \CREATOR OWNER (5)
 S-1-3-99 *unknown*\*unknown* (8)
 result was NT_STATUS_INVALID_SID

While the current Samba (172.31.9.163) returns the following:

 #> rpcclient 172.31.9.163 -Uadministrator%A1b2C3d4 -c 'lookupsids S-1-22-1 S-1-22-1-0;lookupsids S-1-22;lookupsids S-1-3-0 S-1-3-99;lookupsids S-1-3'
 result was NT_STATUS_INVALID_SID
 result was NT_STATUS_INVALID_SID
 S-1-3-0 \CREATOR OWNER (5)
 S-1-3-99 *unknown*\*unknown* (8)
 S-1-3 *unknown*\*unknown* (8)

With this change also return the same as Windows 2008R2:

 #> rpcclient 172.31.9.163 -Uadministrator%A1b2C3d4 -c 'lookupsids S-1-22-1 S-1-22-1-0;lookupsids S-1-22;lookupsids S-1-3-0 S-1-3-99;lookupsids S-1-3'
 S-1-22-1 *unknown*\*unknown* (8)
 S-1-22-1-0 *unknown*\*unknown* (8)
 result was NT_STATUS_INVALID_SID
 S-1-3-0 \CREATOR OWNER (5)
 S-1-3-99 *unknown*\*unknown* (8)
 result was NT_STATUS_INVALID_SID

This is a minimal fix in order to avoid crashes in the Windows Explorer.
The real fix needs more work and additional tests, as the behavior seems
to be different in newer Windows releases.

The following patch will let us behave like Windows 2022/2025...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry picked from commit 9f369c62317d74615834f99a088caababef685fc)
2025-02-03 18:51:14 +00:00
Stefan Metzmacher
8d84240c40 python:tests/dcerpc/lsa: add tests for invalid LookupSids2 combinations
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14213

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry picked from commit abba3495d23524142a4cf55d208dce041adee96b)
2025-02-03 18:51:14 +00:00