1
0
mirror of https://github.com/samba-team/samba.git synced 2025-04-17 22:50:55 +03:00

137245 Commits

Author SHA1 Message Date
Jule Anger
74506c7ad6 VERSION: Disable GIT_SNAPSHOT for the 4.20.8 release.
Signed-off-by: Jule Anger <janger@samba.org>
samba-4.20.8
2025-03-25 15:37:41 +01:00
Jule Anger
5bf75bd8ec WHATSNEW: Add release notes for Samba 4.20.8.
Signed-off-by: Jule Anger <janger@samba.org>
2025-03-25 15:37:01 +01:00
Anoop C S
02dcd201fd 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-20-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-20-test): Mon Mar 10 09:46:55 UTC 2025 on atb-devel-224
2025-03-10 09:46:55 +00:00
Martin Schwenke
351bdc7164 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-20-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-20-test): Wed Mar  5 17:01:18 UTC 2025 on atb-devel-224
2025-03-05 17:01:18 +00:00
Andrea Venturoli
cabe5f8997 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-20-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-20-test): Tue Mar  4 11:23:45 UTC 2025 on atb-devel-224
2025-03-04 11:23:45 +00:00
Douglas Bagnall
47eaf606a4 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-20-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-20-test): Wed Feb 26 09:40:17 UTC 2025 on atb-devel-224
2025-02-26 09:40:17 +00:00
Andréas Leroux
848cdca0b5 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-26 08:33:30 +00:00
Jo Sutton
96e60f4f0e s4:ldap_server: Consider ldapi connections to be encrypted
Modifications to unicodePwd require an encrypted connection. This change
allows unicodePwd to be modified over an ldapi connection.

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

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit ff8e98daf1c3fd99d4d880ddc2d47eeb0d99718c)
2025-02-26 08:33:30 +00:00
Jo Sutton
dda353c656 s4:ldap_server: Store whether an LDAP connection is over ldapi
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15634

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit c63cabf1e09bb2d1416483767d1ca835abe017da)
2025-02-26 08:33:30 +00:00
Jo Sutton
018bb7bbbc s4:ldap_server: Add copy of non‐privileged ops specifically for ldapi connections
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15634

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit c2378d0c6f3e2f6b10902dc40b4a28c1dc788042)
2025-02-26 08:33:30 +00:00
Jo Sutton
830d10c196 s4:ldap_server: Rename privileged ops to indicate they are used for ldapi
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15634

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit ec6579829f9781d113428b8b3c603edd3e6c222d)
2025-02-26 08:33:30 +00:00
Jo Sutton
e95f6bc6d9 s4:ldap_server: Fix code spelling
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15634

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7df4bdd0fe722da63862d46f809f7ac0498ebe59)
2025-02-26 08:33:30 +00:00
Jo Sutton
529615128b s4:ldap_server: Remove trailing whitespace
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15634

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 1a6dbcfb1054a2f140a50a039e4f054c43cfb77d)
2025-02-26 08:33:30 +00:00
Ralph Boehme
b4c8927881 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-20-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-20-test): Mon Feb 17 17:28:37 UTC 2025 on atb-devel-224
2025-02-17 17:28:37 +00:00
Ralph Boehme
edb719760b 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 16:09:09 +00:00
Douglas Bagnall
f3d65a377a 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 16:09:09 +00:00
Douglas Bagnall
a74d5beb2a 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 16:09:09 +00:00
Shweta Sodani
787ced312a 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 16:09:09 +00:00
Shachar Sharon
d5483429ee 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 16:09:09 +00:00
Shweta Sodani
6aa52e530c 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 16:09:09 +00:00
Shachar Sharon
f26f0ab3aa 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 16:09:09 +00:00
Shachar Sharon
f03df137fc 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 16:09:09 +00:00
Shachar Sharon
6d68b61c32 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 16:09:09 +00:00
Shachar Sharon
6a09316d29 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 16:09:09 +00:00
Shachar Sharon
00d505ae38 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 16:09:09 +00:00
Shachar Sharon
3d934ff47e 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 16:09:09 +00:00
Shachar Sharon
191d67baea 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 16:09:09 +00:00
Shachar Sharon
8231235652 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 16:09:09 +00:00
Anoop C S
3b3faed2e0 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 16:09:09 +00:00
Anoop C S
f176b0374d 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 16:09:09 +00:00
Anoop C S
f74db02aa6 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 16:09:09 +00:00
Anoop C S
022dd9eb42 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 16:09:09 +00:00
Anoop C S
8f85064175 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 16:09:09 +00:00
Anoop C S
2cc98d3959 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 16:09:09 +00:00
Guenther Deschner
9a91d70044 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 16:09:09 +00:00
Guenther Deschner
aac150ebad 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 16:09:09 +00:00
Guenther Deschner
ae13462d06 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 16:09:08 +00:00
Guenther Deschner
67c9da1235 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 16:09:08 +00:00
Guenther Deschner
1213741195 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 16:09:08 +00:00
Shachar Sharon
608d2d55ca 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 16:09:08 +00:00
Stefan Metzmacher
846b8c0d8c 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-20-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-20-test): Mon Feb  3 15:53:33 UTC 2025 on atb-devel-224
2025-02-03 15:53:33 +00:00
Stefan Metzmacher
981e6b51e6 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 14:53:10 +00:00
Stefan Metzmacher
1e2291530e 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 14:53:10 +00:00
Stefan Metzmacher
a1c2206e6b s4:pyrpc: allow connections with raise_result_exceptions=False
This is needed in order to do useful tests with
specific error codes and still checking all other
out parameters.

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 6b1ff9a38fcddbe72b00e28960414526a42bde14)
2025-02-03 14:53:10 +00:00
Stefan Metzmacher
3e1b15aa6f pidl:Python: prepare code to avoid NTSTATUS/WERROR exceptions
They are returned as additional result.

It means callers can look at all out params,
even if the status is an error.

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 7ecaf1a779370ef3ecf189e51a5e668329fa24c7)
2025-02-03 14:53:10 +00:00
Stefan Metzmacher
e7d70c5a33 pidl:Python: handle NTSTATUS/WERROR exceptions first
If we raise an exception we should not leak temporary
python objects.

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 67c35d6b4ef6b7dbe9db3c52547b25580cd4756c)
2025-02-03 14:53:10 +00:00
Stefan Metzmacher
37dee8f89c pidl:Python: separate logic to calculate the signature string
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 13d9231800ea969675f3207cd2c863e433104b4d)
2025-02-03 14:53:10 +00:00
Stefan Metzmacher
ba7115254e pidl:Python: check PyTuple_New() return value
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 f7282c0dffbf30d72051a81d46d831344a9bbcf9)
2025-02-03 14:53:10 +00:00
Stefan Metzmacher
d1998e201a pidl:Python: initialize pointers and add 'result' at the end
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 9dfb0ed8d29bd4a9146cf38bd63c4bb55b5faf73)
2025-02-03 14:53:10 +00:00
Stefan Metzmacher
b4224ede9e pidl:Python: introduce $is_raisable_return helper variable
No change in the generated code.

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 8cdf7af43a365b0545562033f6c51150f2fbb3a4)
2025-02-03 14:53:10 +00:00