1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

62025 Commits

Author SHA1 Message Date
Stefan Metzmacher
75fe450f98 s3:smbd: split out apply_new_nt_acl() helper
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15693

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-08-21 08:02:30 +00:00
Volker Lendecke
a18c45046d libsmb: Remove cli_state->raw_status
All callers which looked at this are gone

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Aug 20 10:57:12 UTC 2024 on atb-devel-224
2024-08-20 10:57:12 +00:00
Volker Lendecke
bdedf5d0ee libsmb: Remove unused cli_is_error()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
8171a1ccd3 libsmb: Remove a call to cli_is_error()
We are already in the !NT_STATUS_IS_OK if-branch, so this call was
redundant

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
e071ec1ffe libsmb: Remove unused cli_errno()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
e43a05ee3b libsmb: Don't set errno in cli_NetServerEnum()
No caller looks at it, and if someone should ever want to return a
more informative error, we now have NTSTATUS

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
2d361cc103 libsmb: Convert cli_NetServerEnum() to return NTSTATUS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
b9c018d17e libsmb: Remove a reference to cli_errno()
If I see it correctly, this case was already covered by checking the
return code of cli_trans() a few lines above.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
16c31fe804 libsmb: Remove unused cli_nt_error()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
ac5713f3b2 libsmb: Make cli_api() static to clirap2.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
e02e6f28a9 torture3: Convert run_randomipc() away from cli_api()
Not that it matters much, but I want to make cli_api() static in
clirap2.c.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
ee174fb050 libsmb: Convert cli_NetServerEnum() away from cli_api()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
c58ff4367a libsmb: Convert cli_RNetShareEnum() to NTSTATUS
Avoid a call to cli_nt_error()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
9812f87268 libsmb: Convert cli_RNetShareEnum() away from cli_api()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
7681007738 libsmb: Reduce indentation in cli_RNetShareEnum()
Use a "goto done", review with "git show -b"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
b1d5b8ef23 libsmb: Convert cli_oem_change_password() to NTSTATUS
Remove a few calls to cli_nt_error()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
fd9a0dc9a9 libsmb: Remove a pointless variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
cf61617198 utils: Fix "net rap password" return code
cli_oem_change_password() returns a bool, net_rap_password must return
0 for success

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
78a1e2817d libsmb: Fix cli_oem_change_password()
"(rdrcnt < 2)" was wrong, we don't look at rdata but at rparam. Use
"min_rparam" to cli_trans and the fact that if that succeeds "rparam"
is not NULL.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:40 +00:00
Volker Lendecke
86cc6f59cf libsmb: Convert cli_oem_change_password() away from cli_api()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:39 +00:00
Volker Lendecke
4f3a6dc8b0 samr: Avoid a "ret == false" for a bool
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:39 +00:00
Volker Lendecke
c6d9cb9b11 build: Fix LIBCLI_SAMR dependencies
cli_samr.c calls init_Lsa_String

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:39 +00:00
Volker Lendecke
b0e91608f2 libsmb: Remove a pointless variable assignment
We right away overwrite this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:39 +00:00
Volker Lendecke
565f20d281 libsmb: Avoid an "else", we return in the "true" branch
Reduce indentation

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:39 +00:00
Volker Lendecke
6d33f9935f libsmb: Swap if/else branches in remote_password_change
bail out with an early return next

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:39 +00:00
Volker Lendecke
bdabd9fff7 libsmb: Avoid an "else", we return in the "true" branch.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:39 +00:00
Volker Lendecke
18d506f521 libsmb: Modernize two DEBUGs
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:39 +00:00
Volker Lendecke
73c6a7f13c libsmb: Make cli_qpathinfo_standard() static
Only used to get the size as a fallback

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-20 09:34:39 +00:00
Ralph Boehme
61d9c0d92e smbd: add options "fs:[logical|aligned|performance|effective aligned] bytes per sector"
In order to support certain Windows applications that make use of copy reflink,
we need some way to allow configuring these values. According to testing, the
application somehow uses the value of phys_bytes_per_sector_atomic for some check
when requesting server-side reflink copies, eg for ZFS the following is needed

 block size = 131072
 fs:aligned bytes per sector = 131072

For some reason "block size" must also be set to the value of fs:aligned bytes
per sector, but fs:logical bytes per sector, which according to the spec should
match "block size", must stay at the default of 512, otherwise the application
does not work.

As the whole client behaviour could not be fully understood, I'm proposing to
introduce these options as undocumented parametric options, so we can at least
start testing with them.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Aug 20 07:01:19 UTC 2024 on atb-devel-224
2024-08-20 07:01:19 +00:00
Ralph Boehme
909edd6e8a vfs_default: implement FSCTL_DUP_EXTENTS_TO_FILE with copy_reflink()
According to MS-FSA 2.1.5.9.4 FSCTL_DUPLICATE_EXTENTS_TO_FILE ReFS on Windows
does not check for byte range lock conflicts:

 * The object store SHOULD<81> check for byte range lock conflicts ...

 * <81>: The ReFS file system in Windows Server 2016 and later does not check
 for byte range lock conflicts

