[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Wed Apr 12 14:58:01 UTC 2023


The branch, master has been updated
       via  2ff55b3da71 selftest: Catch error codes from failing testsuites
       via  62893486c62 selftest: Fix samba3.clustered.smb2.deny.deny2 test
       via  839ca0cd353 selftest: Only run clusteredmember tests if ctdb is built
       via  44d03bf4793 lib/torture: Don't overwrite test outcomes
       via  80c548437a7 s4:torture: Don't try to close the connection after running disconnect tests
       via  2aa9fae1f8d s4:torture: Correctly zero structure
       via  6a3accec4c7 s4:rpc_server: Ensure EnumDomainUsers() doesn't return a NULL array
       via  6abc50c94ec s4:rpc_server: Handle LDB_ERR_NO_SUCH_ATTRIBUTE when deleting group
       via  91ed2f3d5d2 selftest: Fix typo
       via  8e7abe72a82 s4:torture: Fix typo
       via  8e7c7680f38 s3:selftest: Enable winbindd for maptoguest environment
       via  aa05498b1ed s3:tests: Correct condition
       via  f407b3ec0d8 testprogs: Return correct status code
       via  4726541a789 s3:script: Always return a non-zero status code on failure
       via  ae5fafa902b testprogs: Have testfail() return 0 on success
       via  23d2c9cb72d testprogs: Make test_rpcclient_expect_failure_grep() return 0 on success
       via  dfb088aaed5 testprogs: Return correct status code
       via  b62b0bd64bd testprogs: Make test_smbclient_expect_failure() return 0 on success
       via  60c501b387d nsswitch:tests: Remove unused functions
       via  833cefe8eeb testprogs: Make testit_expect_failure() return 0 on success
       via  b1df85e7d30 testprogs: Fix comparison
       via  e0db10cfc38 s3:net_usershare: Correctly escape newline in error message
       via  03bd1b8ee9b s4-dsdb: Handle allocation failure
       via  2de0e1dccd5 s3:net_usershare: Handle allocation failure
       via  78ca3e16da7 smbd/notify: Handle allocation failure
       via  a1e64e57378 libndr: Handle allocation failure
       via  894500b6708 pyldb: Handle allocation failure
       via  440c3e86971 ctdb:tool: Remove unnecessary strlen()
       via  fd159aaa800 librpc/ndr: Add missing newlines to error messages
       via  5b7ee73c0d7 pysmbd: Fix typo in error message
       via  f273dcf6c5c s4-drs: Don't skip over elements in uref_del_dest()
       via  b5b611d90f8 posix_acls: Don't skip ACEs in merge_default_aces()
       via  12d990ac9f0 s4-acl: Make parameter const
       via  047214be29f s4/dsdb/cracknames: Remove unneeded attribute
       via  dc7911e76b4 s4-dsdb: Check correct ldb opaque variable
       via  0ec0a04dc10 s4-dsdb: Remove is_attr_in_list()
       via  6f2bccf1f44 s4/dsdb/util: Make some arrays static
       via  6ef23456c39 ldb: Avoid undefined pointer arithmetic
       via  aedbee5fd2f ldb: Fix function documentation to be consistent
       via  0ff26aa0c5f ldb: Don't wrongly claim to return message elements
       via  cb3c344a643 ldb: Remove misleading comment
       via  3d935fdcb9c ldb: Remove old misleading comments
       via  064d8a3d123 talloc: Remove unneeded va_copy()
       via  90a042e9a97 talloc: Put comment back in appropriate place
       via  5459217bdda s4:kdc: Fix typos
       via  81bfa75257d s4:kdc: Fix typos in comments
       via  88c1b49312e s4:kdc: Allocate memory on a temporary context
       via  1469c19b74f s4:kdc: Remove unused parameter
       via  e4b81f7f6d4 samba-tool domain: Initialise variables before attempting to use them
       via  52e626a8d0f pytest/acl: Remove unused remnants of source4/dsdb/tests/python/acl.py
       via  7cb9620fc4b s4-dsdb:large_ldap: Note that we don't check that an error was raised
       via  ec069f1b3d3 s4-dsdb:large_ldap: Assert that we got all the entries
       via  5f24d0adc7e s4-dsdb:large_ldap: Fix disabled test
       via  1cf1e6889e5 s4-dsdb:large_ldap: Correctly increment count variable
       via  911f607ecd4 s4-dsdb:large_ldap: Fix typos in variable names
       via  45ff5a81e58 tests/krb5: Fix comment indentation
       via  91e1898f992 tests/krb5: Remove unused variable
      from  52c78466bdb vfs_fruit: avoid using 'conn->tcon->compat', we can just use 'conn'!

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2ff55b3da7141d7e290f832730750e6fad10bddc
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Thu Apr 6 16:31:09 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Wed Apr 12 14:57:55 UTC 2023 on atb-devel-224

commit 62893486c62a2cf08191cdc92f851b2815461a59
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Wed Apr 12 13:20:00 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 839ca0cd353df9272fdfbb18e551892135cf48fd
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Wed Apr 12 10:15:30 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 44d03bf47930e81679feede7a7719feb7aa77c95
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Wed Apr 12 09:41:29 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 80c548437a7a199c3897246a71df2a2c5348b37a
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 20:57:31 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 2aa9fae1f8d71d1d2c6bca2035ece62d7759e97d
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Wed Apr 12 10:34:22 2023 +1200

    s4:torture: Correctly zero structure
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6a3accec4c7556190f889aab588638c62baa6e3d
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 20:36:15 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6abc50c94ece9beb235bd748dec8aeaaeeee4260
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 20:19:52 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 91ed2f3d5d232e17e963f8542304873986b102bd
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 20:04:23 2023 +1200

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

commit 8e7abe72a82e6bb64d611533b37d5d6adf98f227
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 19:37:21 2023 +1200

    s4:torture: Fix typo
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 8e7c7680f38ebf493f9a462a5dd433f98fbf841d
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 15:39:04 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit aa05498b1ed8ffc60f41f155b3bef1de1b56ae30
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 14:43:23 2023 +1200

    s3:tests: Correct condition
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit f407b3ec0d86fef43e48da27b33007347e7256f9
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 14:38:30 2023 +1200

    testprogs: Return correct status code
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 4726541a789f0df884387f27c63c307709535f24
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 14:34:07 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ae5fafa902bd3b8564a0e36b75a8ddc7e156f1fa
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 14:31:59 2023 +1200

    testprogs: Have testfail() return 0 on success
    
    This is more consistent with the other testing functions.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 23d2c9cb72d3aa4593edae40fc6b998c96242dd6
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 14:26:56 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit dfb088aaed5799ada4e78b8862b5f4f7f7b1de06
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 14:24:55 2023 +1200

    testprogs: Return correct status code
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit b62b0bd64bd8b49b6244949c0149348590119b35
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 14:23:00 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 60c501b387d479fa9c653151dee4b2feebcb04ac
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 14:20:01 2023 +1200

    nsswitch:tests: Remove unused functions
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 833cefe8eeb80e1e5475fc277e09cefdc89b6dce
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 14:04:59 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit b1df85e7d30c59eeb37c243d88efcab8e3d1f9a6
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 11 14:00:51 2023 +1200

    testprogs: Fix comparison
    
    SC2039: In POSIX sh, == in place of = is undefined.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit e0db10cfc387bce669491046d5c52bfc8d1a1ba1
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Feb 13 14:16:47 2023 +1300

    s3:net_usershare: Correctly escape newline in error message
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 03bd1b8ee9bf3ec94869a9b19c871784049f22bf
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Feb 13 15:00:21 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 2de0e1dccd52588790b44da86fc899b20f918d2f
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Feb 13 14:59:38 2023 +1300

    s3:net_usershare: Handle allocation failure
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 78ca3e16da77ba13ef5fc0ae303bb4a371ebcf8d
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Feb 13 14:58:52 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit a1e64e57378b90e8fdc5fbd4ea0d090af5ee0405
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Feb 13 14:58:23 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 894500b670883518a59f12f6ad276cb4e154c181
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Feb 13 14:57:24 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 440c3e869718b6e1e7d1641ae2d12ffed96feabf
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 4 11:34:47 2023 +1200

    ctdb:tool: Remove unnecessary strlen()
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit fd159aaa80006afc5dbac292ceea506b1e3c2fbd
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 4 11:08:54 2023 +1200

    librpc/ndr: Add missing newlines to error messages
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 5b7ee73c0d75335a1ab3e42c3165a7a5cf9eac59
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 4 11:06:47 2023 +1200

    pysmbd: Fix typo in error message
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit f273dcf6c5c89cac2b83851aa100419f17fd3191
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Mar 21 13:47:16 2023 +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 at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit b5b611d90f8d601639f7ed7939610b01391ea531
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Mar 21 13:43:20 2023 +1300

    posix_acls: Don't skip ACEs in merge_default_aces()
    
    If we remove the i'th element, we should decrement i so that we don't
    skip over the succeeding element.
    
    If we remove the j'th element, we should decrement j and continue around
    the loop, so as not to skip subsequent elements.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 12d990ac9f0b348b38f9d2b9e3f943ce0092d015
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Wed Apr 5 10:02:35 2023 +1200

    s4-acl: Make parameter const
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 047214be29f920040cc480f6a4894a6a1357bbed
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Fri Jan 27 07:59:00 2023 +1300

    s4/dsdb/cracknames: Remove unneeded attribute
    
    The cracknames code never uses this.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit dc7911e76b4091b075e460aa870e09e861be29f3
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Apr 3 16:45:07 2023 +1200

    s4-dsdb: Check correct ldb opaque variable
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 0ec0a04dc103e9ffe402eb891d4a30f2736ee2f4
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Feb 14 12:03:10 2023 +1300

    s4-dsdb: Remove is_attr_in_list()
    
    ldb_attr_in_list() already exists and does essentially the same thing.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6f2bccf1f44c9bf90b198a46df964a9fc46e1eae
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Fri Mar 10 12:39:54 2023 +1300

    s4/dsdb/util: Make some arrays static
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6ef23456c39ba57bbdd4d24f84f6556c5e94de95
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Feb 21 09:42:28 2023 +1300

    ldb: Avoid undefined pointer arithmetic
    
    Computing a pointer that points outside of an array, and not to one past
    the last element, is undefined behaviour. To avoid this, do our
    comparisons in terms of lengths, not pointers.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit aedbee5fd2fa2c161c5bd386d1fa25c665f971c2
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Feb 14 12:02:01 2023 +1300

    ldb: Fix function documentation to be consistent
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 0ff26aa0c5f49466aca1db439a49f8dc08e4078e
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Fri Jan 27 08:02:18 2023 +1300

    ldb: Don't wrongly claim to return message elements
    
    If the LDB_UNPACK_DATA_FLAG_NO_ATTRS flag is set, we don't return any
    elements, so we should set num_elements accordingly. This ensures
    callers don't try to access elements that aren't there.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit cb3c344a64335e8ad1555faf170105265e587e4f
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 4 16:44:10 2023 +1200

    ldb: Remove misleading comment
    
    That an attribute has been access checked doesn't mean that the user has
    the right to view it.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 3d935fdcb9c3677dced4fa22d5c8d1a0d48ef6c2
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Wed Jun 29 16:02:05 2022 +1200

    ldb: Remove old misleading comments
    
    Commit bed9efa6cda17ecca91bdf71227ec656b94dcf94 introduced
    ldb_msg_add_linearized_dn() to replace ldb_msg_add_dn(), but retained
    the now-incorrect associated comment. The comment later made its way
    into a function added later by commit 'CVE-2022-32746 ldb: Add functions
    for appending to an ldb_message'.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15008
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 064d8a3d1236dfdada1e2256d6feb804353f0d27
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Thu Mar 2 10:23:40 2023 +1300

    talloc: Remove unneeded va_copy()
    
    We don't use 'ap' again after this.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 90a042e9a97fa7ac4608be8d55c2db5785845406
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Thu Mar 2 10:22:45 2023 +1300

    talloc: Put comment back in appropriate place
    
    This comment originally referred, not to a va_copy() call, but to the
    use of &c with vsnprintf() rather than passing in NULL with a length of
    zero.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 5459217bdda674e37addd01cec2ca1315c6bed2d
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Apr 3 16:56:56 2023 +1200

    s4:kdc: Fix typos
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 81bfa75257d98e4d1f23a58a0d553d275428cf39
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Fri Apr 29 12:11:35 2022 +1200

    s4:kdc: Fix typos in comments
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 88c1b49312e3bde1589662eba7db63076911e0f9
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 4 12:51:19 2023 +1200

    s4:kdc: Allocate memory on a temporary context
    
    We should not allocate memory on a longer-lived context than necessary.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 1469c19b74f17cb341be606f005afadc4a8bf224
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 4 12:54:08 2023 +1200

    s4:kdc: Remove unused parameter
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit e4b81f7f6d43fba73ca4f34ed412fe85d35fb7cb
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Feb 13 14:52:18 2023 +1300

    samba-tool domain: Initialise variables before attempting to use them
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 52e626a8d0f9ebf88b17d22e8cd1f44fa9340029
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 4 16:55:35 2023 +1200

    pytest/acl: Remove unused remnants of source4/dsdb/tests/python/acl.py
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 7cb9620fc4be519c0eb156047ed275eb80d28f1d
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Mar 7 13:43:25 2023 +1300

    s4-dsdb:large_ldap: Note that we don't check that an error was raised
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ec069f1b3d37237ff034b33dd69d1f32d677cdb7
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Thu Apr 6 12:19:43 2023 +1200

    s4-dsdb:large_ldap: Assert that we got all the entries
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 5f24d0adc7eaafe16764efdfd78e894649ab9221
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Wed Apr 5 16:47:29 2023 +1200

    s4-dsdb:large_ldap: Fix disabled test
    
    This test was silently skipped due to setUpClass() throwing a NameError.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 1cf1e6889e502244d83c8bc13a38f1c8e5b75d7f
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Mar 7 13:44:17 2023 +1300

    s4-dsdb:large_ldap: Correctly increment count variable
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 911f607ecd4a88e0ac9a44284650cffc7eeb58c9
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Feb 13 15:05:08 2023 +1300

    s4-dsdb:large_ldap: Fix typos in variable names
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 45ff5a81e5881e28ea98ff9ab7496f96deca1431
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Wed Apr 5 11:55:06 2023 +1200

    tests/krb5: Fix comment indentation
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 91e1898f992376b35a65c3719837bda93cb96ea9
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Tue Apr 4 12:10:08 2023 +1200

    tests/krb5: Remove unused variable
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/tools/ctdb.c                                  |   3 +-
 lib/ldb/common/ldb_msg.c                           |   4 -
 lib/ldb/common/ldb_pack.c                          |  20 ++--
 lib/ldb/include/ldb.h                              |  24 ++---
 lib/ldb/include/ldb_module.h                       |   4 +-
 lib/ldb/pyldb.c                                    |   4 +
 lib/talloc/talloc.c                                |   6 +-
 lib/torture/torture.c                              |  22 +++--
 lib/torture/torture.h                              |  10 +-
 librpc/ndr/ndr_basic.c                             |   3 +
 librpc/ndr/ndr_claims.c                            |   6 +-
 nsswitch/tests/test_rfc2307_mapping.sh             |  34 -------
 nsswitch/tests/test_wbinfo.sh                      |  13 +--
 python/samba/netcmd/domain/trust.py                |   3 +
 python/samba/tests/krb5/claims_tests.py            |   2 -
 python/samba/tests/krb5/protected_users_tests.py   |   6 +-
 selftest/knownfail.d/samba3.rpc.samr               |   5 +
 selftest/knownfail.d/samba4.rpc.netlogon-s3        |   4 +
 selftest/knownfail.d/samba4.rpc.samr               |   2 +
 selftest/selftest.pl                               |   6 +-
 selftest/target/Samba3.pm                          |   2 +
 selftest/target/Samba4.pm                          |   2 +-
 source3/script/tests/test_dfree_command.sh         |   4 +-
 source3/script/tests/test_dfree_quota.sh           |  12 ++-
 source3/script/tests/test_guest_auth.sh            |   2 +-
 .../script/tests/test_smbclient_encryption_off.sh  |  24 ++---
 source3/selftest/tests.py                          | 105 +++++++++++----------
 source3/smbd/notify.c                              |  76 ++++++++++++---
 source3/smbd/posix_acls.c                          |  20 +++-
 source3/smbd/pysmbd.c                              |   2 +-
 source3/utils/net_usershare.c                      |  22 ++++-
 source4/dsdb/common/util.c                         |  16 +---
 source4/dsdb/common/util.h                         |   2 -
 source4/dsdb/samdb/cracknames.c                    |   1 -
 source4/dsdb/samdb/ldb_modules/acl_read.c          |   2 +-
 source4/dsdb/samdb/ldb_modules/extended_dn_out.c   |   8 +-
 source4/dsdb/samdb/ldb_modules/operational.c       |  10 +-
 source4/dsdb/samdb/ldb_modules/util.c              |  12 +--
 source4/dsdb/tests/python/acl_modify.py            |  59 +-----------
 source4/dsdb/tests/python/large_ldap.py            |  30 ++++--
 source4/kdc/ad_claims.c                            |   6 +-
 source4/kdc/db-glue.c                              |   6 +-
 source4/kdc/mit_samba.c                            |   3 +-
 source4/kdc/pac-glue.c                             |  41 +++++---
 source4/kdc/pac-glue.h                             |   3 +-
 source4/rpc_server/drsuapi/updaterefs.c            |   5 +
 source4/rpc_server/samr/dcesrv_samr.c              |  12 +++
 source4/selftest/tests.py                          |   6 +-
 source4/torture/rpc/mdssvc.c                       |  24 ++++-
 source4/torture/rpc/samr.c                         |   2 +-
 testprogs/blackbox/bogus.sh                        |   2 +-
 testprogs/blackbox/common_test_fns.inc             |  11 ++-
 testprogs/blackbox/subunit.sh                      |   5 +-
 testprogs/blackbox/test_kpasswd_mit.sh             |   6 +-
 testprogs/blackbox/test_ldb.sh                     |   2 +-
 testprogs/blackbox/test_net_ads.sh                 |   4 +-
 testprogs/blackbox/test_net_ads_dns.sh             |   2 +-
 testprogs/blackbox/test_password_settings.sh       |  12 +--
 testprogs/blackbox/test_pdbtest.sh                 |   4 +-
 testprogs/blackbox/test_trust_ntlm.sh              |  30 +++---
 testprogs/blackbox/test_weak_crypto_server.sh      |   2 +-
 61 files changed, 438 insertions(+), 342 deletions(-)
 create mode 100644 selftest/knownfail.d/samba3.rpc.samr
 create mode 100644 selftest/knownfail.d/samba4.rpc.netlogon-s3
 create mode 100644 selftest/knownfail.d/samba4.rpc.samr


Changeset truncated at 500 lines:

diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 35e43ee7291..67d2f6bc1c9 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -6168,8 +6168,7 @@ static const struct ctdb_cmd *match_command(const char *command)
 
 	for (i=0; i<ARRAY_SIZE(ctdb_commands); i++) {
 		cmd = &ctdb_commands[i];
-		if (strlen(command) == strlen(cmd->name) &&
-		    strncmp(command, cmd->name, strlen(command)) == 0) {
+		if (strcmp(command, cmd->name) == 0) {
 			return cmd;
 		}
 	}
diff --git a/lib/ldb/common/ldb_msg.c b/lib/ldb/common/ldb_msg.c
index a308b32ed42..3242447b544 100644
--- a/lib/ldb/common/ldb_msg.c
+++ b/lib/ldb/common/ldb_msg.c
@@ -569,8 +569,6 @@ int ldb_msg_add_steal_string(struct ldb_message *msg,
 
 /*
   add a DN element to a message
-  WARNING: this uses the linearized string from the dn, and does not
-  copy the string.
 */
 int ldb_msg_add_linearized_dn(struct ldb_message *msg, const char *attr_name,
 			      struct ldb_dn *dn)
@@ -703,8 +701,6 @@ int ldb_msg_append_string(struct ldb_message *msg,
 
 /*
   append a DN element to a message
-  WARNING: this uses the linearized string from the dn, and does not
-  copy the string.
 */
 int ldb_msg_append_linearized_dn(struct ldb_message *msg, const char *attr_name,
 				 struct ldb_dn *dn, int flags)
diff --git a/lib/ldb/common/ldb_pack.c b/lib/ldb/common/ldb_pack.c
index 4d32d951a83..b06a6e2b84b 100644
--- a/lib/ldb/common/ldb_pack.c
+++ b/lib/ldb/common/ldb_pack.c
@@ -610,6 +610,7 @@ static int ldb_unpack_data_flags_v1(struct ldb_context *ldb,
 	}
 
 	if (flags & LDB_UNPACK_DATA_FLAG_NO_ATTRS) {
+		message->num_elements = 0;
 		return 0;
 	}
 	
@@ -785,7 +786,7 @@ static int ldb_unpack_data_flags_v2(struct ldb_context *ldb,
 	p += U32_LEN;
 
 	/* First fields are fixed: num_elements, DN length */
-	if (p + U32_LEN * 2 > end_p) {
+	if (U32_LEN * 2 > end_p - p) {
 		errno = EIO;
 		goto failed;
 	}
@@ -796,7 +797,7 @@ static int ldb_unpack_data_flags_v2(struct ldb_context *ldb,
 	len = PULL_LE_U32(p, 0);
 	p += U32_LEN;
 
-	if (p + len + NULL_PAD_BYTE_LEN > end_p) {
+	if (len + NULL_PAD_BYTE_LEN > end_p - p) {
 		errno = EIO;
 		goto failed;
 	}
@@ -825,7 +826,7 @@ static int ldb_unpack_data_flags_v2(struct ldb_context *ldb,
 	len = PULL_LE_U32(p, 0) + NULL_PAD_BYTE_LEN;
 	p += U32_LEN;
 
-	if (p + len > end_p) {
+	if (len > end_p - p) {
 		errno = EIO;
 		goto failed;
 	}
@@ -838,6 +839,7 @@ static int ldb_unpack_data_flags_v2(struct ldb_context *ldb,
 	}
 
 	if (flags & LDB_UNPACK_DATA_FLAG_NO_ATTRS) {
+		message->num_elements = 0;
 		return 0;
 	}
 
@@ -890,10 +892,10 @@ static int ldb_unpack_data_flags_v2(struct ldb_context *ldb,
 		struct ldb_message_element *element = NULL;
 
 		/* Sanity check: minimum element size */
-		if (p + (U32_LEN * 2) + /* attr name len, num values */
+		if ((U32_LEN * 2) + /* attr name len, num values */
 			(U8_LEN * 2) + /* value length width, one val length */
 			(NULL_PAD_BYTE_LEN * 2) /* null for attr name + val */
-			> value_section_p) {
+			> value_section_p - p) {
 			errno = EIO;
 			goto failed;
 		}
@@ -914,7 +916,7 @@ static int ldb_unpack_data_flags_v2(struct ldb_context *ldb,
 		 * val_len_width is the width specifier
 		 * for the variable length encoding
 		 */
-		if (p + U32_LEN + U8_LEN > value_section_p) {
+		if (U32_LEN + U8_LEN > value_section_p - p) {
 			errno = EIO;
 			goto failed;
 		}
@@ -954,8 +956,8 @@ static int ldb_unpack_data_flags_v2(struct ldb_context *ldb,
 		val_len_width = *p;
 		p += U8_LEN;
 
-		if (p + val_len_width * element->num_values >
-		    value_section_p) {
+		if (val_len_width * element->num_values >
+		    value_section_p - p) {
 			errno = EIO;
 			goto failed;
 		}
@@ -992,7 +994,7 @@ static int ldb_unpack_data_flags_v2(struct ldb_context *ldb,
 				errno = EIO;
 				goto failed;
 			}
-			if (q + len + NULL_PAD_BYTE_LEN > end_p) {
+			if (len + NULL_PAD_BYTE_LEN > end_p - q) {
 				errno = EIO;
 				goto failed;
 			}
diff --git a/lib/ldb/include/ldb.h b/lib/ldb/include/ldb.h
index e38569a502c..70dac7280bf 100644
--- a/lib/ldb/include/ldb.h
+++ b/lib/ldb/include/ldb.h
@@ -1185,8 +1185,8 @@ int ldb_modify_default_callback(struct ldb_request *req, struct ldb_reply *ares)
   \param attrs the search attributes for the query (pass NULL if none required)
   \param controls an array of controls
   \param context the callback function context
-  \param the callback function to handle the async replies
-  \param the parent request if any
+  \param callback the callback function to handle the async replies
+  \param parent the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -1224,8 +1224,8 @@ int ldb_build_search_req_ex(struct ldb_request **ret_req,
   \param message contains the entry to be added
   \param controls an array of controls
   \param context the callback function context
-  \param the callback function to handle the async replies
-  \param the parent request if any
+  \param callback the callback function to handle the async replies
+  \param parent the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -1248,8 +1248,8 @@ int ldb_build_add_req(struct ldb_request **ret_req,
   \param message contains the entry to be modified
   \param controls an array of controls
   \param context the callback function context
-  \param the callback function to handle the async replies
-  \param the parent request if any
+  \param callback the callback function to handle the async replies
+  \param parent the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -1272,8 +1272,8 @@ int ldb_build_mod_req(struct ldb_request **ret_req,
   \param dn the DN to be deleted
   \param controls an array of controls
   \param context the callback function context
-  \param the callback function to handle the async replies
-  \param the parent request if any
+  \param callback the callback function to handle the async replies
+  \param parent the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -1297,8 +1297,8 @@ int ldb_build_del_req(struct ldb_request **ret_req,
   \param newdn the new DN
   \param controls an array of controls
   \param context the callback function context
-  \param the callback function to handle the async replies
-  \param the parent request if any
+  \param callback the callback function to handle the async replies
+  \param parent the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -1470,8 +1470,8 @@ int ldb_extended_default_callback(struct ldb_request *req, struct ldb_reply *are
   it needs to be NULL or a valid talloc pointer! talloc_get_type() will be used on it
   \param controls an array of controls
   \param context the callback function context
-  \param the callback function to handle the async replies
-  \param the parent request if any
+  \param callback the callback function to handle the async replies
+  \param parent the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
diff --git a/lib/ldb/include/ldb_module.h b/lib/ldb/include/ldb_module.h
index 464100c6064..e3f3d994aef 100644
--- a/lib/ldb/include/ldb_module.h
+++ b/lib/ldb/include/ldb_module.h
@@ -103,8 +103,8 @@ struct ldb_module;
 #define LDB_FLAG_INTERNAL_SHARED_VALUES 0x200
 
 /*
- * this attribute has been access checked. We know the user has the right to
- * view it. Used internally in Samba aclread module.
+ * this attribute has been access checked. Used internally in Samba aclread
+ * module.
  */
 #define LDB_FLAG_INTERNAL_ACCESS_CHECKED 0x400
 
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 4574f398c92..45a53d94563 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -3421,6 +3421,10 @@ static PyObject *py_ldb_msg_element_repr(PyLdbMessageElementObject *self)
 		else
 			element_str = talloc_asprintf_append(element_str, ",%s", PyUnicode_AsUTF8(repr));
 		Py_DECREF(repr);
+
+		if (element_str == NULL) {
+			return PyErr_NoMemory();
+		}
 	}
 
 	if (element_str != NULL) {
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index 41fa45bc99b..530bad896ab 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -2598,7 +2598,6 @@ static struct talloc_chunk *_vasprintf_tc(const void *t,
 	struct talloc_chunk *tc = NULL;
 	char buf[1024];
 
-	/* this call looks strange, but it makes it work on older solaris boxes */
 	va_copy(ap2, ap);
 	vlen = vsnprintf(buf, sizeof(buf), fmt, ap2);
 	va_end(ap2);
@@ -2662,6 +2661,7 @@ static inline char *__talloc_vaslenprintf_append(char *s, size_t slen,
 	char c;
 
 	va_copy(ap2, ap);
+	/* this call looks strange, but it makes it work on older solaris boxes */
 	alen = vsnprintf(&c, 1, fmt, ap2);
 	va_end(ap2);
 
@@ -2678,9 +2678,7 @@ static inline char *__talloc_vaslenprintf_append(char *s, size_t slen,
 	s = talloc_realloc(NULL, s, char, slen + alen + 1);
 	if (!s) return NULL;
 
-	va_copy(ap2, ap);
-	vsnprintf(s + slen, alen + 1, fmt, ap2);
-	va_end(ap2);
+	vsnprintf(s + slen, alen + 1, fmt, ap);
 
 	_tc_set_name_const(talloc_chunk_from_ptr(s), s);
 	return s;
diff --git a/lib/torture/torture.c b/lib/torture/torture.c
index b8fb28f669f..41226ef7504 100644
--- a/lib/torture/torture.c
+++ b/lib/torture/torture.c
@@ -212,18 +212,22 @@ void torture_warning(struct torture_context *context, const char *comment, ...)
 void torture_result(struct torture_context *context, 
 		    enum torture_result result, const char *fmt, ...)
 {
-	va_list ap;
+	/* Of the two outcomes, keep that with the higher priority. */
+	if (result >= context->last_result) {
+		va_list ap;
 
-	va_start(ap, fmt);
+		va_start(ap, fmt);
 
-	if (context->last_reason) {
-		torture_warning(context, "%s", context->last_reason);
-		talloc_free(context->last_reason);
-	}
+		if (context->last_reason) {
+			torture_warning(context, "%s", context->last_reason);
+			talloc_free(context->last_reason);
+		}
 
-	context->last_result = result;
-	context->last_reason = talloc_vasprintf(context, fmt, ap);
-	va_end(ap);
+		context->last_result = result;
+		context->last_reason = talloc_vasprintf(context, fmt, ap);
+
+		va_end(ap);
+	}
 }
 
 /**
diff --git a/lib/torture/torture.h b/lib/torture/torture.h
index f6089684afd..6818084ea96 100644
--- a/lib/torture/torture.h
+++ b/lib/torture/torture.h
@@ -27,11 +27,15 @@ struct torture_suite;
 struct torture_tcase;
 struct torture_results;
 
+/*
+ * Arranged in precedence order. TORTURE_ERROR has the highest priority;
+ * TORTURE_OK the lowest.
+ */
 enum torture_result { 
 	TORTURE_OK=0, 
-	TORTURE_FAIL=1,
-	TORTURE_ERROR=2,
-	TORTURE_SKIP=3
+	TORTURE_SKIP=1,
+	TORTURE_FAIL=2,
+	TORTURE_ERROR=3
 };
 
 enum torture_progress_whence {
diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index e239cfb27d9..39aa3690cbe 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -1016,12 +1016,15 @@ _PUBLIC_ enum ndr_err_code ndr_pull_ipv6address(struct ndr_pull *ndr, int ndr_fl
 	uint8_t addr[IPV6_BYTES];
 	char *addr_str = talloc_strdup(ndr->current_mem_ctx, "");
 	int i;
+	NDR_ERR_HAVE_NO_MEMORY(addr_str);
 	NDR_CHECK(ndr_pull_array_uint8(ndr, ndr_flags, addr, IPV6_BYTES));
 	for (i = 0; i < IPV6_BYTES; ++i) {
 		addr_str = talloc_asprintf_append(addr_str, "%02x", addr[i]);
+		NDR_ERR_HAVE_NO_MEMORY(addr_str);
 		/* We need a ':' every second byte but the last one */
 		if (i%2 == 1 && i != (IPV6_BYTES - 1)) {
 			addr_str = talloc_strdup_append(addr_str, ":");
+			NDR_ERR_HAVE_NO_MEMORY(addr_str);
 		}
 	}
 	*address = addr_str;
diff --git a/librpc/ndr/ndr_claims.c b/librpc/ndr/ndr_claims.c
index 6bafbbe1f85..c144d8985fa 100644
--- a/librpc/ndr/ndr_claims.c
+++ b/librpc/ndr/ndr_claims.c
@@ -55,7 +55,7 @@ size_t ndr_claims_compressed_size(struct CLAIMS_SET_NDR *claims_set,
 				       claims_set,
 				       (ndr_push_flags_fn_t)ndr_push_CLAIMS_SET_NDR);
 	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-		DBG_ERR("Failed to push claims while determining compressed size");
+		DBG_ERR("Failed to push claims while determining compressed size\n");
 		TALLOC_FREE(frame);
 		return 0;
 	}
@@ -77,14 +77,14 @@ size_t ndr_claims_compressed_size(struct CLAIMS_SET_NDR *claims_set,
 		TALLOC_FREE(frame);
 
 		if (compressed_size < 0) {
-			DBG_ERR("Failed to compress claims (for determining compressed size)");
+			DBG_ERR("Failed to compress claims (for determining compressed size)\n");
 			return 0;
 		}
 		return compressed_size;
 
 	default:
 		TALLOC_FREE(frame);
-		DBG_ERR("Invalid chosen compression algorithm while determining compressed claim size");
+		DBG_ERR("Invalid chosen compression algorithm while determining compressed claim size\n");
 		return 0;
 	}
 }
diff --git a/nsswitch/tests/test_rfc2307_mapping.sh b/nsswitch/tests/test_rfc2307_mapping.sh
index a700791bde3..440a924b090 100755
--- a/nsswitch/tests/test_rfc2307_mapping.sh
+++ b/nsswitch/tests/test_rfc2307_mapping.sh
@@ -26,40 +26,6 @@ samba_tool="$VALGRIND $samba4bindir/samba-tool"
 
 ldbmodify=$(system_or_builddir_binary ldbmodify "${BINDIR}")
 
-testfail()
-{
-	name="$1"
-	shift
-	cmdline="$*"
-	echo "test: $name"
-	$cmdline
-	status=$?
-	if [ x$status = x0 ]; then
-		echo "failure: $name"
-	else
-		echo "success: $name"
-	fi
-	return $status
-}
-
-knownfail()
-{
-	name="$1"
-	shift
-	cmdline="$*"
-	echo "test: $name"
-	$cmdline
-	status=$?
-	if [ x$status = x0 ]; then
-		echo "failure: $name [unexpected success]"
-		status=1
-	else
-		echo "knownfail: $name"
-		status=0
-	fi
-	return $status
-}
-
 # Create new testing account
 testit "user add" $PYTHON $samba_tool user create --given-name="rfc2307" \
 	--surname="Tester" --initial="UT" rfc2307_test_user testp at ssw0Rd \
diff --git a/nsswitch/tests/test_wbinfo.sh b/nsswitch/tests/test_wbinfo.sh
index 8b48abc151b..b36e4c63bc1 100755
--- a/nsswitch/tests/test_wbinfo.sh
+++ b/nsswitch/tests/test_wbinfo.sh
@@ -29,10 +29,11 @@ testfail()
 	status=$?
 	if [ x$status = x0 ]; then
 		echo "failure: $name"
+		return 1
 	else
 		echo "success: $name"
+		return 0
 	fi
-	return $status
 }
 
 knownfail()
@@ -183,7 +184,7 @@ else
 	echo "success: wbinfo -S check for sane mapping"
 fi
 
-testfail "wbinfo -S against $TARGET using invalid SID" $wbinfo -S "S-1-22-2-30000" && failed=$(expr $failed + 1)
+testfail "wbinfo -S against $TARGET using invalid SID" $wbinfo -S "S-1-22-2-30000" || failed=$(expr $failed + 1)
 
 testit "wbinfo -Y against $TARGET" $wbinfo -Y "S-1-22-2-30000" || failed=$(expr $failed + 1)
 
@@ -197,7 +198,7 @@ else
 	echo "success: wbinfo -Y check for sane mapping"
 fi
 
-testfail "wbinfo -Y against $TARGET using invalid SID" $wbinfo -Y "S-1-22-1-30000" && failed=$(expr $failed + 1)
+testfail "wbinfo -Y against $TARGET using invalid SID" $wbinfo -Y "S-1-22-1-30000" || failed=$(expr $failed + 1)
 
 testit "wbinfo -t against $TARGET" $wbinfo -t || failed=$(expr $failed + 1)
 
@@ -284,7 +285,7 @@ else
 	failed=$(expr $failed + 1)
 fi
 
-testfail "wbinfo --group-info against $TARGET with $USERNAME" $wbinfo --group-info $USERNAME && failed=$(expr $failed + 1)
+testfail "wbinfo --group-info against $TARGET with $USERNAME" $wbinfo --group-info $USERNAME || failed=$(expr $failed + 1)
 
 testit "wbinfo --gid-info against $TARGET" $wbinfo --gid-info $gid || failed=$(expr $failed + 1)
 
@@ -312,9 +313,9 @@ if test "$TARGET" = "ad_member"; then
 	testit "wbinfo --dc-info=$DOMAIN" $wbinfo --dc-info=$DOMAIN || failed=$(expr $failed + 1)
 fi
 
-testit_expect_failure "wbinfo -a against $TARGET with invalid password" $wbinfo -a "$DOMAIN/$USERNAME%InvalidPassword" && failed=$(expr $failed + 1)
+testit_expect_failure "wbinfo -a against $TARGET with invalid password" $wbinfo -a "$DOMAIN/$USERNAME%InvalidPassword" || failed=$(expr $failed + 1)
 
-testit_expect_failure "wbinfo -K against $TARGET with invalid password" $wbinfo -K "$DOMAIN/$USERNAME%InvalidPassword" && failed=$(expr $failed + 1)
+testit_expect_failure "wbinfo -K against $TARGET with invalid password" $wbinfo -K "$DOMAIN/$USERNAME%InvalidPassword" || failed=$(expr $failed + 1)
 
 rm -f $KRB5CCNAME_PATH
 
diff --git a/python/samba/netcmd/domain/trust.py b/python/samba/netcmd/domain/trust.py
index de64dfadd31..99570934384 100644
--- a/python/samba/netcmd/domain/trust.py
+++ b/python/samba/netcmd/domain/trust.py
@@ -1036,6 +1036,9 @@ class cmd_domain_trust_create(DomainTrustCommand):
         incoming_blob = generate_AuthInOutBlob(incoming_secret, update_time)
         outgoing_blob = generate_AuthInOutBlob(outgoing_secret, update_time)
 
+        local_tdo_handle = None
+        remote_tdo_handle = None
+
         try:
             if remote_trust_info:
                 self.outf.write("Creating remote TDO.\n")
diff --git a/python/samba/tests/krb5/claims_tests.py b/python/samba/tests/krb5/claims_tests.py
index 022224eb6f1..9023d4fd9f2 100755
--- a/python/samba/tests/krb5/claims_tests.py
+++ b/python/samba/tests/krb5/claims_tests.py
@@ -2029,10 +2029,8 @@ class ClaimsTests(KDCBaseTest):
                 },
             }
             unexpected_claims = None
-            expect_client_claims = True
         else:
             expected_claims = None
-            expect_client_claims = None
             unexpected_claims = {claim_id}
 
         # Get a TGT and check whether the claim is present or missing.
diff --git a/python/samba/tests/krb5/protected_users_tests.py b/python/samba/tests/krb5/protected_users_tests.py
index 5ca5de0321e..10fc43a3ae8 100755
--- a/python/samba/tests/krb5/protected_users_tests.py
+++ b/python/samba/tests/krb5/protected_users_tests.py
@@ -688,9 +688,9 @@ class ProtectedUsersTests(KDCBaseTest):


-- 
Samba Shared Repository



More information about the samba-cvs mailing list