[SCM] Samba Shared Repository - branch v4-9-test updated

Karolin Seeger kseeger at samba.org
Fri May 17 10:57:02 UTC 2019


The branch, v4-9-test has been updated
       via  8b523259855 ctdb-common: Fix memory leak in run_proc
       via  54199785376 ctdb-common: Fix memory leak
       via  76c7302105c ctdb-recoverd: Fix memory leak
       via  f81a971cc29 vfs_ceph: fix cephwrap_flistxattr() debug message
       via  e1522725b0f s3:smbspool: Fix regression printing with Kerberos credentials
       via  e3dd029dfad s3: SMB1: Don't allow recvfile on stream fsp's.
       via  1e9e531a585 s3:smbd: don't use recvfile on streams
       via  f8eb314bcda s3:utils: If share is NULL in smbcacls, don't print it
       via  c98a190ff88 s3:utils: If share is NULL in smbcquotas, don't print it
       via  ca9e386a59e s3:winbindd: Do not free db_path in idmap_tdb2 before we printed it
       via  925871f5808 ctdb:common: Do not print NULL if we don't get a sockpath
       via  f00cb3c1824 s4:torture: Do not free full_name before we printed it
       via  637b3b1a3da lib:torture: Fix string comparison macros where we directly pass NULL
       via  1f14d55f45e s4:torture: Do not print NULL strings we just checked before
       via  9fda18d7707 s4:ntvfs: Do not free eadb before we printed an error
       via  541a98bc843 s3:rpc_server: Do not free the tdbname before we printed it
       via  2ec15697375 s4:auth: Fix debug statement in gensec_gssapi
       via  1c2c081f439 ctdb-daemon: Never use 0 as a client ID
       via  24d70220b28 ctdb-tests: Fix logic error in simple ctdb reloadips test
       via  9f679ba14d5 ctdb-tests: Make ctdb reloadips tests more reliable
       via  0ffba5145c8 ctdb-tests: Capture output in $out on failure as well
       via  1eb5d2e4fc2 ctdb-tests: Don't clean up test var directory in autotest target
       via  15e5d62b3d9 ctdb-tests: Fix usage message
       via  814471f46e8 ctdb-tests: Wait to allow database attach/detach to take effect
       via  3f104bd0db2 ctdb-tests: Avoid bulk output in $out, prefer $outfile
       via  b594f5161dd ctdb-tests: Make try_command_on_node less error-prone
       via  7c97bc83284 ctdb-tests: Change sanity_check_output() to internally use $out
       via  30b5d837d5d ctdb-tests: Extend test to cover ctdb rddumpmemory
       via  08e229df43e ctdb-tools: Fix ctdb dumpmemory to avoid printing trailing NUL
       via  7db0d1a7646 smbd: implement SMB_FILE_NORMALIZED_NAME_INFORMATION handling
       via  ffb6fb90f69 s4:torture/smb2: add smb2.getinfo.normalized test
       via  d2c87ba602b s4:libcli/raw: add RAW_FILEINFO_NORMALIZED_NAME_INFORMATION support
       via  e8a1f4c233b smbd: allow case insensitive opens of named streams
       via  b23a436e0cc s4:torture/smb2: add smb2.stream.names3 test
       via  9f4cc1ff94e s3: modules: ceph: use current working directory instead of share path
       via  9348090b5e2 s3:debug: enable logging for early startup failures
       via  adc1277e392 s3:debug: adjust indention
       via  dea9042b2e2 s3:debug: use struct initializer
       via  2e2b539d83a debug: add a call to debug_parse_levels() to reopen_logs()
       via  cd5fbcc9d4d debug: add an empty line
       via  e7b1794cefa winbind: Fix overlapping id ranges
       via  ac678f27dff selftest: Add trusted domain tests for idmap_ad
       via  c1b0fb91caf selftest: Pass trusted domain information to idmap_ad test
       via  4cf06197d2a selftest: Add idmap configuration for trusted domain for idmap_ad
       via  f807c76db1e selftest: Make trusted domain information available for idmap_ad environment
       via  dcbffbb3084 selftest: Use fl2008r2dc for ad_member_idmap_ad
       via  0861417bf9d selftest: Add gid-to-sid lookup to idmap_ad test
       via  d4d41f0d20d lib util debug: Increase format buffer to 4KiB
       via  bba9f065003 pytests/dns: use 2.6 compatible syntax
      from  03a91bf0a15 winbind: Use domain name from lsa query for sid_to_name cache entry

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-9-test


- Log -----------------------------------------------------------------
commit 8b523259855edcc9350cbb1ee62b4a2156fab539
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon May 13 17:07:59 2019 +1000

    ctdb-common: Fix memory leak in run_proc
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13943
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Tue May 14 08:59:03 UTC 2019 on sn-devel-184
    
    (cherry picked from commit b1f4c86eea022999d5439e4a6ef3494fe41479b6)
    
    Autobuild-User(v4-9-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-9-test): Fri May 17 10:56:19 UTC 2019 on sn-devel-144

commit 5419978537665cbe2233f57f3f289d3843935318
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat May 11 17:33:57 2019 +1000

    ctdb-common: Fix memory leak
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13943
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 30bc6e2529cdd444d4ec7902844c3a6fb0858090)

commit 76c7302105c6f016d5c63315a685746396a789f4
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat May 11 14:24:24 2019 +1000

    ctdb-recoverd: Fix memory leak
    
    state is always freed before exiting this function, so allocate fde
    off it instead of long-lived ctdb context.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13943
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 6a2941e2a9fd6ab2d5b8dbac042b61a7b1b0b914)

commit f81a971cc299a235cd2698c035f3ca10b24735e1
Author: David Disseldorp <ddiss at samba.org>
Date:   Fri May 10 13:18:49 2019 +0200

    vfs_ceph: fix cephwrap_flistxattr() debug message
    
    The @list buffer may be uninitialised prior to ceph_flistxattr()
    invocation, so only log the address.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13940
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): David Disseldorp <ddiss at samba.org>
    Autobuild-Date(master): Fri May 10 12:59:05 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 21dc6f8e8d82f84e4afda355a48fbbd39c7fe800)

commit e1522725b0f7d61c05561e192b077f81fcd95bb0
Author: Andreas Schneider <asn at samba.org>
Date:   Thu May 9 16:18:51 2019 +0200

    s3:smbspool: Fix regression printing with Kerberos credentials
    
    This is a regression which has been introduced with Samba 4.8.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    (cherry picked from commit fd4b1f4f16aee3e3c9a2cb449655edfed171963a)

