]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 years agopytest:sid_strings: test the strings with local parsing
Douglas Bagnall [Wed, 12 Apr 2023 23:47:19 +0000 (11:47 +1200)] 
pytest:sid_strings: test the strings with local parsing

The reason the existing tests send the SID over the wire as SDDL for
defaultSecurityDescriptor is it is one of the few ways to force the
server to reckon with a SID-string as a SID. At least, that's the case
with Windows. In Samba we make no effort to decode the SDDL until it
comes to the time of creating an object, at which point we don't notice
the difference between bad SDDL and missing SDDL.

So here we add a set of dynamic tests that push the strings through our
SDDL parsing code. This doesn't tell us very much more, but it is very
quick and sort of confirms that the other tests are on the right track.

To run against Windows without also running the internal Samba tests,
add `SAMBA_SID_STRINGS_SKIP_LOCAL=1` to your environment variables.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest:sid_strings: separate out expected_sid formatting
Douglas Bagnall [Wed, 12 Apr 2023 23:30:26 +0000 (11:30 +1200)] 
pytest:sid_strings: separate out expected_sid formatting

This is going to be useful for another test, soon.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest:sid_strings: add explicit S-1-* sid tests
Douglas Bagnall [Wed, 5 Apr 2023 03:39:24 +0000 (15:39 +1200)] 
pytest:sid_strings: add explicit S-1-* sid tests

We are mostly testing edge cases around the handling of numeric
limits.

These tests are based on ground truth established by running them
against Windows.

Many fail against Samba, because the defaulSecurityDescriptor
attribute is not validated at the time it is set while on Windows it
is.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest:sid_strings: allow other errors to be specified
Douglas Bagnall [Wed, 5 Apr 2023 04:05:59 +0000 (16:05 +1200)] 
pytest:sid_strings: allow other errors to be specified

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest:sid_strings: add a superclass, allowing for derivatives
Douglas Bagnall [Wed, 5 Apr 2023 05:20:46 +0000 (17:20 +1200)] 
pytest:sid_strings: add a superclass, allowing for derivatives

This will allow e.g. a suite of tests that assert Windows behaviour that
we might not choose to follow.

Because @DynamicTestCase will mangle the class as it finds it, we can't
use SidStringTests itself as a superclass for others.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest:sid_strings: use hashed instead of random unique numbers
Douglas Bagnall [Wed, 5 Apr 2023 03:20:57 +0000 (15:20 +1200)] 
pytest:sid_strings: use hashed instead of random unique numbers

This removes the slim chance of flapping failures, and makes tracking
the created class back to the SID string theoretically possible.

To maintain uniqueness of the governs-id, we in chuck some of the
timestamp.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest:sid_strings: same timestamp for all tests in the run
Douglas Bagnall [Wed, 5 Apr 2023 03:16:21 +0000 (15:16 +1200)] 
pytest:sid_strings: same timestamp for all tests in the run

We don't care about the exact time of the test, just that we
disambiguate between different runs (each run leaves an immutable scar
on the target server).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolibrpc/py_security: exception message blames the bad SID
Douglas Bagnall [Wed, 12 Apr 2023 09:34:47 +0000 (21:34 +1200)] 
librpc/py_security: exception message blames the bad SID

It can be useful to know what you're looking for.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest:upgradeprovision: don't use misleading SDDL in tests
Douglas Bagnall [Sat, 22 Apr 2023 20:41:23 +0000 (08:41 +1200)] 
pytest:upgradeprovision: don't use misleading SDDL in tests

The ACE string "(A;CI;RP LCLORC;;;AU)", with a space after "RP", is
currently not parsed well by Samba.

At the moment we parse only the "RP" and ignore the " LCLORC". What
Windows would do is parse it as if it said "RPLCLORC", without the
space, thus using all the flags. It seems very likely we thought this
was happening with Samba.

Soon Samba will have Windows' behaviour here and it will be tested in
python/samba/tests/sddl.py. That means this test can relax and focus
on whatever it was trying to do with upgradeprovision. We thank it for
finding this discrepency.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolibrpc/ndr/pysecurity: use better exceptions
Douglas Bagnall [Wed, 12 Apr 2023 05:34:35 +0000 (17:34 +1200)] 
librpc/ndr/pysecurity: use better exceptions

The wrong string is the wrong value but the right type.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolib/fuzzing: add fuzzer for sddl_parse
Douglas Bagnall [Fri, 18 Dec 2020 04:58:56 +0000 (17:58 +1300)] 
lib/fuzzing: add fuzzer for sddl_parse

