]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
4 months agosmbtorture: adjust "base.delaywrite.update of write time using SET_END_OF_FILE" for...
Ralph Boehme [Tue, 4 Mar 2025 15:32:11 +0000 (16:32 +0100)] 
smbtorture: adjust "base.delaywrite.update of write time using SET_END_OF_FILE" for modern SMB delayed write

The adjusted test passes against Windows Server 2022.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 months agosmbtorture: adjust "base.delaywrite.update of write time and SMBwrite truncate expand...
Ralph Boehme [Tue, 4 Mar 2025 15:32:11 +0000 (16:32 +0100)] 
smbtorture: adjust "base.delaywrite.update of write time and SMBwrite truncate expand" for modern SMB delayed write

The adjusted test passes against Windows Server 2022.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 months agosmbtorture: adjust "base.delaywrite.update of write time and SMBwrite truncate" for...
Ralph Boehme [Tue, 4 Mar 2025 15:32:11 +0000 (16:32 +0100)] 
smbtorture: adjust "base.delaywrite.update of write time and SMBwrite truncate" for modern SMB delayed write

The adjusted test passes against Windows Server 2022.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 months agosmbtorture: adjust "base.delaywrite.delayed update of write time" for modern SMB...
Ralph Boehme [Tue, 4 Mar 2025 15:32:11 +0000 (16:32 +0100)] 
smbtorture: adjust "base.delaywrite.delayed update of write time" for modern SMB delayed write

The adjusted test passes against Windows Server 2022.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 months agosmbtorture: adjust "base.delaywrite.finfo update on close" for modern SMB delayed...
Ralph Boehme [Mon, 3 Mar 2025 20:19:55 +0000 (21:19 +0100)] 
smbtorture: adjust "base.delaywrite.finfo update on close" for modern SMB delayed write

The adjusted test passes against Windows Server 2022.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 months agosmbtorture: change variable name in SET_INFO_FILE_EX macro
Ralph Boehme [Mon, 10 Mar 2025 15:18:30 +0000 (16:18 +0100)] 
smbtorture: change variable name in SET_INFO_FILE_EX macro

Allows using the variable name sfinfo in functions that use the macro. No change
in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 months agosmbtorture: whitespace in test_delayed_write_update2()
Ralph Boehme [Wed, 5 Mar 2025 05:09:40 +0000 (06:09 +0100)] 
smbtorture: whitespace in test_delayed_write_update2()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 months agolibtorture: add torture_assert_nttime_not_equal[_goto]()
Ralph Boehme [Thu, 6 Mar 2025 11:41:57 +0000 (12:41 +0100)] 
libtorture: add torture_assert_nttime_not_equal[_goto]()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 months agosmbd: remove get_change_timespec()
Ralph Boehme [Fri, 14 Mar 2025 06:59:33 +0000 (07:59 +0100)] 
smbd: remove get_change_timespec()

Return ctime from the filesystem instead of mtime. Adjust existing tests
by removing ctime check.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 months agosmbd: check allocsize change request against current allocsize
Ralph Boehme [Mon, 10 Mar 2025 13:03:33 +0000 (14:03 +0100)] 
smbd: check allocsize change request against current allocsize

Cf MS-FSA 2.1.5.15.1 FileAllocationInformation:

  If Open.Stream.AllocationSize is equal to NewAllocationSize,
  the operation MUST return STATUS_SUCCESS.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 months agomanpages:smb.conf: disable roaming profiles with 'logon path ='
Douglas Bagnall [Thu, 20 Mar 2025 21:28:23 +0000 (10:28 +1300)] 
manpages:smb.conf: disable roaming profiles with 'logon path ='

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Mar 26 01:51:40 UTC 2025 on atb-devel-224

4 months agomanpages:net: use &doc.version;
Douglas Bagnall [Thu, 20 Mar 2025 00:23:00 +0000 (13:23 +1300)] 
manpages:net: use &doc.version;

and we don't claim it is "complete", which *maybe* was true for
3.0.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agodoc: mention an smbspool / krb5 detail
Björn Jacke [Wed, 28 Aug 2013 20:53:17 +0000 (22:53 +0200)] 
doc: mention an smbspool / krb5 detail

argv[2] (username) is being used for krb5 ticket cache. Thanks to
Christian Perrier.

REF: https://bugs.debian.org/387266
BUG: https://bugzilla.samba.org/show_bug.cgi?id=4104