commit e3dd029dfad5549360e9e931e1d40945a6e5a680
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 9 12:53:11 2019 -0700

    s3: SMB1: Don't allow recvfile on stream fsp's.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13938
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri May 10 01:14:02 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 667db8e8c7836c750085729f5062807669cbb204)

commit 1e9e531a585d25727e2fbb1f88615f31d8bb627b
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Apr 25 10:57:58 2019 +0200

    s3:smbd: don't use recvfile on streams
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13938
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Thu May  9 20:43:53 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 219bc189472acff24410009ee16a409e0aaf8eef)

commit f8eb314bcda9a9847e86869021acb7337a7d3d1e
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 8 17:12:12 2019 +0200

    s3:utils: If share is NULL in smbcacls, don't print it
    
    Found by GCC 9.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 2b957bde5a2f0f670ee0c8acde6edae1f4aaf253)

commit c98a190ff8881681de30a7be022afdbb5e854792
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 8 17:11:13 2019 +0200

    s3:utils: If share is NULL in smbcquotas, don't print it
    
    Found by GCC 9.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 3653dc7013518d90e6deb08a1f21d7472dc86675)

commit ca9e386a59e3ef9f066a45e69255853a2019a565
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 8 17:05:58 2019 +0200

    s3:winbindd: Do not free db_path in idmap_tdb2 before we printed it
    
    Found by GCC 9.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit e333425e0ff6be5691b74a920610b508e7d26892)

commit 925871f58086ddcc68b386eacdfd99d8b42e9c53
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 8 17:03:54 2019 +0200

    ctdb:common: Do not print NULL if we don't get a sockpath
    
    sock_socket_start_recv() might not fill sockpath if we return early.
    
    Found by GCC 9.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 830cb7e67568de5f3ce359cb6af3be8ab545c824)

commit f00cb3c18241277574e10c49e4e707076c3e2af5
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 8 16:58:07 2019 +0200

    s4:torture: Do not free full_name before we printed it
    
    Found by GCC 9.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 46f036d3231bc99cf37c7cabf82757d3c28c5cff)

commit 637b3b1a3da00c0cadeea6bd7deb63c29a1d87c8
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 8 16:54:30 2019 +0200

    lib:torture: Fix string comparison macros where we directly pass NULL
    
    See e.g. lib/util/tests/strlist.c +177
    
    Found by GCC 9.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit a8f773e326d6bdfc1c9eb87a74c00108f6620c56)

commit 1f14d55f45eee6deacc4091ffe4d5a9b57e28bef
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 8 16:51:20 2019 +0200

    s4:torture: Do not print NULL strings we just checked before
    
    Found by GCC 9.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit be72dfbc8edc53ed191dc01668a53cafb5cd785d)

commit 9fda18d77079d44231111c50b9412866f7da6571
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 8 16:32:45 2019 +0200

    s4:ntvfs: Do not free eadb before we printed an error
    
    Found by GCC 9.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 6da032df5450ef72f8608a19b3b5cc6e9185cd6e)

commit 541a98bc843f4232c585b2dbc185d22cd0f81fe0
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 8 16:31:10 2019 +0200

    s3:rpc_server: Do not free the tdbname before we printed it
    
    Found by GCC 9.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 790d7e34cbe4e190d6acdd24696efe53944cd4a6)

commit 2ec15697375c5efa1fcb05f6962751eac2fbd533
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 8 16:27:57 2019 +0200

    s4:auth: Fix debug statement in gensec_gssapi
    
    The 'role' is set to null, we should first set it to the correct value
    before printing anything.
    
    Found by GCC 9.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit bd29f3fcc023d00afde8e9cc2f9db22dcae49877)

commit 1c2c081f439fa7c9b9c5c67978efecf081229a9b
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon May 6 15:22:49 2019 +1000

    ctdb-daemon: Never use 0 as a client ID
    
    ctdb_control_db_attach() and ctdb_control_db_detach() assume that any
    control with client ID 0 comes from another daemon and treat it
    specially.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13930
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 8663e0a64fbdb9ea16babbfe87d6f5d7a7b72bbd)

commit 24d70220b28f6ee7d629a6900af37ae25ecca296
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue May 7 15:42:49 2019 +1000

    ctdb-tests: Fix logic error in simple ctdb reloadips test
    
    There is a chance that restoring IP addresses to the test node will
    result in different IP addresses being assigned to that node.
    Removing a single IP address may then fail (or be a no-op) if it is
    done after the restore.
    
    So, swap the single IP address removal to happen first, then restore,
    then remove all IP addresses.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit dc89db8ca6aadd4a9f7e8a85843c53709d04587c)

commit 9f679ba14d51efd6fff60720a3e343738b0b8578
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue May 7 15:29:19 2019 +1000

    ctdb-tests: Make ctdb reloadips tests more reliable
    
    ctdb reloadips will fail if it can't disable takover runs.  The most
    likely reason for this is that there is already a takeover run in
    progress.  We can't predict when this will happen, so retry if this
    occurs.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 8be4ee1a28d5c037955832b6f827d40f28f02796)

commit 0ffba5145c8baafd176ca5e38d08b433f064aecb
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon May 13 17:40:15 2019 +1000

    ctdb-tests: Capture output in $out on failure as well
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit cf00db40355b49443263187f9d97934f91287e51)

commit 1eb5d2e4fc2895ea2a6ad081407dd624bc97ec36
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed May 1 15:17:14 2019 +1000

    ctdb-tests: Don't clean up test var directory in autotest target
    
    If the directory is always cleaned up then it is not possible to look
    at daemon logs to debug test failures.
    
    This target is only really used by autobuild.py, which (optionally)
    cleans up the parent directory anyway.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Tue May  7 06:56:01 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 5a9e338330fe136908a3a17a5df81c054c5cc5b0)

commit 15e5d62b3d94a0eef0a91ade9f7fb05e3e692b33
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed May 1 15:10:28 2019 +1000

    ctdb-tests: Fix usage message
    
    Since commit 0e9ead8f28fced3ebfa888786a1dc5bb59e734a3 daemons have
    been shut down after each test, so this option no longer has anything
    to do with killing daemons.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit a2ab6485e027ebb13871c7d83b7626ac5c9b98c0)