Apart from catching crashes in the actual parsing, we abort if the SD
we end up with will not round trip back through SDDL to an identical
SD.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolibcli:smb: Fix code spelling
Andreas Schneider [Thu, 27 Apr 2023 13:58:18 +0000 (15:58 +0200)] 
libcli:smb: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Apr 27 15:27:21 UTC 2023 on atb-devel-224

3 years agolibcli:security: Fix code spelling
Andreas Schneider [Thu, 27 Apr 2023 13:56:42 +0000 (15:56 +0200)] 
libcli:security: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolibcli:ldap: Fix code spelling
Andreas Schneider [Thu, 27 Apr 2023 13:54:54 +0000 (15:54 +0200)] 
libcli:ldap: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolibcli:drsuapi: Fix code spelling
Andreas Schneider [Thu, 27 Apr 2023 13:54:15 +0000 (15:54 +0200)] 
libcli:drsuapi: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolibcli:auth: Fix code spelling
Andreas Schneider [Thu, 27 Apr 2023 13:53:25 +0000 (15:53 +0200)] 
libcli:auth: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:lib: Give better warnings about corrupted AppleDobule files
Andreas Schneider [Wed, 26 Apr 2023 06:40:29 +0000 (08:40 +0200)] 
s3:lib: Give better warnings about corrupted AppleDobule files

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Apr 27 09:25:50 UTC 2023 on atb-devel-224

3 years agos3:lib: Move ad_unpack() debug message to notice level
Andreas Schneider [Wed, 26 Apr 2023 06:30:38 +0000 (08:30 +0200)] 
s3:lib: Move ad_unpack() debug message to notice level

We should give a good warning message one level above.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agogitlab-ci: Update Fedora to version 38
Andreas Schneider [Thu, 20 Apr 2023 06:25:31 +0000 (08:25 +0200)] 
gitlab-ci: Update Fedora to version 38

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Apr 27 08:22:58 UTC 2023 on atb-devel-224

3 years agoselftest:knownfail: Update S4U knownfail for MIT KRB5 1.20
Andreas Schneider [Tue, 25 Apr 2023 05:50:55 +0000 (07:50 +0200)] 
selftest:knownfail: Update S4U knownfail for MIT KRB5 1.20

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agowafsamba: Normalize strings in gdb output when comparing ABI
Alexander Bokovoy [Mon, 24 Apr 2023 12:29:49 +0000 (14:29 +0200)] 
wafsamba: Normalize strings in gdb output when comparing ABI

This fixes an issue with gdb >= 13:

libndr.so: symbol ndr_transfer_syntax_ndr64 has changed
    old_signature: uuid = {
        time_low = 1903232307,
        time_mid = 48826,
        time_hi_and_version = 18743,
        clock_seq = "\203\031",
        node = "\265\333\357\234\314\066"
    }, if_version = 1

    new_signature: uuid = {
        time_low = 1903232307,
        time_mid = 48826,
        time_hi_and_version = 18743,
        clock_seq = "\203\031",
        node = "\265\333\357\234\3146"
    }, if_version = 1

\314\066 and \3146 are the same as \066 translates into the char '6'. In order
to address this we should do byte comparison in python.

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Alexander Bokovoy <ab@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3:torture: Fix possible array out of bounds access
Andreas Schneider [Thu, 20 Apr 2023 11:29:27 +0000 (13:29 +0200)] 
s3:torture: Fix possible array out of bounds access

In function ‘test_one’,
    inlined from ‘retest’ at source3/torture/locktest2.c:401:8:
source3/torture/locktest2.c:331:37: error: array subscript 2 is above array bounds of ‘int[2][2][2]’ [-Werror=array-bounds=]
  331 |                         fnum[server][fstype][conn][f] = try_open(cli[server][conn], nfs[server], fstype, FILENAME,
      |                         ~~~~~~~~~~~~^~~~~~~~
source3/torture/locktest2.c: In function ‘retest’:
source3/torture/locktest2.c:390:23: note: while referencing ‘fnum’
  390 |                   int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES],
      |                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘test_one’,
    inlined from ‘retest’ at source3/torture/locktest2.c:401:8:
source3/torture/locktest2.c:316:62: error: array subscript 2 is above array bounds of ‘int[2][2][2]’ [-Werror=array-bounds=]
  316 |                                                  fnum[server][fstype][conn][f],
      |                                                  ~~~~~~~~~~~~^~~~~~~~
source3/torture/locktest2.c: In function ‘retest’:
source3/torture/locktest2.c:390:23: note: while referencing ‘fnum’
  390 |                   int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES],
      |                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘test_one’,
    inlined from ‘retest’ at source3/torture/locktest2.c:401:8:
source3/torture/locktest2.c:300:60: error: array subscript 2 is above array bounds of ‘int[2][2][2]’ [-Werror=array-bounds=]
  300 |                                                fnum[server][fstype][conn][f],
      |                                                ~~~~~~~~~~~~^~~~~~~~
source3/torture/locktest2.c: In function ‘retest’:
source3/torture/locktest2.c:390:23: note: while referencing ‘fnum’
  390 |                   int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES],
      |                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3:torture: Remove trailing white spaces in locktest2.c
Andreas Schneider [Thu, 20 Apr 2023 11:28:59 +0000 (13:28 +0200)] 
s3:torture: Remove trailing white spaces in locktest2.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agodfs_server: Fix debug statement if searched_site is NULL
Andreas Schneider [Thu, 20 Apr 2023 11:09:26 +0000 (13:09 +0200)] 
dfs_server: Fix debug statement if searched_site is NULL

In file included from source4/include/includes.h:61,
                 from dfs_server/dfs_server_ad.c:21:
dfs_server/dfs_server_ad.c: In function ‘get_dcs.constprop’:
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  200 |        && (dbgtext body) )
      |           ~^~~~~~~~~~~~~