Signed-off-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agomanpages:vfs_shell_snap: format smbconf examples on one line
Douglas Bagnall [Wed, 19 Mar 2025 03:20:20 +0000 (16:20 +1300)] 
manpages:vfs_shell_snap: format smbconf examples on one line

The HTML version has been looking like:

    [share]
    vfs objects = shell_snap
    shell_snap:check path command =
       snap_check_path.sh
    shell_snap:create command =
       snap_create.sh
    shell_snap:delete command =
       snap_delete.sh

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agomanpages: avoid extra blank line at end of <programlisting>
Douglas Bagnall [Wed, 19 Mar 2025 03:13:46 +0000 (16:13 +1300)] 
manpages: avoid extra blank line at end of <programlisting>

Any whitespace there makes the program listing an extra line longer in
HTML put which is probably never intentional.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agosamba-tool domain backup: add --no-sysvol option
Thomas Karlsson [Wed, 19 Mar 2025 01:40:22 +0000 (14:40 +1300)] 
samba-tool domain backup: add --no-sysvol option

In some circumstances sysvol is not wanted in a backup.

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

Signed-off-by: Thomas Karlsson <thomas.karlsson@relea.se>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agopython:gp_cert_auto_enrol: fix GUID stringification
Douglas Bagnall [Mon, 24 Mar 2025 22:26:12 +0000 (22:26 +0000)] 
python:gp_cert_auto_enrol: fix GUID stringification

We were using some broken ad-hoc unpacking to do what the ndr
unpacker does perfectly well.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Tue Mar 25 05:21:49 UTC 2025 on atb-devel-224

4 months agosamba-tool gpo: better entities check copes with new lines
Douglas Bagnall [Fri, 14 Mar 2025 04:45:18 +0000 (17:45 +1300)] 
samba-tool gpo: better entities check copes with new lines

Per https://www.w3.org/TR/xml/#sec-entity-decl (and MS references)
there is always some whitespace between '<!ENTITY' and the name, and
between the name and whatever is next. Also, it is valid XML to have
newlines inside entity declarations, like this:

<!ENTITY
    bubble
      "*S-1-5-113"
      >

We used to create such files, so we should allow them.

There is a kind of entity that has '%' before the name, and there are
non-ascii names, which we continue not to support.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agosamba-tool gpo backup fix --generalize
Douglas Bagnall [Fri, 14 Mar 2025 08:55:29 +0000 (21:55 +1300)] 
samba-tool gpo backup fix --generalize

This was broken with commit ce56d336f234febfd4cb3da11dd584842c24ce1d
but we didn't notice because the test was already broken.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agopytest: samba-tool gpo: fix has_difference(sortlines=True)
Douglas Bagnall [Fri, 14 Mar 2025 06:52:57 +0000 (19:52 +1300)] 
pytest: samba-tool gpo: fix has_difference(sortlines=True)

We had

             file1 = open(path1).readlines()
             file1.sort()
             file2 = open(path1).readlines()
             file2.sort()

which is opening path1 in both cases.

This meant we were testing nothing because the assertions are all that
the files are the same -- though the only affected check is one in
test_backup_restore_generalize().

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agopython:netcmd:gpo: fix crash when updating an MOTD GPO
Andreas Hasenack [Tue, 18 Feb 2025 15:43:46 +0000 (12:43 -0300)] 
python:netcmd:gpo: fix crash when updating an MOTD GPO

When the policy exists already, there is no exception and the code
tries to use the "data" variable, but it doesn't exist because it was
only defined in the exception handling.

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

Signed-off-by: Andreas Hasenack <andreas.hasenack@canonical.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agopytest: check we can set GPO more than once
Douglas Bagnall [Fri, 14 Mar 2025 05:22:53 +0000 (18:22 +1300)] 
pytest: check we can set GPO more than once

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agopytest: samba-tool gpo: close opened files
Douglas Bagnall [Fri, 14 Mar 2025 06:48:54 +0000 (19:48 +1300)] 
pytest: samba-tool gpo: close opened files

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agosamba-tool gpo: close opened files
Douglas Bagnall [Fri, 14 Mar 2025 06:47:53 +0000 (19:47 +1300)] 
samba-tool gpo: close opened files

It is almost certain that we are not going to run out of files, as
they get garbage collected anyway, but in some circumstances these can
fill your screen with "ResourceWarning: unclosed file" messages, which
hides the real messages.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
4 months agopython:ntacls: pull allow list out of loop
Douglas Bagnall [Fri, 7 Mar 2025 02:51:18 +0000 (15:51 +1300)] 
python:ntacls: pull allow list out of loop

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Mar 19 15:56:38 UTC 2025 on atb-devel-224