commit 814471f46e83f826aece75aecdba6ca01f137409
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Apr 27 14:54:09 2019 +1000

    ctdb-tests: Wait to allow database attach/detach to take effect
    
    Sometimes the detach test fails:
    
      Check detaching single test database detach_test1.tdb
      BAD: database detach_test1.tdb is still attached
      Number of databases:4
      dbid:0x5ae995ee name:detach_test4.tdb path:tests/var/simple/node.0/db/volatile/detach_test4.tdb.0
      dbid:0xd84cc13c name:detach_test3.tdb path:tests/var/simple/node.0/db/volatile/detach_test3.tdb.0
      dbid:0x8e8e8cef name:detach_test2.tdb path:tests/var/simple/node.0/db/volatile/detach_test2.tdb.0
      dbid:0xc62491f4 name:detach_test1.tdb path:tests/var/simple/node.0/db/volatile/detach_test1.tdb.0
      Number of databases:3
      dbid:0x5ae995ee name:detach_test4.tdb path:tests/var/simple/node.1/db/volatile/detach_test4.tdb.1
      dbid:0xd84cc13c name:detach_test3.tdb path:tests/var/simple/node.1/db/volatile/detach_test3.tdb.1
      dbid:0x8e8e8cef name:detach_test2.tdb path:tests/var/simple/node.1/db/volatile/detach_test2.tdb.1
      Number of databases:4
      dbid:0x5ae995ee name:detach_test4.tdb path:tests/var/simple/node.2/db/volatile/detach_test4.tdb.2
      dbid:0xd84cc13c name:detach_test3.tdb path:tests/var/simple/node.2/db/volatile/detach_test3.tdb.2
      dbid:0x8e8e8cef name:detach_test2.tdb path:tests/var/simple/node.2/db/volatile/detach_test2.tdb.2
      dbid:0xc62491f4 name:detach_test1.tdb path:tests/var/simple/node.2/db/volatile/detach_test1.tdb.2
      *** TEST COMPLETED (RC=1) AT 2019-04-27 03:35:40, CLEANING UP...
    
    When issued from a client, the detach control re-broadcasts itself
    asynchronously to all nodes and then returns success.  The controls to
    some nodes to do the actual detach may still be in flight when success
    is returned to the client.  Therefore, the test should wait for a few
    seconds to allow the asynchronous controls to complete.
    
    The same is true for the attach control, so workaround the problem in
    the attach test too.
    
    An alternative is to make the attach and detach controls synchronous
    by avoiding the broadcast and waiting for the results of the
    individual controls sent to the nodes.  However, a simple
    implementation would involve adding new nested event loops.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 3cb53a7a05409925024d6a67bcfaeb962d896e0b)

commit 3f104bd0db28eb7aaf1b1f4b9eaf7edce2337185
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Apr 11 20:55:20 2019 +1000

    ctdb-tests: Avoid bulk output in $out, prefer $outfile
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 066cc5b0c561464ed08890d9aa1a1a55b545e9cc)

commit b594f5161dd8845d19f7d12a300751bd4d040eba
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Mar 28 14:26:52 2019 +1100

    ctdb-tests: Make try_command_on_node less error-prone
    
    This sometimes fails, apparently due to a cat process in onnode
    getting EAGAIN.  The conclusion is that tests that process large
    amounts of output should not depend on a sub-shell delivering that
    output into a shell variable.
    
    Change try_command_on_node() to leave all of the output in file
    $outfile and just put the first 1KB into $out.  $outfile is removed
    after each test completes.
    
    Change the implementation of sanity_check_output() to use $outfile
    instead of $out.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 9d02452a24625df5f62fd6d45a16effe2fa45fbe)

commit 7c97bc83284e09ac028a0a7ce04b039b97eae0c7
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Apr 30 12:09:26 2019 +1000

    ctdb-tests: Change sanity_check_output() to internally use $out
    
    All callers are currently passed $out.  Global variable $out is used
    in many other places so use it here to simplify the interface and make
    future changes simpler.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 7c3819d1ac264acf998f426e0cef7f6211e0ddee)

commit 30b5d837d5dc863275cc685e1f4f80d866be7bdf
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Apr 11 16:58:10 2019 +1000

    ctdb-tests: Extend test to cover ctdb rddumpmemory
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13923
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 8108b3134c017c22d245fc5b2207a88d44ab0dd2)

commit 08e229df43ed62991ea966e42e966afcacb4cb55
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Apr 11 16:56:32 2019 +1000

    ctdb-tools: Fix ctdb dumpmemory to avoid printing trailing NUL
    
    Fix ctdb rddumpmemory too.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13923
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit f78d9388fb459dc83fafb4da6e683e3137ad40e1)

commit 7db0d1a7646d6662df0e44cabad90d021e300305
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Apr 25 14:57:33 2019 +0200

    smbd: implement SMB_FILE_NORMALIZED_NAME_INFORMATION handling
    
    Windows 10 (1803 and higher) support and use
    SMB_FILE_NORMALIZED_NAME_INFORMATION calls over the network. As a
    fallback (in case the server don't support it) the client traverses all
    path components, which is very expensive.
    
    Implementing SMB_FILE_NORMALIZED_NAME_INFORMATION is very cheap for us
    as the open already went through unix_convert() and we have the
    information the client is asking for.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13919
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed May  1 18:33:00 UTC 2019 on sn-devel-184
    
    (cherry picked from commit b20fd15e04ce9292f90a7f70f4184e43034b4b9d)

commit ffb6fb90f69d612ffa981c206d6470e4b2e8237a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Apr 25 14:57:02 2019 +0200

    s4:torture/smb2: add smb2.getinfo.normalized test
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13919
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 8a5828de2bdd95223e5f30996d0490fef53742dd)

commit d2c87ba602b033171f62a2bdbecb19131298881b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Apr 25 12:12:34 2019 +0200

    s4:libcli/raw: add RAW_FILEINFO_NORMALIZED_NAME_INFORMATION support
    
    This is supported over the wire in SMB 3.1.1 on starting with
    Windows 10 1803.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13919
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 0c602319194bda6b2a0efdd7c186078583f79264)

commit e8a1f4c233b7ad7fd5a86d9c58e5ccfdcd65ea9a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Apr 25 17:30:43 2019 +0200

    smbd: allow case insensitive opens of named streams
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13919
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 2a69c0915586fb9fb2148239965d06bf9f93c803)

commit b23a436e0cc23cee45518041909a8d55157bfb7a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Apr 29 14:53:13 2019 +0200

    s4:torture/smb2: add smb2.stream.names3 test
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13919
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit b5c4fdbf99caa3a9e7c6446cfbc4f1b23b84b3c8)

