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
Douglas Bagnall [Thu, 30 Jan 2025 21:31:32 +0000 (10:31 +1300)]
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.
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
Pavel Filipenský [Fri, 31 Jan 2025 11:17:28 +0000 (12:17 +0100)]
s3:utils: Fix 'Usage:' for 'net ads enctypes'
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): Tue Feb 4 09:35:58 UTC 2025 on atb-devel-224
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
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jan 29 12:17:47 UTC 2025 on atb-devel-224
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
This can be used after smb2_session_channel() in order
to have a smb2_tree structure representing the same
logic tree connect but uses a different channel/connection.
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
s4:librpc: make use of CHECK_DEBUGLVLC(DBGC_RPC_PARSE, ...) in dcerpc_bh_do_ndr_print()
This makes sure the debug class rpc_parse is used for ndr dump output.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jan 29 02:11:51 UTC 2025 on atb-devel-224
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...
Pavel Filipenský [Mon, 27 Jan 2025 16:37:14 +0000 (17:37 +0100)]
docs: Fix the documentation for NET ADS DNS (UN)REGISTER
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 Jan 27 19:20:52 UTC 2025 on atb-devel-224
Volker Lendecke [Tue, 31 Dec 2024 11:36:12 +0000 (12:36 +0100)]
smbd: Remove an unnecessary call to SMB_VFS_STAT()
filename_convert_dirfsp() already takes care of looking up the last
component if it's there.
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): Fri Jan 24 00:06:14 UTC 2025 on atb-devel-224
Volker Lendecke [Thu, 2 Jan 2025 08:37:32 +0000 (09:37 +0100)]
vfs: Fix streams_depot_lstat()
When passing NULL as base_sbuf to stream_smb_fname(), it uses
SMB_VFS_NEXT_STAT() to find the right stream directory. This will
potentially dereference the last symlink. Make sure that in
streams_depot_lstat() this is not done.
Also, the current version did not return the stat struct at all.
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 3 Jan 2025 09:47:13 +0000 (10:47 +0100)]
smbd: Simplify rmdir_internals()
recursive_rmdir_fsp() works fine on the original fsp passed in, we
don't need to fetch the dirfsp from the dir_hnd we created to call
can_delete_directory_hnd()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 3 Jan 2025 11:33:43 +0000 (12:33 +0100)]
vfs_fruit: Don't expect a pathref fsp in unlinkat
The unix syscall unlinkat does not expect a file descriptor for the
to-be-removed object. SMB_VFS_UNLINKAT should also not expect
that. Put the special case into vfs_fruit.
This is required to simplify delete_all_streams next, which should not
have to do an openat_pathref_fsp() on all streams just for the
vfs_fruit case.
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>