4 months agopython/ntacls.py: only allow allow and deny ACEs in setntacl()
Ralph Boehme [Mon, 31 Jul 2023 13:24:19 +0000 (15:24 +0200)] 
python/ntacls.py: only allow allow and deny ACEs in setntacl()

Commit 27dd0afb62d4f7427c966e984c7c8b01bc4d93b5 introduced a
regression.

Before that commit we included only SEC_ACE_TYPE_ACCESS_ALLOWED(0)
as 'not type & SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT' filtered out
SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT(5), but also
SEC_ACE_TYPE_ACCESS_DENIED and SEC_ACE_TYPE_ACCESS_DENIED_OBJECT.

After that commit we started to include
SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT, which is wrong.

It was also always wrong to exclude SEC_ACE_TYPE_ACCESS_DENIED(1).

So now we make it explicit that we only include
SEC_ACE_TYPE_ACCESS_ALLOWED and SEC_ACE_TYPE_ACCESS_DENIED.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 months agopython/provision: avoid SDDL conversion in set_dir_acl()
Ralph Boehme [Mon, 31 Jul 2023 13:56:26 +0000 (15:56 +0200)] 
python/provision: avoid SDDL conversion in set_dir_acl()

This is not needed and has the potential to loose
information if the sddl code wouldn't have all features
implemented.

No intended change in behaviour.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 months agopython/policies.py: avoid SDDL conversion for dsacl2fsacl
Ralph Boehme [Mon, 31 Jul 2023 13:56:26 +0000 (15:56 +0200)] 
python/policies.py: avoid SDDL conversion for dsacl2fsacl

This is not needed and has the potential to loose
information if the sddl code wouldn't have all features
implemented.

No intended change in behaviour.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 months agopython/gpo.py: avoid SDDL conversion for dsacl2fsacl
Ralph Boehme [Mon, 31 Jul 2023 13:56:26 +0000 (15:56 +0200)] 
python/gpo.py: avoid SDDL conversion for dsacl2fsacl

This is not needed and has the potential to loose
information if the sddl code wouldn't have all features
implemented.

No intended change in behaviour.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 months agopytest:ntacls: test dsacl2fsacl() with a few strings
Douglas Bagnall [Fri, 7 Mar 2025 02:54:08 +0000 (15:54 +1300)] 
pytest:ntacls: test dsacl2fsacl() with a few strings

The fsacl should end up without object ACEs, and with some flags set
and mask changes.

We are so far only testing with allow, deny, and object ACEs.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agovfs_ceph_new: Add path based fallback for SMB_VFS_FNTIMES
Anoop C S [Mon, 17 Mar 2025 14:22:10 +0000 (19:52 +0530)] 
vfs_ceph_new: Add path based fallback for SMB_VFS_FNTIMES

Fallback mechanism was missing in vfs_ceph_fntimes() for path
based call.

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

Signed-off-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 Mar 17 20:48:55 UTC 2025 on atb-devel-224

4 months agovfs_ceph_new: Add path based fallback for SMB_VFS_FCHMOD
Anoop C S [Fri, 14 Mar 2025 14:29:33 +0000 (19:59 +0530)] 
vfs_ceph_new: Add path based fallback for SMB_VFS_FCHMOD

Fallback mechanism was missing in vfs_ceph_fchmod() for path based call.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agovfs_ceph_new: Add path based fallback for SMB_VFS_FCHOWN
Anoop C S [Fri, 14 Mar 2025 14:17:42 +0000 (19:47 +0530)] 
vfs_ceph_new: Add path based fallback for SMB_VFS_FCHOWN

Fallback mechanism was missing in vfs_ceph_fchown() for path based call.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
5 months agoctdb/doc: document the newly added option to not register the helper
John Mulligan [Mon, 10 Mar 2025 20:47:10 +0000 (16:47 -0400)] 
ctdb/doc: document the newly added option to not register the helper

Add the newly established -R (no-register) option to allow skipping the
registration of the helper as a ceph service.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Mar 14 09:42:02 UTC 2025 on atb-devel-224

5 months agoctdb/ceph: add option to not register mutex rados helper as a service
John Mulligan [Tue, 4 Mar 2025 20:43:52 +0000 (15:43 -0500)] 
ctdb/ceph: add option to not register mutex rados helper as a service

