]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
17 months agoexamples:winexe: embed Samba version as exe timestamp
Douglas Bagnall [Wed, 29 May 2024 22:44:24 +0000 (10:44 +1200)] 
examples:winexe: embed Samba version as exe timestamp

It turns out the timestamp doesn't need to be real, and it isn't used,
but it might as well tell you something. So let's make it tell you what
version of Samba it came from, which could be useful for people who have
lots of old winexes lying around, the poor souls.

00000040  0e 1f ba 0e 00 b4 09 cd  21 b8 01 4c cd 21 54 68  |........!..L.!Th|
00000050  69 73 20 70 72 6f 67 72  61 6d 20 63 61 6e 6e 6f  |is program canno|
00000060  74 20 62 65 20 72 75 6e  20 69 6e 20 44 4f 53 20  |t be run in DOS |
00000070  6d 6f 64 65 2e 0d 0d 0a  24 00 00 00 00 00 00 00  |mode....$.......|
00000080  50 45 00 00 64 86 0a 00  00 15 04 00 00 00 00 00  |PE..d...........|
                                    |  |  |
                                    |  |  major  4.
                                    |  minor     21.
                                    release      0

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

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): Fri May 31 01:28:06 UTC 2024 on atb-devel-224

17 months agoexamples:winexe: reproducible builds with zero timestamp
Douglas Bagnall [Mon, 27 May 2024 23:34:51 +0000 (11:34 +1200)] 
examples:winexe: reproducible builds with zero timestamp

Windows Portable Executable files have a timestamp field and a
checksum field. By default the timestamp field is updated to the
current time, which consequently changes the checksum. This makes the
build nondeterministic. It looks like this:

  --- a/tmp/winexe-1/winexesvc64_exe_binary.c
  +++ b/tmp/winexe-2/winexesvc64_exe_binary.c
  @@ -23,7 +23,7 @@ const DATA_BLOB *winexesvc64_exe_binary(void)
                0x6D, 0x6F, 0x64, 0x65, 0x2E, 0x0D, 0x0D, 0x0A,
                0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x50, 0x45, 0x00, 0x00, 0x64, 0x86, 0x0A, 0x00,
  -             0xB2, 0x16, 0x55, 0x66, 0x00, 0x00, 0x00, 0x00,
  +             0xD3, 0x3B, 0x55, 0x66, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x2E, 0x02,
                0x0B, 0x02, 0x02, 0x26, 0x00, 0x86, 0x00, 0x00,
                0x00, 0xBA, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00,
  @@ -33,7 +33,7 @@ const DATA_BLOB *winexesvc64_exe_binary(void)
                0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x40, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00,
  -             0x73, 0xD7, 0x00, 0x00, 0x03, 0x00, 0x60, 0x01,
  +             0x94, 0xFC, 0x00, 0x00, 0x03, 0x00, 0x60, 0x01,
                0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,

https://learn.microsoft.com/en-us/windows/win32/debug/pe-format says
that a timestamp of zero can be used to represent a time that is not
"real or meaningful", so we do that.

As far as I can tell, the timestamp and checksum are only used in
DLLs, not directly executed .exe files.

Thanks to Freexian and the Debian LTS project for sponsoring this work.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoexamples:winexe: more efficient C array generation, no py2
Douglas Bagnall [Mon, 27 May 2024 23:16:23 +0000 (11:16 +1200)] 
examples:winexe: more efficient C array generation, no py2

We don't need to recreate the src array every time, and we don't need
to worry about Python 2 strings.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agobuildtools:pidl: avoid hash randomisation in pidl
Douglas Bagnall [Tue, 28 May 2024 00:17:06 +0000 (12:17 +1200)] 
buildtools:pidl: avoid hash randomisation in pidl

Like many languages, Perl uses has randomisation to prevent nasty
users using crafted values that hash to the same number to effect a
denial of service. This means the traversal order of perl HASH tables
is different every time.

The IDL handed to pidl is trusted, so we don't really need
randomisation, but we do want to be sure the build is the same every
time.

I am not aware of hash randomisation causing problems, but it seems
prudent to avoid it.

We do a similar thing with PYTHONHASHSEED for the entire build.

Thanks to Freexian and the Debian LTS project for sponsoring this work.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopidl:python: Exception if unconvertable in ConvertObjectToPythonLevel
Douglas Bagnall [Wed, 29 May 2024 22:53:24 +0000 (10:53 +1200)] 
pidl:python: Exception if unconvertable in ConvertObjectToPythonLevel

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopidl:python: properly raise exception in ConvertObjectFromPythonData
Douglas Bagnall [Tue, 28 May 2024 04:32:14 +0000 (16:32 +1200)] 
pidl:python: properly raise exception in ConvertObjectFromPythonData