dfs_server/dfs_server_ad.c:462:25: note: in expansion of macro ‘DEBUG’
  462 |                         DEBUG(2,(__location__ ": Site: %s %s\n",
      |                         ^~~~~

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolib:krb5_wrap: Fix debug statements when princ_s is NULL
Andreas Schneider [Thu, 20 Apr 2023 08:42:54 +0000 (10:42 +0200)] 
lib:krb5_wrap: Fix debug statements when princ_s is NULL

In file included from source4/include/includes.h:61,
                 from lib/krb5_wrap/krb5_samba.c:23:
lib/krb5_wrap/krb5_samba.c: In function ‘smb_krb5_kt_seek_and_delete_old_entries’:
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  200 |        && (dbgtext body) )
      |           ~^~~~~~~~~~~~~
lib/krb5_wrap/krb5_samba.c:1753:25: note: in expansion of macro ‘DEBUG’
 1753 |                         DEBUG(5, (__location__ ": Saving previous (kvno %d) "
      |                         ^~~~~
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  200 |        && (dbgtext body) )
      |           ~^~~~~~~~~~~~~
lib/krb5_wrap/krb5_samba.c:1763:25: note: in expansion of macro ‘DEBUG’
 1763 |                         DEBUG(5, (__location__ ": Saving entry with kvno [%d] "
      |                         ^~~~~
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  200 |        && (dbgtext body) )
      |           ~^~~~~~~~~~~~~
lib/krb5_wrap/krb5_samba.c:1769:17: note: in expansion of macro ‘DEBUG’
 1769 |                 DEBUG(5, (__location__ ": Found old entry for principal: %s "
      |                 ^~~~~
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  200 |        && (dbgtext body) )
      |           ~^~~~~~~~~~~~~
lib/krb5_wrap/krb5_samba.c:1787:17: note: in expansion of macro ‘DEBUG’
 1787 |                 DEBUG(5, (__location__ ": removed old entry for principal: "
      |                 ^~~~~

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests: Test ldap whoami exop
Volker Lendecke [Fri, 21 Apr 2023 14:04:30 +0000 (16:04 +0200)] 
tests: Test ldap whoami exop

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Apr 26 07:20:14 UTC 2023 on atb-devel-224

3 years agoldap_server: Implement the rfc4532 whoami exop
Volker Lendecke [Wed, 3 Nov 2021 15:35:00 +0000 (16:35 +0100)] 
ldap_server: Implement the rfc4532 whoami exop

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb: Implement ldap_whoami in pyldb
Volker Lendecke [Fri, 24 Mar 2023 10:49:02 +0000 (11:49 +0100)] 
ldb: Implement ldap_whoami in pyldb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb: Allow extended operations through ildap
Volker Lendecke [Fri, 24 Mar 2023 10:48:31 +0000 (11:48 +0100)] 
ldb: Allow extended operations through ildap

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb: Add the RFC4532 LDB_EXTENDED_WHOAMI_OID definition
Volker Lendecke [Wed, 10 Nov 2021 15:29:59 +0000 (16:29 +0100)] 
ldb: Add the RFC4532 LDB_EXTENDED_WHOAMI_OID definition

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoAdd ROLE_IPA_DC into two more places
Alexander Bokovoy [Mon, 24 Apr 2023 16:26:19 +0000 (19:26 +0300)] 
Add ROLE_IPA_DC into two more places

Missed two more places originally when introduced ROLE_IPA_DC.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Tue Apr 25 07:46:36 UTC 2023 on atb-devel-224

3 years agos3:locking: fix debug level for NT_STATUS_NOT_FOUND messanges in get_static_share_mod...
Stefan Metzmacher [Mon, 24 Apr 2023 13:08:42 +0000 (15:08 +0200)] 
s3:locking: fix debug level for NT_STATUS_NOT_FOUND messanges in get_static_share_mode_data

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Apr 24 14:13:35 UTC 2023 on atb-devel-224

3 years agopython:tests: Skip the source_chars test if not a git dir
Andreas Schneider [Fri, 14 Apr 2023 19:05:18 +0000 (21:05 +0200)] 
python:tests: Skip the source_chars test if not a git dir

This test doesn't work in release tarballs. Skip it if git fails.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Apr 21 13:59:29 UTC 2023 on atb-devel-224

3 years agos3:client: Remove unused tree.c
Andreas Schneider [Thu, 20 Apr 2023 11:02:05 +0000 (13:02 +0200)] 
s3:client: Remove unused tree.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Apr 20 12:56:53 UTC 2023 on atb-devel-224

3 years agos3:libsmb: Also deprecate smbc_init()
Andreas Schneider [Tue, 18 Apr 2023 14:00:51 +0000 (16:00 +0200)] 
s3:libsmb: Also deprecate smbc_init()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos3:utils: Use smbc_set_credentials_with_fallback() for smbget
Andreas Schneider [Thu, 13 Apr 2023 13:41:53 +0000 (15:41 +0200)] 
s3:utils: Use smbc_set_credentials_with_fallback() for smbget

smbc_set_credentials() is deprecated.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos3:libsmb: Mark smbc_set_credentials() as deprecated
Andreas Schneider [Thu, 13 Apr 2023 13:31:04 +0000 (15:31 +0200)] 
s3:libsmb: Mark smbc_set_credentials() as deprecated

This will issue a compiler warning!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos3:lib: Do not try to match '.' and '..' directories in is_in_path()
Andreas Schneider [Wed, 19 Apr 2023 14:23:10 +0000 (16:23 +0200)] 
s3:lib: Do not try to match '.' and '..' directories in is_in_path()

This fixes setting veto files to '.*' to not list hidden files and
directories starting with a dot.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 19 22:30:19 UTC 2023 on atb-devel-224

3 years agos3:tests: Add test that veto files works for hidden files
Andreas Schneider [Wed, 19 Apr 2023 13:35:47 +0000 (15:35 +0200)] 
s3:tests: Add test that veto files works for hidden files

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3:tests: Create a temporary directory for test_veto_files.sh
Andreas Schneider [Wed, 19 Apr 2023 18:45:52 +0000 (20:45 +0200)] 
s3:tests: Create a temporary directory for test_veto_files.sh

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Fix NameError: free variable 'cron_dir' in Crontab CSE
David Mulder [Tue, 18 Apr 2023 19:34:46 +0000 (13:34 -0600)] 
gp: Fix NameError: free variable 'cron_dir' in Crontab CSE

An apply reports the error "NameError: free
variable 'cron_dir' referenced before assignment
in enclosing scope". This only happens when no
policy is defined for this CSE, because existing
policy causes the variable to be defined.

Moved the 'cron_dir' varilable to the correct
scope.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Wed Apr 19 21:21:10 UTC 2023 on atb-devel-224

3 years agopylibsmb: Return "flags" in create_returns
Volker Lendecke [Tue, 14 Feb 2023 19:49:52 +0000 (20:49 +0100)] 
pylibsmb: Return "flags" in create_returns

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Apr 18 15:58:42 UTC 2023 on atb-devel-224

3 years agolibsmb: Return [MS-SMB2] 2.2.14 SMB2 CREATE Response flags field
Volker Lendecke [Tue, 14 Feb 2023 19:44:16 +0000 (20:44 +0100)] 
libsmb: Return [MS-SMB2] 2.2.14 SMB2 CREATE Response flags field

Not used yet, mostly for completeness.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agosmbd: Save 488 bytes RSS
Volker Lendecke [Thu, 9 Mar 2023 16:36:26 +0000 (17:36 +0100)] 
smbd: Save 488 bytes RSS

With this ld.so does not have to relocate the string pointers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Adapt cli_echo_send() to modern conventions
Volker Lendecke [Sat, 11 Mar 2023 12:51:43 +0000 (13:51 +0100)] 
libsmb: Adapt cli_echo_send() to modern conventions

Nowadays we rather do protocol-specific _done() functions, and overall
this cuts a few lines.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agosmbd: Fix a DBG statement
Volker Lendecke [Sat, 11 Mar 2023 14:37:59 +0000 (15:37 +0100)] 
smbd: Fix a DBG statement

This is not smbd_smb2_create_send() anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Make setting errno safer in SMBC_add_cached_server()
Volker Lendecke [Sat, 1 Apr 2023 09:57:47 +0000 (11:57 +0200)] 
libsmb: Make setting errno safer in SMBC_add_cached_server()

DEBUG should preserve errno, but make this more obvious.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Simplify SMBC_add_cached_server()
Volker Lendecke [Sat, 1 Apr 2023 09:57:29 +0000 (11:57 +0200)] 
libsmb: Simplify SMBC_add_cached_server()

ENOMEM is the only error condition we have

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Avoid an explicit ZERO_STRUCTP with calloc
Volker Lendecke [Sat, 1 Apr 2023 09:55:10 +0000 (11:55 +0200)] 
libsmb: Avoid an explicit ZERO_STRUCTP with calloc

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Slightly simplify smbc_init()
Volker Lendecke [Sat, 1 Apr 2023 10:47:51 +0000 (12:47 +0200)] 
libsmb: Slightly simplify smbc_init()

Reduce indentation with an early return, review with git show -w

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Make cli_smb2_qpathinfo2() asynchronous
Volker Lendecke [Tue, 4 Apr 2023 07:36:08 +0000 (09:36 +0200)] 
libsmb: Make cli_smb2_qpathinfo2() asynchronous

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Make cli_qpathinfo2_done() parse the results
Volker Lendecke [Mon, 3 Apr 2023 16:31:01 +0000 (18:31 +0200)] 
libsmb: Make cli_qpathinfo2_done() parse the results

Make it easier to do an async SMB2 version

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Introduce type-safe struct cli_smb2_create_flags
Volker Lendecke [Wed, 12 Apr 2023 13:31:03 +0000 (15:31 +0200)] 
libsmb: Introduce type-safe struct cli_smb2_create_flags

This makes it clearer what to pass into the create_flags argument to
cli_smb2_create_fnum(). There was already confusion in
source3/torture/test_smb2.c: It passed in
SMB2_OPLOCK_LEVEL_NONE (which was okay because it #defines to 0), but
it should have been a straight 0, for example
SMB2_OPLOCK_LEVEL_EXCLUSIVE would have been wrong.

This way adding other flags (.nofollow comes to mind) will be much
easier to handle.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoshadow_copy2: Fix stream open for streams_depot paths
Volker Lendecke [Fri, 14 Apr 2023 15:22:18 +0000 (17:22 +0200)] 
shadow_copy2: Fix stream open for streams_depot paths

streams_depot hands us absolute paths with : filename components
instead of having set smb_fname_in->stream_name.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Apr 17 18:11:07 UTC 2023 on atb-devel-224

3 years agotests: Show that streams_depot and shadow_copy2 don't play together
Volker Lendecke [Fri, 14 Apr 2023 15:34:17 +0000 (15:34 +0000)] 
tests: Show that streams_depot and shadow_copy2 don't play together

See the next patch, we assert in shadow_copy2_openat() over paths
passed in from shadow_copy2

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agostreams_depot: Create files when requested
Volker Lendecke [Fri, 14 Apr 2023 14:32:42 +0000 (16:32 +0200)] 
streams_depot: Create files when requested

If you set "create mask = 0600" no streams will be created....

Tested manually. Not creating an automated test for this, there are so
many places where this can go wrong that testing this individual
glitch does not gain us much confidence.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agodebug: Only initialize gpfs wrapper when gpfs logging is enabled
Christof Schmitt [Thu, 13 Apr 2023 18:13:00 +0000 (11:13 -0700)] 
debug: Only initialize gpfs wrapper when gpfs logging is enabled

This avoids unnecessary attempts to load libgpfs.so when it is not
needed.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Apr 14 12:28:23 UTC 2023 on atb-devel-224

3 years agotestprogs: Set PREFIX_ABS before it is used in test_primary_group.sh
Pavel Filipenský [Thu, 13 Apr 2023 07:41:26 +0000 (09:41 +0200)] 
testprogs: Set PREFIX_ABS before it is used in test_primary_group.sh

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Apr 14 06:18:18 UTC 2023 on atb-devel-224

3 years agolib:util: Fix code spelling
Andreas Schneider [Thu, 13 Apr 2023 11:29:32 +0000 (13:29 +0200)] 
lib:util: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib:util: Remove trailing white spaces in byteorder.h
Andreas Schneider [Thu, 13 Apr 2023 11:27:37 +0000 (13:27 +0200)] 
lib:util: Remove trailing white spaces in byteorder.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib:tsocket: Fix code spelling
Andreas Schneider [Thu, 13 Apr 2023 11:19:05 +0000 (13:19 +0200)] 
lib:tsocket: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib:tevent: Fix code spelling
Andreas Schneider [Thu, 13 Apr 2023 11:18:05 +0000 (13:18 +0200)] 
lib:tevent: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib:tdb: Fix code spelling
Andreas Schneider [Thu, 13 Apr 2023 11:17:08 +0000 (13:17 +0200)] 
lib:tdb: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib:talloc: Fix code spelling
Andreas Schneider [Thu, 13 Apr 2023 11:14:10 +0000 (13:14 +0200)] 
lib:talloc: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib:socket: Fix code spelling
Andreas Schneider [Thu, 13 Apr 2023 10:54:55 +0000 (12:54 +0200)] 
lib:socket: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib:smbconf: Fix code spelling
Andreas Schneider [Thu, 13 Apr 2023 10:54:21 +0000 (12:54 +0200)] 
lib:smbconf: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib:replace: Fix code spelling
Andreas Schneider [Thu, 13 Apr 2023 10:53:07 +0000 (12:53 +0200)] 
lib:replace: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib:replace: Remove trailing white spaces in xattr.c
Andreas Schneider [Thu, 13 Apr 2023 10:52:52 +0000 (12:52 +0200)] 
lib:replace: Remove trailing white spaces in xattr.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest:Samba3: use the correct NSS_WRAPPER_HOSTNAME
Stefan Metzmacher [Wed, 12 Apr 2023 15:22:02 +0000 (17:22 +0200)] 
selftest:Samba3: use the correct NSS_WRAPPER_HOSTNAME

The value of NSS_WRAPPER_HOSTNAME needs to match value
we put into the NSS_WRAPPER_HOSTS file.

We had a mismatch of
idmapridmember.samba.example.com
vs.
idmapridmember.addom.samba.example.com

This causes getaddrinfo() in nss_wrapper to fallback to
the libc version, which talks to a dns server.
It's not clear if recent glibc code will reach resolve/socket wrapper.
So it's not unlikely that idmapridmember.samba.example.com will
be passed via the internet, which causes delays up to 20 seconds.

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

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): Wed Apr 12 20:29:05 UTC 2023 on atb-devel-224

3 years agoselftest: Catch error codes from failing testsuites
Joseph Sutton [Thu, 6 Apr 2023 04:31:09 +0000 (16:31 +1200)] 
selftest: Catch error codes from failing testsuites

Testsuites declared with functions such as plantestsuite() are not run
directly, but are piped through filter-subunit. The overall exit code of
the executed test command is that returned by the last command in the
pipeline (that is, filter-subunit), and thus the actual testsuite return
code is lost.

A real consequence of this is that an error in setUpClass() in a Python
testsuite causes the whole testsuite to be skipped silently.

The --fail-on-empty option partially addressed this, but didn't help if
the testsuite contained multiple test classes, only one of which
contained an error.

We now use bash with the pipefail option, which makes the return code of
the last failing command into the return code of the entire pipeline.
That means that we properly fail if a testsuite returns a non-zero exit
code, but doesn't otherwise exhibit any failures in its output.

This doesn't help for cases where a testsuite has other failing tests
that become xfails due to knownfail entries. In that case, the overall
'testsuite-failure' will be turned into 'testsuite-xfail' by
filter-subunit and the silent failures will remain unheeded. Still, this
is better than the existing situation.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Apr 12 14:57:55 UTC 2023 on atb-devel-224

3 years agoselftest: Fix samba3.clustered.smb2.deny.deny2 test
Joseph Sutton [Wed, 12 Apr 2023 01:20:00 +0000 (13:20 +1200)] 
selftest: Fix samba3.clustered.smb2.deny.deny2 test

This test failed to start, emitting the following error:
Unknown torture operation 'clustered.smb2.deny.deny2'

To fix this, remove the 'clustered.' prefix from the test name.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoselftest: Only run clusteredmember tests if ctdb is built
Joseph Sutton [Tue, 11 Apr 2023 22:15:30 +0000 (10:15 +1200)] 
selftest: Only run clusteredmember tests if ctdb is built

Trying to run any of these tests without having built ctdb results in a
failure, as the environment cannot be started.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib/torture: Don't overwrite test outcomes
Joseph Sutton [Tue, 11 Apr 2023 21:41:29 +0000 (09:41 +1200)] 
lib/torture: Don't overwrite test outcomes

If a test fails an assertion, and later calls torture_skip() to skip
part of the test, the TORTURE_SKIP result will overwrite the
TORTURE_FAIL result, and the overall outcome will be successful.

To avoid this, we now arrange possible outcomes in order of priority,
and ensure we always keep the higher priority one.

This reveals some failing tests.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4:torture: Don't try to close the connection after running disconnect tests
Joseph Sutton [Tue, 11 Apr 2023 08:57:31 +0000 (20:57 +1200)] 
s4:torture: Don't try to close the connection after running disconnect tests

dcerpc_mdssvc_close() would always fail with
STATUS_CONNECTION_DISCONNECTED, causing the testsuite as a whole to
fail.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4:torture: Correctly zero structure
Joseph Sutton [Tue, 11 Apr 2023 22:34:22 +0000 (10:34 +1200)] 
s4:torture: Correctly zero structure

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4:rpc_server: Ensure EnumDomainUsers() doesn't return a NULL array
Joseph Sutton [Tue, 11 Apr 2023 08:36:15 +0000 (20:36 +1200)] 
s4:rpc_server: Ensure EnumDomainUsers() doesn't return a NULL array

This is what source4/torture/rpc/samr.c:test_EnumDomainUsers_all() in
the test 'samba4.rpc.samr' expects, and allows that test to pass.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4:rpc_server: Handle LDB_ERR_NO_SUCH_ATTRIBUTE when deleting group
Joseph Sutton [Tue, 11 Apr 2023 08:19:52 +0000 (20:19 +1200)] 
s4:rpc_server: Handle LDB_ERR_NO_SUCH_ATTRIBUTE when deleting group

This is what source4/torture/rpc/samr.c:test_AddGroupMember() in the
test 'samba4.rpc.samr' expects.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoselftest: Fix typo
Joseph Sutton [Tue, 11 Apr 2023 08:04:23 +0000 (20:04 +1200)] 
selftest: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4:torture: Fix typo
Joseph Sutton [Tue, 11 Apr 2023 07:37:21 +0000 (19:37 +1200)] 
s4:torture: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:selftest: Enable winbindd for maptoguest environment
Joseph Sutton [Tue, 11 Apr 2023 03:39:04 +0000 (15:39 +1200)] 
s3:selftest: Enable winbindd for maptoguest environment

This is required for the samba3.blackbox.guest test to work. Without it,
the test fails to find a group map.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:tests: Correct condition
Joseph Sutton [Tue, 11 Apr 2023 02:43:23 +0000 (14:43 +1200)] 
s3:tests: Correct condition

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotestprogs: Return correct status code
Joseph Sutton [Tue, 11 Apr 2023 02:38:30 +0000 (14:38 +1200)] 
testprogs: Return correct status code

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:script: Always return a non-zero status code on failure
Joseph Sutton [Tue, 11 Apr 2023 02:34:07 +0000 (14:34 +1200)] 
s3:script: Always return a non-zero status code on failure

If $expected didn't match $received, these functions would still return
zero.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotestprogs: Have testfail() return 0 on success
Joseph Sutton [Tue, 11 Apr 2023 02:31:59 +0000 (14:31 +1200)] 
testprogs: Have testfail() return 0 on success

This is more consistent with the other testing functions.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotestprogs: Make test_rpcclient_expect_failure_grep() return 0 on success
Joseph Sutton [Tue, 11 Apr 2023 02:26:56 +0000 (14:26 +1200)] 
testprogs: Make test_rpcclient_expect_failure_grep() return 0 on success

This is more consistent with the behaviour of the other expect_failure
functions.

Adjust all callers expecting the opposite behaviour to match.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotestprogs: Return correct status code
Joseph Sutton [Tue, 11 Apr 2023 02:24:55 +0000 (14:24 +1200)] 
testprogs: Return correct status code

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotestprogs: Make test_smbclient_expect_failure() return 0 on success
Joseph Sutton [Tue, 11 Apr 2023 02:23:00 +0000 (14:23 +1200)] 
testprogs: Make test_smbclient_expect_failure() return 0 on success

This is the behaviour that most existing callers expect, but the
function actually returns a non-zero status code in that case.

Adjust all callers expecting the opposite behaviour to match.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agonsswitch:tests: Remove unused functions
Joseph Sutton [Tue, 11 Apr 2023 02:20:01 +0000 (14:20 +1200)] 
nsswitch:tests: Remove unused functions

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotestprogs: Make testit_expect_failure() return 0 on success
Joseph Sutton [Tue, 11 Apr 2023 02:04:59 +0000 (14:04 +1200)] 
testprogs: Make testit_expect_failure() return 0 on success

This is the behaviour that most existing callers expect, but the
function actually returns a non-zero status code in that case.

Adjust all callers expecting the opposite behaviour to match.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotestprogs: Fix comparison
Joseph Sutton [Tue, 11 Apr 2023 02:00:51 +0000 (14:00 +1200)] 
testprogs: Fix comparison

SC2039: In POSIX sh, == in place of = is undefined.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:net_usershare: Correctly escape newline in error message
Joseph Sutton [Mon, 13 Feb 2023 01:16:47 +0000 (14:16 +1300)] 
s3:net_usershare: Correctly escape newline in error message

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4-dsdb: Handle allocation failure
Joseph Sutton [Mon, 13 Feb 2023 02:00:21 +0000 (15:00 +1300)] 
s4-dsdb: Handle allocation failure

If a talloc function returns NULL, indicating failure, the failure could
be masked by the next talloc call allocating on the NULL context.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:net_usershare: Handle allocation failure
Joseph Sutton [Mon, 13 Feb 2023 01:59:38 +0000 (14:59 +1300)] 
s3:net_usershare: Handle allocation failure

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agosmbd/notify: Handle allocation failure
Joseph Sutton [Mon, 13 Feb 2023 01:58:52 +0000 (14:58 +1300)] 
smbd/notify: Handle allocation failure

If a talloc function returns NULL, indicating failure, the failure could
be masked by the next talloc call allocating on the NULL context.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibndr: Handle allocation failure
Joseph Sutton [Mon, 13 Feb 2023 01:58:23 +0000 (14:58 +1300)] 
libndr: Handle allocation failure

If a talloc function returns NULL, indicating failure, the failure could
be masked by the next talloc call allocating on the NULL context.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agopyldb: Handle allocation failure
Joseph Sutton [Mon, 13 Feb 2023 01:57:24 +0000 (14:57 +1300)] 
pyldb: Handle allocation failure

If we don't check for NULL after each loop iteration, the failure could
be masked in the next iteration by talloc_asprintf_append() allocating
on the NULL context. That could result in values getting lost.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoctdb:tool: Remove unnecessary strlen()
Joseph Sutton [Mon, 3 Apr 2023 23:34:47 +0000 (11:34 +1200)] 
ctdb:tool: Remove unnecessary strlen()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibrpc/ndr: Add missing newlines to error messages
Joseph Sutton [Mon, 3 Apr 2023 23:08:54 +0000 (11:08 +1200)] 
librpc/ndr: Add missing newlines to error messages

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agopysmbd: Fix typo in error message
Joseph Sutton [Mon, 3 Apr 2023 23:06:47 +0000 (11:06 +1200)] 
pysmbd: Fix typo in error message

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4-drs: Don't skip over elements in uref_del_dest()
Joseph Sutton [Tue, 21 Mar 2023 00:47:16 +0000 (13:47 +1300)] 
s4-drs: Don't skip over elements in uref_del_dest()

If we remove an element, we should not skip over the element following.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>