commit 9f4cc1ff94e0f44906f3b6f3e6c67c0d501bd44f
Author: Robert Sander <r.sander at heinlein-support.de>
Date:   Thu May 2 11:20:44 2019 -0700

    s3: modules: ceph: use current working directory instead of share path
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13918
    
    Signed-off-by: Robert Sander <r.sander at heinlein-support.de>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu May  2 19:34:11 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 966fc0dc604299a87e40e7170d80911475317db5)

commit 9348090b5e248d469c974df57d42f0cf71988cc8
Author: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Date:   Mon Mar 25 15:17:07 2019 +0100

    s3:debug: enable logging for early startup failures
    
    Commit c89a33a07a 'debug: Use backends instead of explicitly logging to
    syslog or file' introduced a regression where early startup failures (e.g.
    unable to connect to CTDB) are no longer logged because the debug subsystem
    is not yet fully initialized. Enable logging again with reasonable defaults
    when reopen_logs() is called and the parameter file is not yet parsed.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13904
    
    Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>
    
    Autobuild-User(master): Christof Schmitt <cs at samba.org>
    Autobuild-Date(master): Thu Apr 18 22:21:15 UTC 2019 on sn-devel-144
    
    (cherry picked from commit 9b30fcda64080592d20de64b384fd6d3d0775cbf)

commit adc1277e3923496e7fa87a24204007bae1ad3dbb
Author: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Date:   Thu Apr 11 13:11:34 2019 +0200

    s3:debug: adjust indention
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13904
    
    Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>
    (cherry picked from commit a45675879ddcb43ab274d28496eedd6833466ae4)

commit dea9042b2e2712756907da597f6cdd4c5c1a949d
Author: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Date:   Thu Apr 11 13:01:16 2019 +0200

    s3:debug: use struct initializer
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13904
    
    Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>
    (cherry picked from commit b9e1b4ad0033c211710da285c30d603ccb8b8d40)

commit 2e2b539d83a1a8b1d31282db1a42a88f89bb2977
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Dec 12 12:43:47 2018 +0100

    debug: add a call to debug_parse_levels() to reopen_logs()
    
    This allows correct refresh of the "log level" setting when reloading config.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 4341f24069f991dc7119093e418aac392e0a1b50)

commit cd5fbcc9d4de2bfc79b04a49cf2297469bc094fa
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Dec 12 08:48:35 2018 +0100

    debug: add an empty line
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 2bc7e254a62cfc6a60ecff425fc71173c6d21a10)

commit e7b1794cefad88c7cac076ebbcc33f2cc9379096
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Apr 12 16:56:45 2019 +0200

    winbind: Fix overlapping id ranges
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Apr 24 02:25:56 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 3020050bdf9df077ec9a0e962a689557187174ac)

commit ac678f27dffb4dc424e6588b03ec80385f7501f3
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Apr 22 16:41:42 2019 -0700

    selftest: Add trusted domain tests for idmap_ad
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 2577f43a133f8b8eb997b9529a38e21c77b5da22)

commit c1b0fb91caf112590f205f368a3f3b3ead15341d
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Apr 22 16:38:11 2019 -0700

    selftest: Pass trusted domain information to idmap_ad test
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit ac0f8656eed39a4527a5336cf93aa1508666f79b)

commit 4cf06197d2aa66f0765a7fc3b57220d3154f5816
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Apr 22 16:07:02 2019 -0700

    selftest: Add idmap configuration for trusted domain for idmap_ad
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 65e1d783cb17904cd117d896569e7cbe79a3131b)

commit f807c76db1e5f4977feb006be414fc19bd25e700
Author: Christof Schmitt <cs at samba.org>
Date:   Thu Apr 18 13:04:09 2019 -0700

    selftest: Make trusted domain information available for idmap_ad environment
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 281fb81ab1c72831c752be44fd1bfdcfd10bd798)

commit dcbffbb308467e2ba3082943aa0e1db097f0fa72
Author: Christof Schmitt <cs at samba.org>
Date:   Wed Apr 17 16:12:27 2019 -0700

    selftest: Use fl2008r2dc for ad_member_idmap_ad
    
    fl2008r2dc already has a trusted domain. That will be used to use
    idmap_ad for querying idmap attributes from the trusted domain.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 8266bd1f45d1b5b2a61d84006ab8e8e1ed0e52a9)

commit 0861417bf9d6bf499286d7042b7e306d156dda01
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Apr 22 16:15:20 2019 -0700

    selftest: Add gid-to-sid lookup to idmap_ad test
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit d7b5ad5e6159c224f70bea782bbdc46059e67978)

commit d4d41f0d20d4a0a44b86b339c3e9def9b6050ca3
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Thu Apr 18 10:23:22 2019 +1200

    lib util debug: Increase format buffer to 4KiB
    
    Increase the debug line buffer to 4KiB, the existing size of 1KiB is too
    small for dsdbChange JSON audit messages.  These messages were then
    split across multipe lines causing issues in log ingestion tools
    expecting single line messages.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13902
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    
    Autobuild-User(master): Gary Lockyer <gary at samba.org>
    Autobuild-Date(master): Mon May  6 01:18:22 UTC 2019 on sn-devel-184
    
    (cherry picked from commit ad3af7cdffb98b7998857db609548fc96f60c669)

commit bba9f065003b0688836688a5a40dfc587c6f72fc
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Fri Apr 5 09:25:15 2019 +1300

    pytests/dns: use 2.6 compatible syntax
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13886
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

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