Without the `$self->pidl("$fail");`, the exception is not raised.

We also try to improve the Python message.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopidl:Typelist: resolveType(): don't mistake a reference for a name
Douglas Bagnall [Wed, 29 May 2024 00:14:04 +0000 (12:14 +1200)] 
pidl:Typelist: resolveType(): don't mistake a reference for a name

This function is only used by Python.pm, and was assuming any argument
unrecognised by hasType is a name. It sometimes isn't, resulting in
structures like this:

{
  'DATA' => {
      'TYPE' => 'STRUCT'
    },
  'NAME' => {
      'TYPE' => 'STRUCT',
      'ALIGN' => undef,
      'SURROUNDING_ELEMENT' => undef,
      'ORIGINAL' => {
      'TYPE' => 'STRUCT',
      'FILE' => 'source3/librpc/idl/smbXsrv.idl',
      'LINE' => 101,
      'NAME' => 'tevent_context'
    },
      'ELEMENTS' => undef,
      'NAME' => 'tevent_context',
      'PROPERTIES' => undef
    },
  'TYPE' => 'TYPEDEF'
      };

The problem with that is we end up with the HASH reference as a name
in Python bindings, like this

      PyErr_SetString(PyExc_TypeError, "Can not convert C Type struct HASH(0x5e2dfe5ee278) from Python");

which makes the build nondeterministic (as well as making the message
a little mysterious).

I think all the structures for which this happens are marked
'[ignore]' in IDL, meaning they are not transmitted on the wire. They
should perhaps also not have useless Python getsetters, but let's call
that a different problem.

Thanks to Freexian and the Debian LTS project for sponsoring this work.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoscript/autobuild.py: Add test for --vendor-name and --vendor-patch-revision
Andrew Bartlett [Thu, 30 May 2024 09:13:01 +0000 (21:13 +1200)] 
script/autobuild.py: Add test for --vendor-name and --vendor-patch-revision

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
17 months agobuild: Add --vendor-name --vendor-patch-revision options to ./configure
Andrew Bartlett [Wed, 29 May 2024 22:50:12 +0000 (10:50 +1200)] 
build: Add --vendor-name --vendor-patch-revision options to ./configure

These options are for packagers and vendors to set so that when
Samba developers are debugging an issue, we know exactly which
package is in use, and so have an idea if any patches have been
applied.

This is included in the string that a Samba backtrace gives,
as part of the PANIC message.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15654
REF: https://lists.samba.org/archive/samba-technical/2024-May/138992.html

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
17 months agopython:smb tests: remove py2 compatibility code
Douglas Bagnall [Tue, 28 May 2024 07:48:04 +0000 (19:48 +1200)] 
python:smb tests: remove py2 compatibility code

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopython/common: remove verbiage about old python versions
Douglas Bagnall [Tue, 28 May 2024 07:46:33 +0000 (19:46 +1200)] 
python/common: remove verbiage about old python versions

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agobuildtools: remove Python2 compatibility
Douglas Bagnall [Tue, 28 May 2024 07:45:17 +0000 (19:45 +1200)] 
buildtools: remove Python2 compatibility

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotdb:pytests: remove unused Py2 test branches
Douglas Bagnall [Tue, 28 May 2024 07:43:53 +0000 (19:43 +1200)] 
tdb:pytests: remove unused Py2 test branches

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb-samba:pytest: remove unused variable
Douglas Bagnall [Tue, 28 May 2024 07:42:45 +0000 (19:42 +1200)] 
ldb-samba:pytest: remove unused variable

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotalloc:pytest: remove tests that only test Python 2
Douglas Bagnall [Tue, 28 May 2024 07:42:04 +0000 (19:42 +1200)] 
talloc:pytest: remove tests that only test Python 2

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotdb:pytdb:_tdb_text: remove Py2 compatibility code
Douglas Bagnall [Tue, 28 May 2024 07:40:39 +0000 (19:40 +1200)] 
tdb:pytdb:_tdb_text: remove Py2 compatibility code

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoselftest:dnshub: remove py2 compatibility code
Douglas Bagnall [Tue, 28 May 2024 07:39:33 +0000 (19:39 +1200)] 
selftest:dnshub: remove py2 compatibility code

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoctdb-scripts: Protect against races when starting grace period
Martin Schwenke [Fri, 10 May 2024 08:00:18 +0000 (18:00 +1000)] 
ctdb-scripts: Protect against races when starting grace period

While the PID check is worth it in relevant cases, NFS-Ganesha still
might go away after the check.  Unfortunately, neither grace command
fails an indicative exit code, so invent one by checking error
messages.  This can then be converted to success by the caller.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu May 30 12:50:01 UTC 2024 on atb-devel-224