To match Windows behaviour we also don't check for conflicts.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2024-08-20 05:41:32 +00:00
Ralph Boehme
deeca8ff17 smbd: consolidate fs capabilities code in vfswrap_fs_capabilities()
This ensures the values we return via SMB_FS_ATTRIBUTE_INFORMATION is the same
we use internally via conn->fs_capabilities.

This deliberately preserves existing behaviour as much as possible and leaves
possible improvements as a future excercize. Particularily FILE_VOLUME_QUOTAS is
already set insided SMB_VFS_STATVFS() depending on backend filesystem flags
which is probably the correct way to do it instead of just setting the
capability when Samba was built with quota support.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2024-08-20 05:41:32 +00:00
Pavel Filipenský
f1cd250a6f s3:libads: Do not print error message for a default configuration
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15689

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 Aug 19 13:21:08 UTC 2024 on atb-devel-224
2024-08-19 13:21:08 +00:00
Anoop C S
3929fdae1a source3/script: Fix installation of winbind_ctdb_updatekeytab.sh
winbind_ctdb_updatekeytab.sh assumes the presence `onnode` utility to
execute `net ads` command on all nodes in the cluster. But `onnode`
is only built when configured with clustering support. Therefore perform
the script installation only with ctdb configuration. Also fix the
installation path to /usr/share/ctdb/scripts.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15689
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2024-08-16 08:34:33 +00:00
Stefan Metzmacher
4df1bfd070 s3:smb2_server: return NT_STATUS_NETWORK_SESSION_EXPIRED for compound requests
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15696

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 13 22:29:28 UTC 2024 on atb-devel-224
2024-08-13 22:29:28 +00:00
Pavel Filipenský
9f0183a9f5 s3:script: Install winbind_ctdb_updatekeytab.sh
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15689

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-08-13 14:10:37 +00:00
Pavel Filipenský
adcad1b537 s3:script: Rename updatekeytab.sh ==> winbind_ctdb_updatekeytab.sh
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15689

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-08-13 14:10:37 +00:00
Shachar Sharon
aca4cf8327 vfs_ceph_new: use 'ceph_new' for config-param prefix
Use explicit 'ceph_new' prefix to each of the ceph specific config
parameters to avoid confusion with legacy 'vfs_ceph' module. Hence,
users will have in their smb.conf a format similar to:

...
[smbshare]
        vfs objects = ceph_new
        ceph_new: config_file = /etc/ceph/ceph.conf
        ceph_new: user_id = user1
        ceph_new: filesystem = fs1
        ...

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2024-08-08 12:34:37 +00:00
Shachar Sharon
aa043a5808 vfs_ceph_new: handle errno properly for 'readdir'
Take special care for readdir errno setting: in case of error, update
errno by libcephfs (and protect from possible over-write by debug
logging); in the case of successful result or end-of-stream restore
errno to its previous value before calling the readdir_fn VFS hook.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Aug  7 14:20:02 UTC 2024 on atb-devel-224
2024-08-07 14:20:02 +00:00
Shachar Sharon
a7f4e2bd47 vfs_ceph{_new}: do not set errno upon successful call to libcephfs
There is code in Samba that expects errno from a previous system call
to be preserved through a subsequent system call. Thus, avoid setting
"errno = 0" in status_code() and lstatus_code() upon successful return
from libcephfs API call.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2024-08-07 13:02:34 +00:00
Stefan Metzmacher
5b31b723c0 s3:lib: add winbind_lookup_name_ex() fallback for --without-winbind
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15687

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-08-07 06:18:31 +00:00
Volker Lendecke
2686a189c6 smbd: Assert we have an fsp in smbd_do_setfilepathinfo
With this in the future we can avoid some special cases in our callees

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): Tue Aug  6 17:37:39 UTC 2024 on atb-devel-224
2024-08-06 17:37:39 +00:00
Volker Lendecke
7e82052ce7 smbd: filename_convert_dirfsp always gives an fsp
We're in setpathinfo, so if there's without an fsp it's
OBJECT_NAME_NOT_FOUND, the last component is missing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2024-08-06 16:29:33 +00:00
Volker Lendecke
0e8a0f3bd4 smbd: Simplify check_user_ok()
Don't walk the cache at all if we get UID_FIELD_INVALID

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2024-08-06 16:29:33 +00:00
Volker Lendecke
95c031b660 smbd: Make parent_override_delete a bit more readable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2024-08-06 16:29:33 +00:00
Volker Lendecke
83537703ba smbd: Remove some dead code
We have returned from this function if fsp==NULL above

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2024-08-06 16:29:33 +00:00
Volker Lendecke
fe7b78adb3 smbd: Fix some DBGs
DBG_DEBUG already has the function name prefix

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2024-08-06 16:29:33 +00:00
Volker Lendecke
51262e47af smbd: Modernize a DEBUG
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2024-08-06 16:29:33 +00:00
Volker Lendecke
cfa24f0563 smbd: Fix a comment and an error message
Tested manually, but OBJECT_NAME_NOT_FOUND makes much more sense given
the new semantics of filename_convert_dirfsp.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2024-08-06 16:29:33 +00:00
Volker Lendecke
cb67a70113 smbd: Save a few lines with a "goto done;"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2024-08-06 16:29:33 +00:00
Volker Lendecke
ec73654323 lib: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2024-08-06 16:29:33 +00:00