Summary of changes:
 ctdb/common/event_script.c                         |   3 +-
 ctdb/common/run_proc.c                             |   7 +-
 ctdb/common/sock_daemon.c                          |   2 +-
 ctdb/server/ctdb_daemon.c                          |  48 +++-
 ctdb/server/ctdb_recoverd.c                        |   2 +-
 ctdb/tests/complex/11_ctdb_delip_removes_ip.sh     |  10 +-
 ctdb/tests/complex/18_ctdb_reloadips.sh            |  43 ++-
 ctdb/tests/complex/32_cifs_tickle.sh               |   8 -
 ctdb/tests/complex/36_smb_reset_server.sh          |  12 +-
 ctdb/tests/complex/37_nfs_reset_server.sh          |   4 +-
 ctdb/tests/complex/60_rogueip_releaseip.sh         |   2 +-
 ctdb/tests/complex/scripts/local.bash              |   5 +-
 ctdb/tests/run_tests.sh                            |   2 +-
 ctdb/tests/scripts/integration.bash                |  71 +++--
 ctdb/tests/simple/02_ctdb_listvars.sh              |   3 +-
 ctdb/tests/simple/03_ctdb_getvar.sh                |   3 +-
 ctdb/tests/simple/05_ctdb_listnodes.sh             |   5 +-
 ctdb/tests/simple/08_ctdb_isnotrecmaster.sh        |  10 +-
 ctdb/tests/simple/09_ctdb_ping.sh                  |   6 +-
 ctdb/tests/simple/11_ctdb_ip.sh                    |  27 +-
 ctdb/tests/simple/12_ctdb_getdebug.sh              |   3 +-
 ctdb/tests/simple/14_ctdb_statistics.sh            |   2 +-
 ctdb/tests/simple/15_ctdb_statisticsreset.sh       |  21 +-
 ctdb/tests/simple/18_ctdb_reloadips.sh             |  70 +++--
 ctdb/tests/simple/19_ip_takeover_noop.sh           |   4 +-
 ctdb/tests/simple/20_delip_iface_gc.sh             |  10 +-
 ctdb/tests/simple/21_ctdb_attach.sh                |  49 ++--
 ctdb/tests/simple/23_ctdb_moveip.sh                |  25 +-
 ctdb/tests/simple/24_ctdb_getdbmap.sh              |  10 +-
 ctdb/tests/simple/25_dumpmemory.sh                 |   9 +-
 ..._ctdb_config_check_error_on_unreachable_ctdb.sh |   6 +-
 ctdb/tests/simple/27_ctdb_detach.sh                |  71 +++--
 ctdb/tests/simple/35_ctdb_getreclock.sh            |   2 +-
 ctdb/tests/simple/51_message_ring.sh               |  14 +-
 ctdb/tests/simple/52_fetch_ring.sh                 |  14 +-
 ctdb/tests/simple/53_transaction_loop.sh           |   4 +-
 ctdb/tests/simple/54_transaction_loop_recovery.sh  |   4 +-
 ctdb/tests/simple/55_ctdb_ptrans.sh                |  12 +-
 .../simple/56_replicated_transaction_recovery.sh   |   4 +-
 ctdb/tests/simple/58_ctdb_restoredb.sh             |   8 +-
 ctdb/tests/simple/69_recovery_resurrect_deleted.sh |  10 +-
 ctdb/tests/simple/70_recoverpdbbyseqnum.sh         |   4 +-
 ctdb/tests/simple/71_ctdb_wipedb.sh                |   4 +-
 ctdb/tests/simple/72_update_record_persistent.sh   |   4 +-
 ctdb/tests/simple/75_readonly_records_basic.sh     |  24 +-
 ctdb/tests/simple/77_ctdb_db_recovery.sh           |   6 +-
 ctdb/tests/simple/79_volatile_db_traverse.sh       |   4 +-
 ctdb/tests/simple/80_ctdb_traverse.sh              |   2 +-
 ctdb/tests/simple/81_tunnel_ring.sh                |  14 +-
 ctdb/tests/simple/90_debug_hung_script.sh          |   6 +-
 ctdb/tools/ctdb.c                                  |  10 +-
 ctdb/wscript                                       |   2 +-
 lib/torture/torture.h                              |   8 +-
 lib/util/debug.c                                   |   2 +-
 lib/util/debug_s3.c                                |  46 ++-
 nsswitch/tests/test_idmap_ad.sh                    | 137 ++++++++-
 python/samba/tests/dns.py                          |   2 +-
 selftest/target/Samba3.pm                          |  11 +-
 source3/client/smbspool.c                          |   2 +-
 source3/modules/vfs_ceph.c                         |   9 +-
 source3/rpc_server/eventlog/srv_eventlog_nt.c      |   4 +-
 source3/selftest/tests.py                          |   2 +-
 source3/smbd/filename.c                            |  72 ++++-
 source3/smbd/reply.c                               |   4 +
 source3/smbd/smb2_getinfo.c                        |   9 +
 source3/smbd/smb2_server.c                         |   3 +
 source3/smbd/trans2.c                              |  57 ++++
 source3/utils/smbcacls.c                           |   4 +-
 source3/utils/smbcquotas.c                         |   4 +-
 source3/winbindd/idmap_tdb2.c                      |   4 +-
 source3/winbindd/wb_xids2sids.c                    |  12 +-
 source4/auth/gensec/gensec_gssapi.c                |   9 +-
 source4/libcli/raw/interfaces.h                    |  16 +-
 source4/libcli/raw/rawfileinfo.c                   |  11 +
 source4/libcli/raw/trans2.h                        |   1 +
 source4/ntvfs/ntvfs_generic.c                      |   2 +
 source4/ntvfs/posix/pvfs_qfileinfo.c               |   2 +
 source4/ntvfs/posix/vfs_posix.c                    |   2 +-
 source4/torture/gentest.c                          |   4 +
 source4/torture/rpc/drsuapi_cracknames.c           |   8 +-
 source4/torture/smb2/getinfo.c                     | 311 +++++++++++++++++++++
 source4/torture/smb2/streams.c                     | 115 ++++++++
 source4/torture/vfs/fruit.c                        |   2 +-
 83 files changed, 1229 insertions(+), 351 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/common/event_script.c b/ctdb/common/event_script.c
index 8978d1452c0..8bdfdd0b5ca 100644
--- a/ctdb/common/event_script.c
+++ b/ctdb/common/event_script.c
@@ -117,7 +117,8 @@ int event_script_get_list(TALLOC_CTX *mem_ctx,
 	}
 
 	*out = script_list;
-	return 0;
+	ret = 0;
+	goto done;
 
 nomem:
 	ret = ENOMEM;
diff --git a/ctdb/common/run_proc.c b/ctdb/common/run_proc.c
index 037b6d9651d..0c3c1de72fe 100644
--- a/ctdb/common/run_proc.c
+++ b/ctdb/common/run_proc.c
@@ -302,13 +302,15 @@ again:
 		proc->fd = -1;
 	}
 
+	DLIST_REMOVE(run_ctx->plist, proc);
+
 	/* Active run_proc request */
 	if (proc->req != NULL) {
 		run_proc_done(proc->req);
+	} else {
+		talloc_free(proc);
 	}
 
-	DLIST_REMOVE(run_ctx->plist, proc);
-
 	goto again;
 }
 