17 months agoctdb-scripts: Check NFS-Ganesha is running before attempting grace
Martin Schwenke [Fri, 10 May 2024 07:51:18 +0000 (17:51 +1000)] 
ctdb-scripts: Check NFS-Ganesha is running before attempting grace

If monitoring has failed because it isn't running, then don't fail
"startipreallocate" or "relaseip" by trying to go into grace.

Don't check this for "takeip".  In that case NFS-Ganesha had better be
running.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Improve service PID check
Martin Schwenke [Fri, 10 May 2024 07:46:58 +0000 (17:46 +1000)] 
ctdb-scripts: Improve service PID check

No need to grovel around in /proc.  ps will happily tell us the
command.

Factor out the actual check into a separate function that can be used
elsewhere.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Improve NFS-Ganesha export path extraction
Martin Schwenke [Tue, 30 Apr 2024 05:00:34 +0000 (15:00 +1000)] 
ctdb-scripts: Improve NFS-Ganesha export path extraction

Path values do not need to have quotes.  The current code fails if
there aren't any.

Instead, implement a 2 stage parser using 2 sed commands.  See
comments in the code for details.

Regexps are POSIX basic regular expressions, apart from \<WORD\> (used
to ensure WORD is on word boundaries, and the 'i' flag for case
insensitivity.  The latter is supported in FreeBSD sed.

This code successfully parses Path values out of the following
monstrosity:

path = "/foo/bar1;a";
   Path = /foo/bar2;
Something = false;
Pseudo = "/foo/bar3x" ; Path = "/foo/bar3; y" ; Access_type = RO;
Pseudo = "/foo/bar4x" ; path=/foo/bar4; Access_type = RO;
Pseudo = "/foo/barNONONO" ; not_Path=/foo/barNONONO; Access_type = RO;
   Path = /foo/bar5
Pseudo = "/foo/bar6x Path=foo" ; Path=/foo/bar6; Access_type = RO

This is probably the best that can be done within a shell script.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Add script option CTDB_NFS_EXPORTS_FILE
Martin Schwenke [Wed, 27 Mar 2024 03:24:09 +0000 (14:24 +1100)] 
ctdb-scripts: Add script option CTDB_NFS_EXPORTS_FILE

Exports may be contained in an include file rather than the top-level
ganesha.conf.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Fix usage message
Martin Schwenke [Thu, 6 Jul 2023 03:37:03 +0000 (13:37 +1000)] 
ctdb-scripts: Fix usage message

An IP address is passed to these actions.

Reported-by: Arnab Tah <atah@ddn.com>
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Change NFS-Ganesha PID file location
Martin Schwenke [Thu, 6 Jul 2023 10:28:30 +0000 (20:28 +1000)] 
ctdb-scripts: Change NFS-Ganesha PID file location

This is the current default.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Quote variable expansions
Martin Schwenke [Tue, 5 Mar 2024 03:44:32 +0000 (14:44 +1100)] 
ctdb-scripts: Quote variable expansions

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn"
Martin Schwenke [Tue, 5 Mar 2024 03:26:19 +0000 (14:26 +1100)] 
ctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn"

Best reviewed with "git show -w".

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: No longer run statd-callout under sudo
Martin Schwenke [Mon, 19 Jun 2023 00:39:29 +0000 (10:39 +1000)] 
ctdb-scripts: No longer run statd-callout under sudo

This simplifies and removes a bad hack.  Also, in my test environment,
it also drops the average time take to run an add-client/del-client
pair from ~0.055s to ~0.030s.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Use find_statd_sm_dir() in one more place
Martin Schwenke [Wed, 2 Aug 2023 03:37:03 +0000 (13:37 +1000)] 
ctdb-scripts: Use find_statd_sm_dir() in one more place

Take advantage of new function find_statd_sm_dir() when clearing the
local system statd state directory, so it uses the correct directory
when running on a non-RH distro.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Set ownership of statd-callout state directory
Martin Schwenke [Mon, 19 Jun 2023 02:17:44 +0000 (12:17 +1000)] 
ctdb-scripts: Set ownership of statd-callout state directory

For add-client and del-client, statd-callout is called by rpc.statd,
which runs as rpcuser, statd or some other non-root system user.  This
means that add-client and del-client can't write in the statd-callout
state directory if it is only writable by root.  rpc.statd must be
able to write to its own local system statd state directory, so find
this directory and use it as a reference to set the ownership of
CTDB's statd-callout state directory.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Avoid connecting to ctdbd in add-client/del-client
Martin Schwenke [Thu, 29 Jun 2023 00:12:44 +0000 (10:12 +1000)] 
ctdb-scripts: Avoid connecting to ctdbd in add-client/del-client

rpc.statd runs statd-callout as a non-root user, which is currently
hacked around using some sudo logic that fails to work in some
contexts (e.g. in a container).

Use $CTDB_MY_PUBLIC_IPS_CACHE to access the node's currently assigned
public IPs, for add-client/del-client.  This avoids connecting to
ctdbd when called from rpc.statd.

Also, use $CTDB_MY_PUBLIC_IPS_CACHE in other places where it makes
sense.

Connections to ctdbd are still made in the "notify" action, but this
is always run as root.

In the test code, set the PNN after public addresses setup so that the
cache of assigned IPs correctly initialised.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-tests: Default PNN is 0
Martin Schwenke [Fri, 30 Jun 2023 02:24:30 +0000 (12:24 +1000)] 
ctdb-tests: Default PNN is 0

This is called in a couple of places without an argument, so give it a
default.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Add caching function for public IPs
Martin Schwenke [Thu, 15 Jun 2023 06:21:19 +0000 (16:21 +1000)] 
ctdb-scripts: Add caching function for public IPs

This is way more complicated than I would like but, as per the
comment, this is due to complexities in the way public IPs work.  The
main consumer will be statd-callout, which will then be able to run as
a non-root user.

Also generate the cache file in test code, whenever the PNN is set.
However, this can cause "ctdb ip" to generate a fake IP layout before
public IPs are setup.  So, have the "ctdb ip" stub generate the IP
layout every time it is run to avoid it being stale.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Move state directory creation to "startup" action
Martin Schwenke [Thu, 29 Jun 2023 03:25:03 +0000 (13:25 +1000)] 
ctdb-scripts: Move state directory creation to "startup" action

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Avoid globally changing to queue directory
Martin Schwenke [Wed, 8 May 2024 04:44:13 +0000 (14:44 +1000)] 
ctdb-scripts: Avoid globally changing to queue directory

Add new variables statd_callout_state_dir and statd_callout_queue_dir
- the latter is for files queued by add-client/del-client.

Use $statd_callout_queue_dir to avoid a global cd to the queue
directory near the top of the script.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Move ctdb.tdb attach to statd-callout
Martin Schwenke [Thu, 29 Jun 2023 03:11:46 +0000 (13:11 +1000)] 
ctdb-scripts: Move ctdb.tdb attach to statd-callout

All of the other uses of ctdb.tdb are in statd-callout.

New variable statd_callout_db makes it easy to change the database
name in future, perhaps even allowing it to be configurable.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Reformat with shfmt -w -p -i 0 -fn
Martin Schwenke [Mon, 19 Feb 2024 01:56:46 +0000 (12:56 +1100)] 
ctdb-scripts: Reformat with shfmt -w -p -i 0 -fn

Tweak some lines to avoid overflowing 80 columns.

Best viewed with "git show -w".

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Improve documentation
Martin Schwenke [Tue, 13 Jun 2023 00:39:37 +0000 (10:39 +1000)] 
ctdb-scripts: Improve documentation

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Avoid ShellCheck warning SC2162
Martin Schwenke [Sun, 18 Jun 2023 23:43:33 +0000 (09:43 +1000)] 
ctdb-scripts: Avoid ShellCheck warning SC2162

  SC2162 read without -r will mangle backslashes.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agoctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn"
Martin Schwenke [Fri, 16 Jun 2023 01:09:02 +0000 (11:09 +1000)] 
ctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn"

Best reviewed with "git show -w".

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
17 months agos3:utils: let smbstatus report anonymous signing/encryption explicitly
Stefan Metzmacher [Mon, 3 Jul 2023 13:14:38 +0000 (15:14 +0200)] 
s3:utils: let smbstatus report anonymous signing/encryption explicitly

We should mark sessions/tcons with anonymous encryption or signing
in a special way, as the value of it is void, all based on a
session key with 16 zero bytes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu May 23 13:37:09 UTC 2024 on atb-devel-224

17 months agos3:smbd: allow anonymous encryption after one authenticated session setup
Stefan Metzmacher [Fri, 30 Jun 2023 16:05:51 +0000 (18:05 +0200)] 
s3:smbd: allow anonymous encryption after one authenticated session setup

I have captures where a client tries smb3 encryption on an anonymous session,
we used to allow that before commit da7dcc443f45d07d9963df9daae458fbdd991a47
was released with samba-4.15.0rc1.

Testing against Windows Server 2022 revealed that anonymous signing is always
allowed (with the session key derived from 16 zero bytes) and
anonymous encryption is allowed after one authenticated session setup on
the tcp connection.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
17 months agos3:utils: let smbstatus also report partial tcon signing/encryption
Stefan Metzmacher [Mon, 3 Jul 2023 13:12:38 +0000 (15:12 +0200)] 
s3:utils: let smbstatus also report partial tcon signing/encryption

We already do that for sessions and also for the json output,
but it was missing in the non-json output for tcons.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
17 months agos3:utils: let smbstatus also report AES-256 encryption types for tcons
Stefan Metzmacher [Mon, 3 Jul 2023 13:12:38 +0000 (15:12 +0200)] 
s3:utils: let smbstatus also report AES-256 encryption types for tcons

We already do that for sessions.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
17 months agos3:utils: let connections_forall_read() report if the session was authenticated
Stefan Metzmacher [Mon, 3 Jul 2023 13:10:08 +0000 (15:10 +0200)] 
s3:utils: let connections_forall_read() report if the session was authenticated

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
17 months agos3:lib: let sessionid_traverse_read() report if the session was authenticated
Stefan Metzmacher [Mon, 3 Jul 2023 13:08:31 +0000 (15:08 +0200)] 
s3:lib: let sessionid_traverse_read() report if the session was authenticated

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
17 months agos3:utils: remove unused signing_flags in connections_forall()
Stefan Metzmacher [Mon, 3 Jul 2023 13:05:59 +0000 (15:05 +0200)] 
s3:utils: remove unused signing_flags in connections_forall()

We never use the signing flags from the session, as the tcon
has its own signing flags.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
17 months agos4:torture/smb2: add smb2.session.anon-{encryption{1,2,},signing{1,2}}
Stefan Metzmacher [Wed, 15 May 2024 08:02:00 +0000 (10:02 +0200)] 
s4:torture/smb2: add smb2.session.anon-{encryption{1,2,},signing{1,2}}

These demonstrate how anonymous encryption and signing work.
They pass against Windows 2022 as ad dc.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
17 months agos4:libcli/smb2: add hack to test anonymous signing and encryption
Stefan Metzmacher [Wed, 15 May 2024 08:51:42 +0000 (10:51 +0200)] 
s4:libcli/smb2: add hack to test anonymous signing and encryption

This will be used in torture tests.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
17 months agosmbXcli_base: add hacks to test anonymous signing and encryption
Stefan Metzmacher [Tue, 14 May 2024 16:21:33 +0000 (18:21 +0200)] 
smbXcli_base: add hacks to test anonymous signing and encryption

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
17 months agoldb: move struct ldb_debug_ops to ldb_private.h
Douglas Bagnall [Wed, 22 May 2024 21:40:00 +0000 (09:40 +1200)] 
ldb: move struct ldb_debug_ops to ldb_private.h

Only accessed through struct ldb_context -> debug_ops, which is already private.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu May 23 00:19:30 UTC 2024 on atb-devel-224

17 months agoldb: move struct ldb_utf8_fns to ldb_private.h
Douglas Bagnall [Wed, 22 May 2024 21:36:57 +0000 (09:36 +1200)] 
ldb: move struct ldb_utf8_fns to ldb_private.h

It is only accessed via ldb functions that find it on the already-private
struct ldb_context.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dsdb:strcasecmp_with_ldb_val() avoids overflow
Douglas Bagnall [Sun, 12 May 2024 23:08:35 +0000 (11:08 +1200)] 
s4:dsdb:strcasecmp_with_ldb_val() avoids overflow

In the unlikely event that strlen(str) > INT_MAX, the result could
have overflowed.

This is not a sort transitivity issue, as this is not a symmetric sort
comparison, but it would affect binary search reliability.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolib/fuzzing: add fuzz_strncasecmp_ldb
Douglas Bagnall [Sun, 12 May 2024 22:39:44 +0000 (10:39 +1200)] 
lib/fuzzing: add fuzz_strncasecmp_ldb

As well as checking for the usual overflows, this asserts that
strncasecmp_ldb is always transitive, by splitting the input into 3
pieces and comparing all pairs.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: don't cast to unsigned for ldb_ascii_toupper()
Douglas Bagnall [Thu, 16 May 2024 23:38:10 +0000 (11:38 +1200)] 
ldb: don't cast to unsigned for ldb_ascii_toupper()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: ldb_set_utf8_functions follows README.Coding
Douglas Bagnall [Mon, 20 May 2024 22:55:53 +0000 (10:55 +1200)] 
ldb: ldb_set_utf8_functions follows README.Coding

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: deprecate ldb_set_utf8_fns
Douglas Bagnall [Thu, 16 May 2024 23:35:01 +0000 (11:35 +1200)] 
ldb: deprecate ldb_set_utf8_fns

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: remove old ldb_comparison_fold_utf8_broken()
Douglas Bagnall [Fri, 10 May 2024 03:43:36 +0000 (15:43 +1200)] 
ldb: remove old ldb_comparison_fold_utf8_broken()

There are no callers.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: ldb_comparison_fold always uses the casecmp function
Douglas Bagnall [Thu, 16 May 2024 05:01:10 +0000 (17:01 +1200)] 
ldb: ldb_comparison_fold always uses the casecmp function

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb-samba: use ldb_comparison_fold_utf8()
Douglas Bagnall [Thu, 16 May 2024 02:09:46 +0000 (14:09 +1200)] 
ldb-samba: use ldb_comparison_fold_utf8()

This means ldb-samba/dsdb comparisons will be case-insensitive for
non-ASCII UTF-8 characters (within the bounds of the 16-bit casefold
table). And they will remain transitive.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb-samba: add ldb_comparison_fold_utf8, wrapping strncasecmp_ldb
Douglas Bagnall [Fri, 10 May 2024 03:42:46 +0000 (15:42 +1200)] 
ldb-samba: add ldb_comparison_fold_utf8, wrapping strncasecmp_ldb

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoutil:charset: strncasecmp_ldb avoids iconv for ASCII
Douglas Bagnall [Tue, 14 May 2024 09:33:16 +0000 (21:33 +1200)] 
util:charset: strncasecmp_ldb avoids iconv for ASCII

This is a common case, and we can save a bit of work.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoutil:charset: strncasecmp_ldb degrades to ASCII strncasecmp
Douglas Bagnall [Sun, 12 May 2024 23:32:26 +0000 (11:32 +1200)] 
util:charset: strncasecmp_ldb degrades to ASCII strncasecmp

If strncasecmp_ldb() encounters invalid utf-8 bytes, it compares those
as greater than any valid bytes (that is, it sorts them to the end of
the list).

If an invalid sequence is encountered in both strings at once, the
rest of the strings are now compared using the default ldb_comparison_fold
rules, as implemented in ldb_comparison_fold_ascii(). That is, each
byte is compared individually, [a-z] are translated to [A-Z], and runs of
spaces are collapsed into single spaces.

There is no perfect answer in this case, but this solution is stable,
fine-grained, and probably close to what is expected. This
byte-by-byte comparison is equivalent to a utf-8 comparison without
case-folding of multibyte codes.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoutil:charset: add strncasecmp_ldb()
Douglas Bagnall [Tue, 30 Apr 2024 00:41:43 +0000 (12:41 +1200)] 
util:charset: add strncasecmp_ldb()

This is a function for comparing strings in a way that suits a
case-insenstive syntaxes in LDB.

We have it here, rahter than in LDB itself, because it needs the
upcase table. By default uses ASCII-only comparisons. SSSD and
OpenChange use it in that configuration, but Samba replaces the
comparison and casefold functions with Unicode aware versions.

Until now Samba has done that in a bad way; this will allow it to do
better.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: ldb_set_utf8_default() sets comparison function
Douglas Bagnall [Thu, 16 May 2024 23:37:18 +0000 (11:37 +1200)] 
ldb: ldb_set_utf8_default() sets comparison function

The default is ASCII only, which is used by SSSD and OpenChange.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: ldb_comparison_fold_ascii sorts unsigned
Douglas Bagnall [Thu, 9 May 2024 05:21:29 +0000 (17:21 +1200)] 
ldb: ldb_comparison_fold_ascii sorts unsigned

Typically in 8-bit character sets, those with the 0x80 bit set are
seen as 288-255, not negative numbers. This will sort them after 'Z',
not before 'A'.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: add ldb_comparison_fold_ascii() for default comparisons
Douglas Bagnall [Wed, 15 May 2024 08:51:08 +0000 (20:51 +1200)] 
ldb: add ldb_comparison_fold_ascii() for default comparisons

This function is made from the ASCII-only bits of the old
ldb_comparison_fold() -- that is, what you get if you never follow a
`goto utf8str` jump. It comparse the bytes, but collapses spaces and
maps [a-z] to [A-Z].

This does exactly what ldb_comparison_fold_utf8_broken() would do in
situations where ldb_casfold() calls ldb_casefold_default(). That
means SSSD.

The comparison is probably using signed char, so high bytes are
actually low bytes.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: ldb_comparison_fold uses the utf-8 casecmp function
Douglas Bagnall [Sun, 19 May 2024 03:09:26 +0000 (15:09 +1200)] 
ldb: ldb_comparison_fold uses the utf-8 casecmp function

But only if it is set, which it never is (so far).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: add ldb_set_utf8_functions() for setting casefold functions
Douglas Bagnall [Thu, 16 May 2024 23:34:35 +0000 (11:34 +1200)] 
ldb: add ldb_set_utf8_functions() for setting casefold functions

This replaces ldb_set_utf8_fns(), which will be deprecated really soon.

The reason for this, as shown in surrounding commits, is that without
an explicit case-insensitive comparison we need to rely on the casefold,
and if the casefold can fail (because, e.g. bad utf-8) the comparison
ends up being a bit chaotic. The strings being compared are generally
user controlled, and a malicious user might find ways of hiding values
or perhaps fooling a binary search.

A case-insensitive comparisons that works gradually through the string
without an all-at-once casefold is better placed to deal with problems
where they happen, and we are able to separately specialise for the
ASCII case (used by SSSD) and the UTF-8 case (Samba).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: move ldb_comparison_fold guts into a separate function
Douglas Bagnall [Thu, 16 May 2024 02:10:06 +0000 (14:10 +1200)] 
ldb: move ldb_comparison_fold guts into a separate function

We're going to make this use a configurable pointer.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: add a utf-8 comparison fold callback
Douglas Bagnall [Thu, 9 May 2024 04:52:53 +0000 (16:52 +1200)] 
ldb: add a utf-8 comparison fold callback

This isn't used yet, but it will allow library users to select a
case-insensitive comparison function that matches their chosen casefold.

This will allow the comparisons to be consistent when the strings are bad,
whereas currently we kind of guess.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolib/util/charset: be explicit about INVALID_CODEPOINT value
Douglas Bagnall [Wed, 1 May 2024 03:32:03 +0000 (15:32 +1200)] 
lib/util/charset: be explicit about INVALID_CODEPOINT value

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoldb: add test_ldb_comparison_fold
Douglas Bagnall [Sun, 19 May 2024 23:15:47 +0000 (11:15 +1200)] 
ldb: add test_ldb_comparison_fold

Currently this fails like this:

test_ldb_comparison_fold_default_common: 118 errors out of 256
test_ldb_comparison_fold_default_ascii:  32 errors out of 100
test_ldb_comparison_fold_utf8_common:    40 errors out of 256
test_ldb_comparison_fold_utf8:           28 errors out of 100

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: Add comment about possible interaction between the krbtgt account and Group...
Jo Sutton [Thu, 9 May 2024 01:16:50 +0000 (13:16 +1200)] 
s4:kdc: Add comment about possible interaction between the krbtgt account and Group Managed Service Accounts

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed May 22 21:33:14 UTC 2024 on atb-devel-224

17 months agos4:kdc: Merge current and previous gMSA keys during period when both are valid
Jo Sutton [Mon, 15 Apr 2024 02:46:47 +0000 (14:46 +1200)] 
s4:kdc: Merge current and previous gMSA keys during period when both are valid

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Test that previous keys are counted as current keys following a gMSA...
Jo Sutton [Fri, 26 Apr 2024 01:43:57 +0000 (13:43 +1200)] 
tests/krb5: Test that previous keys are counted as current keys following a gMSA key rollover

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:libnet: Allow simulating AS‐REQ flags combination for keytab export
Jo Sutton [Fri, 26 Apr 2024 01:54:42 +0000 (13:54 +1200)] 
s4:libnet: Allow simulating AS‐REQ flags combination for keytab export

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:libnet: Update export_keytab() docstring
Jo Sutton [Wed, 24 Apr 2024 05:11:03 +0000 (17:11 +1200)] 
s4:libnet: Update export_keytab() docstring

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:libnet: Pass SDB_F_ADMIN_DATA flag through to samba_kdc_message2entry()
Jo Sutton [Wed, 24 Apr 2024 01:45:08 +0000 (13:45 +1200)] 
s4:libnet: Pass SDB_F_ADMIN_DATA flag through to samba_kdc_message2entry()

This will allow us to specify whether to specify this flag for a keytab
export.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopython:tests: Extract keytab_as_set() function to be usable by other tests
Jo Sutton [Wed, 24 Apr 2024 00:48:53 +0000 (12:48 +1200)] 
python:tests: Extract keytab_as_set() function to be usable by other tests

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopython:tests: Manually raise AssertionError
Jo Sutton [Wed, 24 Apr 2024 01:38:53 +0000 (13:38 +1200)] 
python:tests: Manually raise AssertionError

This removes the last dependency on ‘self’ in this method.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopython:tests: Rename ‘keytab_as_set’ variable to be distinct from keytab_as_set(...
Jo Sutton [Wed, 24 Apr 2024 00:45:27 +0000 (12:45 +1200)] 
python:tests: Rename ‘keytab_as_set’ variable to be distinct from keytab_as_set() method

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agothird_party/heimdal: Import lorikeet-heimdal-202405220400 (commit 8276d6311146b8ab5d5...
Jo Sutton [Wed, 22 May 2024 04:07:17 +0000 (16:07 +1200)] 
third_party/heimdal: Import lorikeet-heimdal-202405220400 (commit 8276d6311146b8ab5d57d092bc5d5fa28282a900)

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoWHATSNEW: Add 'dns hostname'
Andreas Schneider [Wed, 6 Mar 2024 15:02:02 +0000 (16:02 +0100)] 
WHATSNEW: Add 'dns hostname'

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoauth:ntlmssp: Use lpcfg_dns_hostname()
Andreas Schneider [Fri, 12 Apr 2024 05:41:06 +0000 (07:41 +0200)] 
auth:ntlmssp: Use lpcfg_dns_hostname()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoauth:ntlmssp: Remove trailing spaces
Andreas Schneider [Fri, 12 Apr 2024 06:17:04 +0000 (08:17 +0200)] 
auth:ntlmssp: Remove trailing spaces

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:rpc_server: Use lpcfg_dnsdomain() in dnsdb.c
Andreas Schneider [Fri, 12 Apr 2024 06:16:33 +0000 (08:16 +0200)] 
s4:rpc_server: Use lpcfg_dnsdomain() in dnsdb.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:rpc_server: Use lpcfg_dns_hostname() in dnsdb.c
Andreas Schneider [Fri, 12 Apr 2024 06:13:04 +0000 (08:13 +0200)] 
s4:rpc_server: Use lpcfg_dns_hostname() in dnsdb.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:rpc_server: Use lpcfg_dns_hostname() in dnsutils.c
Andreas Schneider [Fri, 12 Apr 2024 05:37:09 +0000 (07:37 +0200)] 
s4:rpc_server: Use lpcfg_dns_hostname() in dnsutils.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:rpc_server: Use lpcfg_dns_hostname() in dns_server.c
Andreas Schneider [Fri, 12 Apr 2024 05:34:54 +0000 (07:34 +0200)] 
s4:rpc_server: Use lpcfg_dns_hostname() in dns_server.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dns_server: Use lpcfg_dns_hostname() in dlz_bind9.c
Andreas Schneider [Thu, 4 Apr 2024 09:28:39 +0000 (11:28 +0200)] 
s4:dns_server: Use lpcfg_dns_hostname() in dlz_bind9.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dfs_server: Use lpcfg_dns_hostname() in dfs_server_ad.c
Andreas Schneider [Thu, 4 Apr 2024 09:31:06 +0000 (11:31 +0200)] 
s4:dfs_server: Use lpcfg_dns_hostname() in dfs_server_ad.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:rpc_server: Use lpcfg_dns_hostname() in srv_witness_nt.c
Andreas Schneider [Fri, 12 Apr 2024 06:19:25 +0000 (08:19 +0200)] 
s3:rpc_server: Use lpcfg_dns_hostname() in srv_witness_nt.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopython:tests: Ignore case for group_name comparison
Andreas Schneider [Fri, 12 Apr 2024 17:15:36 +0000 (19:15 +0200)] 
python:tests: Ignore case for group_name comparison

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:utils: Use lp_dnsdomain() in net_ads.c
Andreas Schneider [Fri, 12 Apr 2024 06:23:23 +0000 (08:23 +0200)] 
s3:utils: Use lp_dnsdomain() in net_ads.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:libnet: Convert myalias to lower case
Andreas Schneider [Fri, 12 Apr 2024 06:33:06 +0000 (08:33 +0200)] 
s3:libnet: Convert myalias to lower case

This will be more consistent as it is a dnsname.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:libnet: Use lp_dns_hostname() in libnet_join.c
Andreas Schneider [Thu, 4 Apr 2024 09:24:13 +0000 (11:24 +0200)] 
s3:libnet: Use lp_dns_hostname() in libnet_join.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:lib: Remove obsolete name_to_fqdn()
Andreas Schneider [Wed, 6 Mar 2024 15:00:47 +0000 (16:00 +0100)] 
s3:lib: Remove obsolete name_to_fqdn()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:librpc: Use lp_dns_hostname() for creating the fqdn
Andreas Schneider [Wed, 6 Mar 2024 14:59:14 +0000 (15:59 +0100)] 
s3:librpc: Use lp_dns_hostname() for creating the fqdn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:utils: Use lp_dns_hostname() for 'net' dns updates
Andreas Schneider [Wed, 6 Mar 2024 14:53:17 +0000 (15:53 +0100)] 
s3:utils: Use lp_dns_hostname() for 'net' dns updates

name_to_fqdn() requires /etc/hosts to be set up in a special way to find
out the fqdn for dns updates. They are not set up by default and the
DNS update fails. Normally the fqdn is just <lp_netbios_name>.<realm>
and we should just use that. However if it is different, you can set
it to the special value in the smb.conf now.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agodocs-xml: Add smb.conf option 'dns hostname'
Andreas Schneider [Tue, 9 Jan 2024 14:47:48 +0000 (15:47 +0100)] 
docs-xml: Add smb.conf option 'dns hostname'

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>