Add a new `-R` option (no-register) that will skip the step of
registering the lock helper as a ceph service. Ceph will treat the lock
helper more like a typical rados client. The `ceph -s` output will not
have ctdb listed under the services section (previous output):
```
  cluster:
    id:     5b81295a-fdec-11ef-a18f-525400220000
    health: HEALTH_WARN
            1 stray daemon(s) not managed by cephadm

  services:
    mon:  3 daemons, quorum ceph0,ceph1,ceph2 (age 6m)
    mgr:  ceph0.mkodry(active, since 85s)
    mds:  1/1 daemons up
    osd:  6 osds: 6 up (since 52m), 6 in (since 52m)
    ctdb: 1 daemon active (1 hosts)
```

Most importantly, this will avoid triggering health warnings from ceph
when cephadm discovers services that it did not create (or directly
manage) listed in the cluster.  Something we looked into hiding on the
cephadm side but proved quite tricky so it's better off not to try this
registration on cephadm managed clusters in the first place.

In addition, the `1 daemon active` bit is somewhat confusing when you
have a N (N>1) node ctdb cluster managed by cephadm. The fact that the
mutex helper only runs on one of those nodes at once is a low level
implementation detail that most users do not need and I assume could
confuse.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
5 months agomanpages:samba-tool: sort 'service-account' into place alphabetically
Douglas Bagnall [Wed, 5 Mar 2025 00:20:26 +0000 (13:20 +1300)] 
manpages:samba-tool: sort 'service-account' into place alphabetically

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Mar 12 20:55:01 UTC 2025 on atb-devel-224

5 months agomanpages: samba-tool gpo manage smb_conf list/set
Douglas Bagnall [Tue, 4 Mar 2025 23:28:45 +0000 (12:28 +1300)] 
manpages: samba-tool gpo manage smb_conf list/set

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agopytests: samba_tool.help checks you updated the man page
Douglas Bagnall [Thu, 15 Sep 2022 04:14:49 +0000 (16:14 +1200)] 
pytests: samba_tool.help checks you updated the man page

It tries to help by printing something that is a little bit like the
correct DocBook text to insert.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agopytest:samba-tool: .check_output() can set environment
Douglas Bagnall [Tue, 4 Mar 2025 22:39:17 +0000 (11:39 +1300)] 
pytest:samba-tool: .check_output() can set environment

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool user sensitive
Douglas Bagnall [Sun, 2 Mar 2025 01:06:44 +0000 (14:06 +1300)] 
manpages:samba-tool user sensitive

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool user addunixattrs
Douglas Bagnall [Sun, 2 Mar 2025 01:06:21 +0000 (14:06 +1300)] 
manpages:samba-tool user addunixattrs

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool ntacl getdosinfo (stub)
Douglas Bagnall [Sun, 2 Mar 2025 01:03:43 +0000 (14:03 +1300)] 
manpages:samba-tool ntacl getdosinfo (stub)

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool group addunixattrs
Douglas Bagnall [Sun, 2 Mar 2025 01:03:01 +0000 (14:03 +1300)] 
manpages:samba-tool group addunixattrs

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool gpo restore typo
Douglas Bagnall [Sun, 2 Mar 2025 01:02:26 +0000 (14:02 +1300)] 
manpages:samba-tool gpo restore typo

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool gpo manage security set
Douglas Bagnall [Sun, 2 Mar 2025 01:01:53 +0000 (14:01 +1300)] 
manpages:samba-tool gpo manage security set

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool gpo manage security list
Douglas Bagnall [Sun, 2 Mar 2025 01:00:36 +0000 (14:00 +1300)] 
manpages:samba-tool gpo manage security list

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool: separate passwordsettings set/show
Douglas Bagnall [Sun, 2 Mar 2025 00:59:19 +0000 (13:59 +1300)] 
manpages:samba-tool: separate passwordsettings set/show

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool: document -V,--version
Douglas Bagnall [Sun, 2 Mar 2025 00:54:56 +0000 (13:54 +1300)] 
manpages:samba-tool: document -V,--version

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool: document -H options
Douglas Bagnall [Sun, 2 Mar 2025 00:54:27 +0000 (13:54 +1300)] 
manpages:samba-tool: document -H options

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool --help is not man text
Douglas Bagnall [Sun, 2 Mar 2025 00:51:46 +0000 (13:51 +1300)] 
manpages:samba-tool --help is not man text

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool preamble for common options
Douglas Bagnall [Sun, 2 Mar 2025 00:50:50 +0000 (13:50 +1300)] 
manpages:samba-tool preamble for common options

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool gpo load
Douglas Bagnall [Thu, 27 Feb 2025 04:45:30 +0000 (17:45 +1300)] 
manpages: samba-tool gpo load

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool gpo cse register
Douglas Bagnall [Thu, 27 Feb 2025 04:44:45 +0000 (17:44 +1300)] 
manpages: samba-tool gpo cse register

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool cse list
Douglas Bagnall [Thu, 27 Feb 2025 04:44:14 +0000 (17:44 +1300)] 
manpages: samba-tool cse list

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool gpo backup
Douglas Bagnall [Thu, 27 Feb 2025 04:43:12 +0000 (17:43 +1300)] 
manpages: samba-tool gpo backup

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool gpo admx load
Douglas Bagnall [Thu, 27 Feb 2025 04:42:36 +0000 (17:42 +1300)] 
manpages: samba-tool gpo admx load

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agopython:getopt: hack to generate docbook stubs from --help
Douglas Bagnall [Thu, 27 Feb 2025 04:42:08 +0000 (17:42 +1300)] 
python:getopt: hack to generate docbook stubs from --help