@@ -426,6 +428,7 @@ static void run_proc_done(struct tevent_req *req)
 	if (state->proc->output != NULL) {
 		state->output = talloc_steal(state, state->proc->output);
 	}
+	talloc_steal(state, state->proc);
 
 	tevent_req_done(req);
 }
diff --git a/ctdb/common/sock_daemon.c b/ctdb/common/sock_daemon.c
index e5e16f8af12..6298653f4ec 100644
--- a/ctdb/common/sock_daemon.c
+++ b/ctdb/common/sock_daemon.c
@@ -893,7 +893,7 @@ static void sock_daemon_run_socket_fail(struct tevent_req *subreq)
 		subreq, struct tevent_req);
 	struct sock_daemon_run_state *state = tevent_req_data(
 		req, struct sock_daemon_run_state);
-	const char *sockpath = NULL;
+	const char *sockpath = "INVALID";
 	int ret = 0;
 	bool status;
 
diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index 8247859f9b5..ca98be6a100 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -928,6 +928,44 @@ static int ctdb_clientpid_destructor(struct ctdb_client_pid_list *client_pid)
 	return 0;
 }
 
+static int get_new_client_id(struct reqid_context *idr,
+			     struct ctdb_client *client,
+			     uint32_t *out)
+{
+	uint32_t client_id;
+
+	client_id = reqid_new(idr, client);
+	/*
+	 * Some places in the code (e.g. ctdb_control_db_attach(),
+	 * ctdb_control_db_detach()) assign a special meaning to
+	 * client_id 0.  The assumption is that if client_id is 0 then
+	 * the control has come from another daemon.  Therefore, we
+	 * should never return client_id == 0.
+	 */
+	if (client_id == 0) {
+		/*
+		 * Don't leak ID 0.  This is safe because the ID keeps
+		 * increasing.  A test will be added to ensure that
+		 * this doesn't change.
+		 */
+		reqid_remove(idr, 0);
+
+		client_id = reqid_new(idr, client);
+	}
+
+	if (client_id == REQID_INVALID) {
+		return EINVAL;
+	}
+
+	if (client_id == 0) {
+		/* Every other ID must have been used and we can't use 0 */
+		reqid_remove(idr, 0);
+		return EINVAL;
+	}
+
+	*out = client_id;
+	return 0;
+}
 
 static void ctdb_accept_client(struct tevent_context *ev,
 			       struct tevent_fd *fde, uint16_t flags,
@@ -971,7 +1009,15 @@ static void ctdb_accept_client(struct tevent_context *ev,
 
 	client->ctdb = ctdb;
 	client->fd = fd;
-	client->client_id = reqid_new(ctdb->idr, client);
+
+	ret = get_new_client_id(ctdb->idr, client, &client->client_id);
+	if (ret != 0) {
+		DBG_ERR("Unable to get client ID (%d)\n", ret);
+		close(fd);
+		talloc_free(client);
+		return;
+	}
+
 	client->pid = peer_pid;
 
 	client_pid = talloc(client, struct ctdb_client_pid_list);
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 469fd21b463..88ef3b1c5a0 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -1135,7 +1135,7 @@ static int helper_run(struct ctdb_recoverd *rec, TALLOC_CTX *mem_ctx,
 
 	state->done = false;
 
-	fde = tevent_add_fd(rec->ctdb->ev, rec->ctdb, state->fd[0],
+	fde = tevent_add_fd(rec->ctdb->ev, state, state->fd[0],
 			    TEVENT_FD_READ, helper_handler, state);
 	if (fde == NULL) {
 		goto fail;
diff --git a/ctdb/tests/complex/11_ctdb_delip_removes_ip.sh b/ctdb/tests/complex/11_ctdb_delip_removes_ip.sh
index d6a3b3c04ff..a41be09eab1 100755
--- a/ctdb/tests/complex/11_ctdb_delip_removes_ip.sh
+++ b/ctdb/tests/complex/11_ctdb_delip_removes_ip.sh
@@ -25,8 +25,8 @@ ctdb_restart_when_done
 select_test_node_and_ips
 get_test_ip_mask_and_iface
 
-echo "Checking that node ${test_node} hosts ${test_ip} on interface ${iface}..."
-try_command_on_node $test_node "ip addr show dev $iface | grep -E 'inet6?[[:space:]]*${test_ip}/'"
+echo "Checking that node ${test_node} hosts ${test_ip}..."
+try_command_on_node $test_node "ip addr show to ${test_ip} | grep -q ."
 
 echo "Attempting to remove ${test_ip} from node ${test_node}."
 try_command_on_node $test_node $CTDB delip $test_ip
@@ -36,10 +36,10 @@ wait_until_ips_are_on_node '!' $test_node $test_ip
 timeout=60
 increment=5
 count=0
-echo "Waiting for ${test_ip} to disappear from ${iface}..."
+echo "Waiting for ${test_ip} to disappear from node ${test_node}..."
 while : ; do
-    try_command_on_node -v $test_node "ip addr show dev $iface"
-    if echo "$out" | grep -E 'inet6?[[:space:]]*${test_ip}/'; then
+    try_command_on_node -v $test_node "ip addr show to ${test_node}"
+    if -n "$out" ; then
 	echo "Still there..."
 	if [ $(($count * $increment)) -ge $timeout ] ; then
 	    echo "BAD: Timed out waiting..."
diff --git a/ctdb/tests/complex/18_ctdb_reloadips.sh b/ctdb/tests/complex/18_ctdb_reloadips.sh
index e0632f30564..d6efc6bf631 100755
--- a/ctdb/tests/complex/18_ctdb_reloadips.sh
+++ b/ctdb/tests/complex/18_ctdb_reloadips.sh
@@ -51,12 +51,12 @@ select_test_node_and_ips
 
 echo "Getting public IP information from CTDB..."
 try_command_on_node any "$CTDB ip -X -v all"
-ctdb_ip_info=$(echo "$out" | awk -F'|' 'NR > 1 { print $2, $3, $5 }')
+ctdb_ip_info=$(awk -F'|' 'NR > 1 { print $2, $3, $5 }' "$outfile")
 
 echo "Getting IP information from interfaces..."
 try_command_on_node all "ip addr show"
-ip_addr_info=$(echo "$out" | \
-    awk '$1 == "inet" { ip = $2; sub(/\/.*/, "", ip); print ip }')
+ip_addr_info=$(awk '$1 == "inet" { ip = $2; sub(/\/.*/, "", ip); print ip }' \
+		   "$outfile")
 
 prefix=""
 for b in $(seq 0 255) ; do
@@ -171,7 +171,7 @@ check_ips ()
 
     try_command_on_node $test_node "ip addr show dev ${iface}"
     local ip_addrs_file=$(mktemp)
-    echo "$out" | \
+    cat "$outfile" | \
 	sed -n -e "s at .*inet * \(${prefix//./\.}\.[0-9]*\)/.*@\1 at p" | \
 	sort >"$ip_addrs_file"
 
@@ -187,6 +187,33 @@ check_ips ()
     fi
 }
 
+# ctdb reloadips will fail if it can't disable takover runs.  The most
+# likely reason for this is that there is already a takeover run in
+# progress.  We can't predict when this will happen, so retry if this
+# occurs.
+do_ctdb_reloadips ()
+{
+	local retry_max=10
+	local retry_count=0
+	while : ; do
+		if try_command_on_node "$test_node" "$CTDB reloadips" ; then
+			return 0
+		fi
+
+		if [ "$out" != "Failed to disable takeover runs" ] ; then
+			return 1
+		fi
+
+		if [ $retry_count -ge $retry_max ] ; then
+			return 1
+		fi
+
+		retry_count=$((retry_count + 1))
+		echo "Retrying..."
+		sleep_for 1
+	done
+}
+
 ####################
 
 new_ip_max=100
@@ -196,7 +223,7 @@ new_ip_max=100
 add_ips_to_original_config \
     $test_node "$addresses" "$iface" "$prefix" 1 $new_ip_max
 
-try_command_on_node $test_node "$CTDB reloadips"
+do_ctdb_reloadips
 
 check_ips $test_node "$iface" "$prefix" 1 $new_ip_max
 
@@ -210,7 +237,7 @@ echo "Using 'ctdb reloadips' to remove the 1st address just added..."
 add_ips_to_original_config \
     $test_node "$addresses" "$iface" "$prefix" 2 $new_ip_max
 
-try_command_on_node $test_node "$CTDB reloadips"
+do_ctdb_reloadips
 
 check_ips $test_node "$iface" "$prefix" 2 $new_ip_max
 
@@ -225,7 +252,7 @@ echo "Updating to include only about 1/2 of the new IPs..."
 add_ips_to_original_config \
     $test_node "$addresses" "$iface" "$prefix" $start $new_ip_max
 
-try_command_on_node $test_node "$CTDB reloadips"
+do_ctdb_reloadips
 
 check_ips $test_node "$iface" "$prefix" $start $new_ip_max
 
@@ -237,6 +264,6 @@ try_command_on_node any $CTDB sync
 echo "Restoring original IP configuration..."
 restore_public_addresses
 
-try_command_on_node $test_node "$CTDB reloadips"
+do_ctdb_reloadips
 
 check_ips $test_node "$iface" "$prefix" 0
diff --git a/ctdb/tests/complex/32_cifs_tickle.sh b/ctdb/tests/complex/32_cifs_tickle.sh
index 366824501da..ac00d449293 100755
--- a/ctdb/tests/complex/32_cifs_tickle.sh
+++ b/ctdb/tests/complex/32_cifs_tickle.sh
@@ -64,14 +64,6 @@ echo "Source socket is $src_socket"
 # we sometimes beat the registration.
 echo "Checking if CIFS connection is tracked by CTDB on test node..."
 wait_until 10 check_tickles $test_node $test_ip $test_port $src_socket
-echo "$out"
-
-if [ "${out/SRC: ${src_socket} /}" != "$out" ] ; then
-    echo "GOOD: CIFS connection tracked OK by CTDB."
-else
-    echo "BAD: Socket not tracked by CTDB."
-    testfailures=1
-fi
 
 # This is almost immediate.  However, it is sent between nodes
 # asynchonously, so it is worth checking...
diff --git a/ctdb/tests/complex/36_smb_reset_server.sh b/ctdb/tests/complex/36_smb_reset_server.sh
index beff1a22014..c55cb9f251e 100755
--- a/ctdb/tests/complex/36_smb_reset_server.sh
+++ b/ctdb/tests/complex/36_smb_reset_server.sh
@@ -62,16 +62,8 @@ echo "Source socket is $src_socket"
 
 # This should happen as soon as connection is up... but unless we wait
 # we sometimes beat the registration.
-echo "Checking if CIFS connection is tracked by CTDB on test node..."
+echo "Waiting until SMB connection is tracked by CTDB on test node..."
 wait_until 10 check_tickles $test_node $test_ip $test_port $src_socket
-echo "$out"
-
-if [ "${out/SRC: ${src_socket} /}" != "$out" ] ; then
-    echo "GOOD: CIFS connection tracked OK by CTDB."
-else
-    echo "BAD: Socket not tracked by CTDB."
-    exit 1
-fi
 
 # It would be nice if ss consistently used local/peer instead of src/dst
 ss_filter="src ${test_ip}:${test_port} dst ${src_socket}"
@@ -83,7 +75,7 @@ if [ -z "$out" ] ; then
 	exit 1
 fi
 echo "GOOD: ss lists the socket:"
-echo "$out"
+cat "$outfile"
 
 echo "Disabling node $test_node"
 try_command_on_node 1 $CTDB disable -n $test_node
diff --git a/ctdb/tests/complex/37_nfs_reset_server.sh b/ctdb/tests/complex/37_nfs_reset_server.sh
index 07bd034d6c7..e38d4510d49 100755
--- a/ctdb/tests/complex/37_nfs_reset_server.sh
+++ b/ctdb/tests/complex/37_nfs_reset_server.sh
@@ -63,7 +63,7 @@ echo "Source socket is $src_socket"
 echo "Wait until NFS connection is tracked by CTDB on test node ..."
 wait_until $((monitor_interval * 2)) \
 	   check_tickles $test_node $test_ip $test_port $src_socket
-echo "$out"
+cat "$outfile"
 
 # It would be nice if ss consistently used local/peer instead of src/dst
 ss_filter="src ${test_ip}:${test_port} dst ${src_socket}"
@@ -75,7 +75,7 @@ if [ -z "$out" ] ; then
 	exit 1
 fi
 echo "GOOD: ss lists the socket:"
-echo "$out"
+cat "$outfile"
 
 echo "Disabling node $test_node"
 try_command_on_node 1 $CTDB disable -n $test_node
diff --git a/ctdb/tests/complex/60_rogueip_releaseip.sh b/ctdb/tests/complex/60_rogueip_releaseip.sh
index 0daf289c83a..7e2f89a1e3b 100755
--- a/ctdb/tests/complex/60_rogueip_releaseip.sh
+++ b/ctdb/tests/complex/60_rogueip_releaseip.sh
@@ -34,7 +34,7 @@ for i in $all_pnns ; do
 		continue
 	fi
 	try_command_on_node $i "$CTDB ip"
-	n=$(awk -v ip="$test_ip" '$1 == ip { print }' <<<"$out")
+	n=$(awk -v ip="$test_ip" '$1 == ip { print }' "$outfile")
 	if [ -n "$n" ] ; then
 		other_node="$i"
 		break
diff --git a/ctdb/tests/complex/scripts/local.bash b/ctdb/tests/complex/scripts/local.bash
index 7787de8f111..787f597edcc 100644
--- a/ctdb/tests/complex/scripts/local.bash
+++ b/ctdb/tests/complex/scripts/local.bash
@@ -67,7 +67,7 @@ check_tickles ()
     local src_socket="$4"
     try_command_on_node $node ctdb gettickles $test_ip $test_port
     # SRC: 10.0.2.45:49091   DST: 10.0.2.143:445
-    [ "${out/SRC: ${src_socket} /}" != "$out" ]
+    grep -Fq "SRC: ${src_socket} " "$outfile"
 }
 
 check_tickles_all ()
@@ -79,8 +79,7 @@ check_tickles_all ()
 
     try_command_on_node all ctdb gettickles $test_ip $test_port
     # SRC: 10.0.2.45:49091   DST: 10.0.2.143:445
-    local t="${src_socket//./\\.}"
-    local count=$(grep -E -c "SRC: ${t} " <<<"$out" || true)
+    local count=$(grep -Fc "SRC: ${src_socket} " "$outfile" || true)
     [ $count -eq $numnodes ]
 }
 
diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh
index 8eead527b33..3c7e794d251 100755
--- a/ctdb/tests/run_tests.sh
+++ b/ctdb/tests/run_tests.sh
@@ -7,7 +7,7 @@ Usage: $0 [OPTIONS] [TESTS]
 Options:
   -A		Use "cat -A" to print test output (only some tests)
   -c		Run integration tests on a cluster
-  -C		Clean up - kill daemons and remove TEST_VAR_DIR when done
+  -C		Remove TEST_VAR_DIR when done
   -d		Print descriptions of tests instead of filenames (dodgy!)
   -D		Show diff between failed/expected test output (some tests only)
   -e		Exit on the first test failure
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash
index 3750c442eba..e0aa312192b 100644
--- a/ctdb/tests/scripts/integration.bash
+++ b/ctdb/tests/scripts/integration.bash
@@ -77,7 +77,20 @@ ctdb_test_init ()
 
 ########################################
 
-# Sets: $out
+# Sets: $out, $outfile
+# * The first 1KB of output is put into $out
+# * Tests should use $outfile for handling large output
+# * $outfile is removed after each test
+out=""
+outfile="${TEST_VAR_DIR}/try_command_on_node.out"
+
+outfile_cleanup ()
+{
+	rm -f "$outfile"
+}
+
+ctdb_test_exit_hook_add outfile_cleanup
+
 try_command_on_node ()
 {
     local nodespec="$1" ; shift
@@ -96,16 +109,19 @@ try_command_on_node ()
 
     local cmd="$*"
 
-    out=$(onnode -q $onnode_opts "$nodespec" "$cmd" 2>&1) || {
+    local status=0
+    onnode -q $onnode_opts "$nodespec" "$cmd" >"$outfile" 2>&1 || status=$?
+    out=$(dd if="$outfile" bs=1k count=1 2>/dev/null)
 
+    if [ $status -ne 0 ] ; then
 	echo "Failed to execute \"$cmd\" on node(s) \"$nodespec\""
-	echo "$out"
+	cat "$outfile"
 	return 1
-    }
+    fi
 
     if $verbose ; then
 	echo "Output of \"$cmd\":"
-	echo "$out"
+	cat "$outfile"
     fi
 }
 
@@ -113,11 +129,10 @@ sanity_check_output ()
 {
     local min_lines="$1"
     local regexp="$2" # Should be anchored as necessary.
-    local output="$3"
 
     local ret=0
 
-    local num_lines=$(echo "$output" | wc -l)
+    local num_lines=$(wc -l <"$outfile")
     echo "There are $num_lines lines of output"
     if [ $num_lines -lt $min_lines ] ; then
 	echo "BAD: that's less than the required number (${min_lines})"
@@ -126,7 +141,7 @@ sanity_check_output ()
 
     local status=0
     local unexpected # local doesn't pass through status of command on RHS.
-    unexpected=$(echo "$output" | egrep -v "$regexp") || status=$?
+    unexpected=$(grep -Ev "$regexp" "$outfile") || status=$?
 
     # Note that this is reversed.
     if [ $status -eq 0 ] ; then
@@ -140,30 +155,7 @@ sanity_check_output ()
     return $ret
 }
 
-sanity_check_ips ()
-{
-    local ips="$1" # list of "ip node" lines
-
-    echo "Sanity checking IPs..."
-
-    local x ipp prev
-    prev=""
-    while read x ipp ; do
-	[ "$ipp" = "-1" ] && break
-	if [ -n "$prev" -a "$ipp" != "$prev" ] ; then
-	    echo "OK"
-	    return 0
-	fi
-	prev="$ipp"
-    done <<<"$ips"
-
-    echo "BAD: a node was -1 or IPs are only assigned to one node:"
-    echo "$ips"
-    echo "Are you running an old version of CTDB?"
-    return 1
-}
-
-# This returns a list of "ip node" lines in $out
+# This returns a list of "ip node" lines in $outfile
 all_ips_on_node()
 {
     local node="$1"
@@ -184,9 +176,9 @@ _select_test_node_and_ips ()
 	    test_node="$pnn"
 	fi
 	if [ "$pnn" = "$test_node" ] ; then
-            test_node_ips="${test_node_ips}${test_node_ips:+ }${ip}"
+	    test_node_ips="${test_node_ips}${test_node_ips:+ }${ip}"
 	fi
-    done <<<"$out" # bashism to avoid problem setting variable in pipeline.
+    done <"$outfile"
 
     echo "Selected node ${test_node} with IPs: ${test_node_ips}."
     test_ip="${test_node_ips%% *}"


-- 
Samba Shared Repository



More information about the samba-cvs mailing list