Ralph Boehme [Wed, 29 Jan 2025 14:11:16 +0000 (15:11 +0100)]
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)
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
We need to re-activate this once we support multitple domains
in out own forest.
Fixes CID 1642726: Control flow issues (UNREACHABLE)
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Feb 11 23:18:02 UTC 2025 on atb-devel-224
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Tue Feb 11 11:05:37 UTC 2025 on atb-devel-224
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Feb 8 19:49:33 UTC 2025 on atb-devel-224
drsblobs.idl: use dom_sid0 in ForestTrustDataDomainInfo
We already use ndr_size_dom_sid0() and when ForestTrustDataDomainInfo
is used as part of ForestTrustDataScannerInfo, sid_size is 0
and the subcontext for the sid is skipped.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
s4:kdc: let samba_kdc_trust_message2entry don't support WITHIN_FOREST and PIM_TRUST
These are not supported yet.
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): Sat Feb 8 16:23:30 UTC 2025 on atb-devel-224
Reloading trusts should reload every aspect of
the trust and also remove deleted trusts from
the winbindd _domain_list.
But pending requests still continue.
With this commit it is required that
async state structures use struct winbindd_domain_ref
instead of raw struct winbindd_domain pointers,
in order to usage of stale pointers.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
winbindd: use struct winbindd_domain_ref in struct winbindd_domain_info_state
In the next commits it will be possible that
struct winbindd_domain instances become stale
because trusted domains were reloaded.
That means aync state structure should not use
pointers to 'struct winbindd_domain' as they
can become stale!
Instead they should use 'struct winbindd_domain_ref domain'
in the async state and use winbindd_domain_ref_set/get()
to manage the 'struct winbindd_domain' pointer.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
winbindd: use struct winbindd_domain_ref in struct wb_lookupsids_domain
In the next commits it will be possible that
struct winbindd_domain instances become stale
because trusted domains were reloaded.
That means aync state structure should not use
pointers to 'struct winbindd_domain' as they
can become stale!
Instead they should use 'struct winbindd_domain_ref domain'
in the async state and use winbindd_domain_ref_set/get()
to manage the 'struct winbindd_domain' pointer.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
winbindd: use struct winbindd_domain_ref in struct winbindd_list_groups_domstate
In the next commits it will be possible that
struct winbindd_domain instances become stale
because trusted domains were reloaded.
That means aync state structure should not use
pointers to 'struct winbindd_domain' as they
can become stale!
Instead they should use 'struct winbindd_domain_ref domain'
in the async state and use winbindd_domain_ref_set/get()
to manage the 'struct winbindd_domain' pointer.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
winbindd: use struct winbindd_domain_ref in struct winbindd_list_users_domstate
In the next commits it will be possible that
struct winbindd_domain instances become stale
because trusted domains were reloaded.
That means aync state structure should not use
pointers to 'struct winbindd_domain' as they
can become stale!
Instead they should use 'struct winbindd_domain_ref domain'
in the async state and use winbindd_domain_ref_set/get()
to manage the 'struct winbindd_domain' pointer.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
winbindd: use struct winbindd_domain_ref in struct trustdom_state
In the next commits it will be possible that
struct winbindd_domain instances become stale
because trusted domains were reloaded.
That means aync state structure should not use
pointers to 'struct winbindd_domain' as they
can become stale!
Instead they should use 'struct winbindd_domain_ref domain'
in the async state and use winbindd_domain_ref_set/get()
to manage the 'struct winbindd_domain' pointer.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
winbindd: use struct winbindd_domain_ref in struct getgrent_state
In the next commits it will be possible that
struct winbindd_domain instances become stale
because trusted domains were reloaded.
That means aync state structure should not use
pointers to 'struct winbindd_domain' as they
can become stale!
Instead they should use 'struct winbindd_domain_ref domain'
in the async state and use winbindd_domain_ref_set/get()
to manage the 'struct winbindd_domain' pointer.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
winbindd: use struct winbindd_domain_ref in struct getpwent_state
In the next commits it will be possible that
struct winbindd_domain instances become stale
because trusted domains were reloaded.
That means aync state structure should not use
pointers to 'struct winbindd_domain' as they
can become stale!
Instead they should use 'struct winbindd_domain_ref domain'
in the async state and use winbindd_domain_ref_set/get()
to manage the 'struct winbindd_domain' pointer.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
winbindd: use struct winbindd_domain_ref in struct wb_query_user_list_state
In the next commits it will be possible that
struct winbindd_domain instances become stale
because trusted domains were reloaded.
That means aync state structure should not use
pointers to 'struct winbindd_domain' as they
can become stale!
Instead they should use 'struct winbindd_domain_ref domain'
in the async state and use winbindd_domain_ref_set/get()
to manage the 'struct winbindd_domain' pointer.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
winbindd: use struct winbindd_domain_ref in struct wbint_bh_raw_call_state
In the next commits it will be possible that
struct winbindd_domain instances become stale
because trusted domains were reloaded.
That means aync state structure should not use
pointers to 'struct winbindd_domain' as they
can become stale!
Instead they should use 'struct winbindd_domain_ref domain'
in the async state and use winbindd_domain_ref_set/get()
to manage the 'struct winbindd_domain' pointer.
Note this is most likely not really needed because
the requests are in the domain or child tevent queue,
before the domain will be free'ed.
But we better use the winbindd_domain_ref in
all async state!
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
In the next commits it will be possible that
struct winbindd_domain instances become stale
because trusted domains were reloaded.
That means aync state structure should not use
pointers to 'struct winbindd_domain' as they
can become stale!
Instead they should use 'struct winbindd_domain_ref domain'
in the async state and use winbindd_domain_ref_set/get()
to manage the 'struct winbindd_domain' pointer.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
winbindd: winbindd_child->domain is a talloc grant parent if valid
This comment makes it easier to spot if we still have
'struct winbindd_domain' pointers in state structures,
which should be replaced by struct winbindd_domain_ref,
in order to handle stale domains after reloading trusts.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Pair-programmed-with: Volker Lendecke <vl@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Sat Feb 8 03:30:27 UTC 2025 on atb-devel-224
Douglas Bagnall [Wed, 15 Jan 2025 02:33:18 +0000 (15:33 +1300)]
samba-tool: all subcommands know --version
Before `samba-tool -V` would give you the version,
but `samba-tool spn -V` would complain.
An ad-hoc selection of sub-commands already supported --version,
depending on whether VersionOptions was manually added to the
takes_options dict. The .run() methods of these subcommands all take a
'versionopts' keyword argument, but never use it. If it was set (i.e.,
argv contained "--version"), the process never gets to .run(), so the
value of versionopts.version is always None in run(). After this
commit we can remove VersionOptions/versionopts from sub-commands.
Anoop C S [Thu, 6 Feb 2025 12:20:10 +0000 (17:50 +0530)]
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.
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
vfs_gpfs: Remove winattr calls from vfs_gpfs_fntimes
The call to the default function for fntimes already calls back into
fset_dos_attributes to set the create time. It is not necessary to
repeat the code in vfs_gpfs_fntimes.
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
vfs_gpfs: Use gpfs_get_winattrs instead of gpfs_fstat_x
gpfs_fstat_x had been introduced for querying additional inode
attributes for fileids. With the fileid code being removed, the simpler
gpfs_get_winattrs call can be used. gpfs_get_winattrs also accepts
O_PATH descriptors since GPFS 5.1.2.
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
The gpfs_stat_x call O_PATH descriptors since GPFS 5.1.2.0 and will also
be replaced with a simpler API call that also accepts O_PATH
descriptors. Remove the pathref test that is no longer needed.
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
librpc/ndr: apply some const to ndr_push_union_blob()
Keep libndr at 6.0.0, this has not been released yet.
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 Feb 6 10:45:52 UTC 2025 on atb-devel-224
Ralph Boehme [Wed, 22 Jan 2025 11:34:31 +0000 (12:34 +0100)]
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.
Volker Lendecke [Thu, 17 Mar 2022 18:31:44 +0000 (19:31 +0100)]
ntvfs: Simplify rap_netshareenum()
I know, unused. But the whole point of strlcpy is that we don't need
this kind of calculation, and we should not leave this as a bad
example code in our tree.
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb 5 01:05:08 UTC 2025 on atb-devel-224