We have many many samba-tool subcommands that are not documented in
the manpage. Often the --help text is a good place to start, but doing
it entirely manually is VERY tedious.

This automates some of the process.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool gpo aclcheck
Douglas Bagnall [Thu, 27 Feb 2025 04:37:39 +0000 (17:37 +1300)] 
manpages: samba-tool gpo aclcheck

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool drs uptodateness
Douglas Bagnall [Thu, 27 Feb 2025 04:36:48 +0000 (17:36 +1300)] 
manpages: samba-tool drs uptodateness

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool drs clone-dc-database
Douglas Bagnall [Thu, 27 Feb 2025 04:36:09 +0000 (17:36 +1300)] 
manpages: samba-tool drs clone-dc-database

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages:samba-tool domain tombstones expunge
Douglas Bagnall [Wed, 5 Mar 2025 00:07:25 +0000 (13:07 +1300)] 
manpages:samba-tool domain tombstones expunge

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool domain: consistent sddl example
Douglas Bagnall [Thu, 27 Feb 2025 02:35:45 +0000 (15:35 +1300)] 
manpages: samba-tool domain: consistent sddl example

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool processes
Douglas Bagnall [Thu, 27 Feb 2025 02:34:33 +0000 (15:34 +1300)] 
manpages: samba-tool processes

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool domain schemaupgrade
Douglas Bagnall [Thu, 27 Feb 2025 02:34:09 +0000 (15:34 +1300)] 
manpages: samba-tool domain schemaupgrade

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool kds root-key sub-options
Douglas Bagnall [Thu, 27 Feb 2025 02:33:01 +0000 (15:33 +1300)] 
manpages: samba-tool kds root-key sub-options

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool domain functionalprep
Douglas Bagnall [Thu, 27 Feb 2025 02:31:50 +0000 (15:31 +1300)] 
manpages: samba-tool domain functionalprep

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: samba-tool dns zoneoptions
Douglas Bagnall [Thu, 27 Feb 2025 02:31:00 +0000 (15:31 +1300)] 
manpages: samba-tool dns zoneoptions

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: add samba-tool dns cleanup
Douglas Bagnall [Thu, 27 Feb 2025 02:30:30 +0000 (15:30 +1300)] 
manpages: add samba-tool dns cleanup

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agomanpages: add samba-tool delegation {add,del}-principal
Douglas Bagnall [Thu, 27 Feb 2025 02:30:03 +0000 (15:30 +1300)] 
manpages: add samba-tool delegation {add,del}-principal

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
5 months agopylibsmb: do not use obsolete PyEval_InitThreads() for Python > 3.6
Dmitry Antipov [Wed, 8 Feb 2023 08:59:59 +0000 (11:59 +0300)] 
pylibsmb: do not use obsolete PyEval_InitThreads() for Python > 3.6

Do not use obsolete PyEval_InitThreads() for Python > 3.6:

../../source3/libsmb/pylibsmb.c: In function ‘py_cli_state_setup_mt_ev’:
../../source3/libsmb/pylibsmb.c:271:9: warning: ‘PyEval_InitThreads’ is
deprecated [-Wdeprecated-declarations]
  271 |         PyEval_InitThreads();
      |         ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:95,
                 from ../../source3/libsmb/pylibsmb.c:48:
/usr/include/python3.11/ceval.h:132:37: note: declared here
  132 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);

Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Mar 12 04:36:21 UTC 2025 on atb-devel-224

5 months agopylibsmb: fix cast warnings in Python method definitions
Dmitry Antipov [Wed, 8 Feb 2023 09:03:16 +0000 (12:03 +0300)] 
pylibsmb: fix cast warnings in Python method definitions

Fix the following cast warnings in Python method definitions:

../../source3/libsmb/pylibsmb.c:1867:28: warning: cast between incompatible
function types from ‘PyObject * (*)(struct py_cli_notify_state *, PyObject *,
PyObject *)’ {aka ‘struct _object * (*)(struct py_cli_notify_state *, struct
_object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’
{aka ‘struct _object * (*)(struct _object *, struct _object *)’}
[-Wcast-function-type]
 1867 |                 .ml_meth = (PyCFunction)py_cli_notify_get_changes,
      |                            ^

../../source3/libsmb/pylibsmb.c:2661:11: warning: cast between incompatible
function types from ‘PyObject * (*)(struct py_cli_state *, PyObject *,
PyObject *)’ {aka ‘struct _object * (*)(struct py_cli_state *, struct
_object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’
{aka ‘struct _object * (*)(struct _object *, struct _object *)’}
[-Wcast-function-type]
 2661 |           (PyCFunction)py_cli_fsctl,
      |           ^

Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 months agolibrpc/wsp: use unsigned char for high byte comparison
Douglas Bagnall [Thu, 28 Nov 2024 03:06:10 +0000 (16:06 +1300)] 
librpc/wsp: use unsigned char for high byte comparison

../../librpc/wsp/wsp_util.c:244:28: warning: result of comparison of constant 160 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
  244 |                 if (strlen(t) == 1 && *t == 0xa0) {

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 months agos4/ldap server: avoid NULL deref if search control has no data
Douglas Bagnall [Thu, 23 Apr 2020 03:33:59 +0000 (15:33 +1200)] 
s4/ldap server: avoid NULL deref if search control has no data

We switch to ldb_request_replace_control() so that the old search
control is removed in the NULL data case.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 months agos3/lib: fix matching interfaces with multiple assigned IPs
Ralph Boehme [Mon, 10 Mar 2025 13:29:23 +0000 (14:29 +0100)] 
s3/lib: fix matching interfaces with multiple assigned IPs

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Mar 12 01:32:30 UTC 2025 on atb-devel-224

5 months agovfs_ceph_new: detect case sensitivity in CephFS
Xavi Hernandez [Tue, 4 Mar 2025 11:48:41 +0000 (12:48 +0100)] 
vfs_ceph_new: detect case sensitivity in CephFS

CephFS has recently added support for case insensitive access to the
file system. This modification detects whether the shared volume is case
sensitive or not and reports the FILE_CASE_SENSITIVE_SEARCH capability
accordingly.

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

Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Reviewed-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Mar 11 20:34:26 UTC 2025 on atb-devel-224

5 months agos3:utils: Remove call of ads_startup() from net_ads_keytab_create()
Pavel Filipenský [Thu, 6 Mar 2025 14:24:05 +0000 (15:24 +0100)] 
s3:utils: Remove call of ads_startup() from net_ads_keytab_create()

Calling ads_startup() is not needed in net_ads_keytab_create.  Keytab
creation code in sync_pw2keytabs() decides if it needs to talk to DC or
not and connects to AD accordingly.

Fixing this, makes the bug below easier to reproduce using
'net ads keytab create'.

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

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 Mar 10 11:09:29 UTC 2025 on atb-devel-224

5 months agos3:libads: Make sure that REALM is always added to keytab principals
Pavel Filipenský [Fri, 7 Mar 2025 09:32:40 +0000 (10:32 +0100)] 
s3:libads: Make sure that REALM is always added to keytab principals

The code responsible for adding SPNs to keytab should always set the
REALM part.  Current code is not adding it for e.g. SPNs synced from AD.

If REALM is missing, krb5_parse_name() will succeed (and add the REALM)
only if the krb5.conf contains libdefaults section with
default_realm set and will fail otherwise. E.g.:

[libdefaults]
default_realm = SOMETESTDOMAIN1.MY.COM

When calling 'net ads join' we get the following error if SPN is missing
REALM and krb5.conf does not provide the default_realm:

pw2kt_process_add_info: Failed to parse principal:
RestrictedKrbHost/$MACHINE_NAME
Failed to join domain: failed to create kerberos keytab

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

Pair-Programmed-With: Noel Power <noel.power@suse.com>

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Sun Mar  9 00:25:08 UTC 2025 on atb-devel-224

5 months agolib:krb5_wrap: Add smb_krb5_parse_name_flags()
Pavel Filipenský [Thu, 6 Mar 2025 22:20:53 +0000 (23:20 +0100)] 
lib:krb5_wrap: Add smb_krb5_parse_name_flags()

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
5 months agodocs-xml: enable SMB3 Unix Extensions by default
Ralph Boehme [Wed, 5 Mar 2025 17:02:39 +0000 (18:02 +0100)] 
docs-xml: enable SMB3 Unix Extensions by default

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Mar  7 20:06:31 UTC 2025 on atb-devel-224

5 months agos3/param: remove widelinks check and warning for SMB3 UNIX Extensions
Ralph Boehme [Wed, 5 Mar 2025 17:00:33 +0000 (18:00 +0100)] 
s3/param: remove widelinks check and warning for SMB3 UNIX Extensions

SMB3 POSIX clients won't be able to create real symlinks, so we can relax these
checks.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 months agos3:locking: make sure brl_conflict_posix() is only called with 2 POSIX_LOCKS
Ralph Boehme [Fri, 7 Mar 2025 13:51:26 +0000 (14:51 +0100)] 
s3:locking: make sure brl_conflict_posix() is only called with 2 POSIX_LOCKS

Otherwise we hit the assert if the caller is a windows lock
and the conflicting one a posix lock.

Or in the non-developer build we don't enforce the windows locking
rules.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 months agos3:locking: assert POSIX_LOCK in brl_[un]lock_posix()
Ralph Boehme [Fri, 7 Mar 2025 13:47:49 +0000 (14:47 +0100)] 
s3:locking: assert POSIX_LOCK in brl_[un]lock_posix()

This makes it clearer and prevents possible problems in future.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 months agos3:locking: init_strict_lock_struct() already calls lp_posix_cifsu_locktype()
Stefan Metzmacher [Fri, 7 Mar 2025 12:50:54 +0000 (13:50 +0100)] 
s3:locking: init_strict_lock_struct() already calls lp_posix_cifsu_locktype()

There is no need to do it in the caller and pass an unused argument.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 months agosmbd: fix lock_flav initialization in smbd_smb2_lock_send()
Ralph Boehme [Fri, 7 Mar 2025 13:14:32 +0000 (14:14 +0100)] 
smbd: fix lock_flav initialization in smbd_smb2_lock_send()

Right above we did

        if (posix_handle) {
                locks[i].lock_flav = POSIX_LOCK;
        } else {
                locks[i].lock_flav = WINDOWS_LOCK;
        }

which came in with commit f68fffa85d1de992384a210bb0b9261cda3fb168,
apparently forgetting to remove the previously existing initialization
locks[i].lock_flav=WINDOWS_LOCK.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 months agosmbd: fix check for POSIX opens in have_file_open_below()
Ralph Boehme [Fri, 7 Mar 2025 11:57:24 +0000 (12:57 +0100)] 
smbd: fix check for POSIX opens in have_file_open_below()

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 months agosmbd: fix checks for POSIX opens in file_find_subpath()
Ralph Boehme [Fri, 7 Mar 2025 11:57:07 +0000 (12:57 +0100)] 
smbd: fix checks for POSIX opens in file_find_subpath()

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 months agovfs_ceph_new: Do not resolve by inode number
Anoop C S [Tue, 25 Feb 2025 12:10:13 +0000 (17:40 +0530)] 
vfs_ceph_new: Do not resolve by inode number

CephFS snapshots within snap directory shares the same inode number from
its parent. Until unless we resolve by name we may incorrectly point at
an inode which is not a snapshot directory. Therefore to be functionally
correct we avoid resolving by inode number but proper name.

For example:

path (ino = 3)
  |
  --- dir (ino = 4)
  |
  --- .snap (ino = 3)
        |
        --- snap1 (ino = 3)
              |
              --- dir (ino = 4)

In this case an attempt to resolve 'snap1' by inode number 3 results in
pointing at 'path' which is not the desired outcome.

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

Signed-off-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 Mar  7 18:20:47 UTC 2025 on atb-devel-224

5 months agovfs_ceph_new: Handle absolute path in vfs_ceph_ll_walk
Anoop C S [Mon, 24 Feb 2025 08:30:56 +0000 (14:00 +0530)] 
vfs_ceph_new: Handle absolute path in vfs_ceph_ll_walk

It can very well be the case that the incoming path is absolute in
nature which breaks the assumption inside vfs_ceph_ll_walk that it
is within the current working directory. Instead perform a check to
see whether the path includes current working directory path in its
components and accordingly trim it to make it relative in nature.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
5 months agovfs_ceph_new: Remove unused code in cephmount_mount_fs()
Anoop C S [Mon, 24 Feb 2025 06:39:06 +0000 (12:09 +0530)] 
vfs_ceph_new: Remove unused code in cephmount_mount_fs()

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
5 months agovfs_ceph_new: Remove redundant re-intialization to NULL
Anoop C S [Mon, 24 Feb 2025 06:24:45 +0000 (11:54 +0530)] 
vfs_ceph_new: Remove redundant re-intialization to NULL

TALLOC_FREE() by default re-initializes the pointer to NULL after
corresponding memory is freed.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
5 months agos4:auth: let auth_user_info_dc_expand_sids() add This Organization SID
Stefan Metzmacher [Thu, 6 Mar 2025 10:08:37 +0000 (11:08 +0100)] 
s4:auth: let auth_user_info_dc_expand_sids() add This Organization SID

We do that unless the Other Organization SID is already there.

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 Mar  6 17:35:50 UTC 2025 on atb-devel-224

5 months agos4:dsdb/tests: let the token_group.py test work against Windows 2025
Stefan Metzmacher [Thu, 6 Mar 2025 12:40:30 +0000 (13:40 +0100)] 
s4:dsdb/tests: let the token_group.py test work against Windows 2025

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 months agovfs: Simplify DBGs
Volker Lendecke [Wed, 26 Feb 2025 12:20:36 +0000 (13:20 +0100)] 
vfs: Simplify DBGs

Avoid casts: We have PRIu64, size_t is printed with %zu. Only off_t
must be cast to intmax_t, but for that we should not need a macro.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Mar  5 18:42:03 UTC 2025 on atb-devel-224

5 months agolib: Remove unused next_token()
Volker Lendecke [Wed, 19 Feb 2025 06:25:05 +0000 (07:25 +0100)] 
lib: Remove unused next_token()

Replaced by next_token_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 months agotorture4: Test next_token_talloc() instead of next_token()
Volker Lendecke [Wed, 19 Feb 2025 06:22:43 +0000 (07:22 +0100)] 
torture4: Test next_token_talloc() instead of next_token()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 months agonsswitch: Remove next_token() from torture4
Volker Lendecke [Wed, 19 Feb 2025 06:14:22 +0000 (07:14 +0100)] 
nsswitch: Remove next_token() from torture4

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 months agonsswitch: Remove next_token() from wbinfo
Volker Lendecke [Tue, 18 Feb 2025 15:17:03 +0000 (16:17 +0100)] 
nsswitch: Remove next_token() from wbinfo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 months agosmbd: Remove unused recursive_rmdir()
Volker Lendecke [Fri, 24 Jan 2025 10:26:32 +0000 (11:26 +0100)] 
smbd: Remove unused recursive_rmdir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 months agovfs: Rewrite vfs_streams_depot
Volker Lendecke [Fri, 3 Jan 2025 14:24:01 +0000 (15:24 +0100)] 
vfs: Rewrite vfs_streams_depot

This started when I found vfs_streams_depot() is the last user of
recursive_rmdir() and ended as a pretty complete rewrite. Why? This
new version does not call the path-based NEXT_[L]STAT routines
anymore, it only uses FSTATAT. This is one tiny step towards getting
rid of the path-based calls we still have that implicitly depend on
the current working directory. In some distant future I want to get
rid of our chdir() calls and do everything relative to a O_PATH handle
that we opened on the share root when connecting to a share.

This patch removes a few lines, and I don't see a reasonable way to do
this in micro-steps. Structurally it should be simple though:
Everything works off streams_depot_rootdir_pathref(), which gives a
pathref fsp to the ".streams" directory, stream_dir_pathref() turns
this into a pathref of the actual per-file subdirectory.

We also have to remove the special handling of absolute paths in
vfs_shadow_copy2, streams_depot does not send absolute paths anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 months agovfs: Slightly simplify streams_depot_fstreaminfo()
Volker Lendecke [Fri, 24 Jan 2025 10:21:32 +0000 (11:21 +0100)] 
vfs: Slightly simplify streams_depot_fstreaminfo()

Use metadata_fsp()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>