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

Karolin Seeger kseeger at samba.org
Wed Jan 25 23:18:03 UTC 2017


The branch, v4-6-test has been updated
       via  d5eebe5 winbind: Don't add duplicate IDs in wbinfo -r
       via  4773e25 winbind: Fix a typo
       via  1166de1 s3/winbindd: fix invalid free
       via  6a87647 winbind: Fix CID 1398534 Dereference before null check
       via  8c49f54 winbind: Fix CID 1398530 Resource leak
       via  bfd0fb3 winbind: Fix CID 1398530 Resource leak
       via  f629f59 winbind: Fix CID 1398531 Resource leak
       via  ff102c9 winbind: Fix CID 1398533 Resource leak
       via  bd82056 winbind: Fix CID 1398533 Resource leak
       via  1a234f5 WHATSNEW: document winbind changes
       via  56e9090 vfs_default: unlock the right file in copy chunk
       via  479fd27 ctdb-tests: Add "13.per_ip_routing shutdown" test
       via  bcdf945 ctdb-scripts: Fix regression when cleaning up routing table IDs
       via  5319e50 ctdb-daemon: Remove stale eventd socket
       via  e3c4968 ctdb-scripts: Fix remaining uses of "ctdb gratiousarp"
       via  77a80b7 ctdb-tests: Add takeover helper tests with banned/disconnected nodes
       via  e733776 ctdb-takeover: Handle case where there are no RELEASE_IPs to send
       via  11841d3 ctdb-takeover: Known and available IP lists should be the same size as nodemap
       via  c331736 ctdb-common: Add wait_send/wait_recv to sock_daemon_funcs
       via  a13e48f ctdb-common: Avoid any processing after finishing tevent_req
       via  2930832 ctdb-common: Pass tevent_req to the computation sub-functions
       via  6b67083 ctdb-common: Use consistent naming for sock_daemon_run computation functions
       via  bc79bda ctdb-common: Correct name of sock_daemon_run_send/recv state structure
       via  bc8e36a ctdb-tests: Add robust mutex test
       via  f1c8b35 ctdb-locking: Explicitly unlock record/db in lock helper
       via  cb31b71 ctdb-locking: Remove support for locking multiple databases
       via  28ed3cd python/schema: fix tests flapping due to oid collision
      from  63b9e1c messaging: Fix dead but not cleaned-up-yet destination sockets

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


- Log -----------------------------------------------------------------
commit d5eebe5e7c3c1c037218de87cb92e2bc6509fa97
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jan 18 16:54:03 2017 +0100

    winbind: Don't add duplicate IDs in wbinfo -r
    
    We look at the netsamlogon_cache entry twice: Once in queryuser and
    once in lookupusergroups_cached. This can add the group SID twice.
    
    Use add_sid_to_array_unique to avoid this.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Jan 24 02:36:19 CET 2017 on sn-devel-144
    
    The last 9 patches address
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12538
    Backport winbind fixes.
    
    Autobuild-User(v4-6-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-6-test): Thu Jan 26 00:17:35 CET 2017 on sn-devel-144

commit 4773e25a5b206895aa8b8990097fc83bed0fceb5
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jan 13 07:33:24 2017 +0100

    winbind: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1166de1cb0e9e22f7f980844c773b475aa23973b
Author: Aurelien Aptel <aaptel at suse.com>
Date:   Tue Jan 17 14:39:03 2017 +0100

    s3/winbindd: fix invalid free
    
    coverity fix.
    
    TALLOC_FREE() might be called on uninitialized 'rids' at the end of the
    function in case of an early error. Initialize it to NULL to turn the
    TALLOC_FREE() to a noop in this case.
    
    Signed-off-by: Aurelien Aptel <aaptel at suse.com>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Wed Jan 18 17:19:39 CET 2017 on sn-devel-144

commit 6a8764730d0b8e0f1bcadea2d2df96d712969abb
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Jan 11 11:52:44 2017 -0800

    winbind: Fix CID 1398534 Dereference before null check
    
    Make all query_user_list backends consistent.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Fri Jan 13 13:33:37 CET 2017 on sn-devel-144

commit 8c49f5421ff76bdd25cdba73bd8dda844895b609
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jan 10 13:29:38 2017 +0000

    winbind: Fix CID 1398530 Resource leak
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Jan 11 04:38:25 CET 2017 on sn-devel-144

commit bfd0fb3b28427b84263f2939d5c4ca7492b74b36
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jan 10 13:28:41 2017 +0000

    winbind: Fix CID 1398530 Resource leak
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit f629f593fe161968947308c2b00f28e0692415cb
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jan 10 13:24:22 2017 +0000

    winbind: Fix CID 1398531 Resource leak
    
    Not really a leak due to talloc, but this way it's clear
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ff102c913512d2c5a998e8e252c913e94d6bf579
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jan 10 13:26:13 2017 +0000

    winbind: Fix CID 1398533 Resource leak
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit bd82056b336c3cb8ac2d6061c62244c82b2e9ce1
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jan 10 13:24:22 2017 +0000

    winbind: Fix CID 1398533 Resource leak
    
    Not really a leak due to talloc, but this way it's clear
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1a234f5037ce451470feb830e0d83005f7131616
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jan 25 08:32:39 2017 +0100

    WHATSNEW: document winbind changes
    
    Signed-off-by: Volker Lendecke <vl at samba.org>

commit 56e9090971e371cd1a8d0455cd34981a3069b965
Author: Björn Jacke <bj at sernet.de>
Date:   Thu Jan 19 21:51:41 2017 +0100

    vfs_default: unlock the right file in copy chunk
    
    Signed-off-by: Bjoern Jacke <bj at sernet.de>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    
    Autobuild-User(master): Björn Jacke <bj at sernet.de>
    Autobuild-Date(master): Sat Jan 21 17:00:54 CET 2017 on sn-devel-144
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12535
    
    (cherry picked from commit 5059c8e2e3a6159bc2917ddd80d09fab35b39e66)

commit 479fd27da459ca4dc24d6e4dd49cb3d1cf427cb6
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jan 16 11:08:51 2017 +1100

    ctdb-tests: Add "13.per_ip_routing shutdown" test
    
    Ensure that it doesn't mangle the rt_tables file.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12516
    
    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 Jan 17 06:02:23 CET 2017 on sn-devel-144
    
    (cherry picked from commit eaa508b82650197a7d473a24b3362e9e9c329937)

commit bcdf945c9e43f6eba5a9773b95fbf89fa835a116
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jan 16 07:24:15 2017 +1100

    ctdb-scripts: Fix regression when cleaning up routing table IDs
    
    Commit 0ca00267cd2620a14968961738bcd2a69b597e95 removed explicit
    continuations in strings for awk programs.  In one case this causes a
    disconnect between condition and action, where an implicit
    continuation does not work.  This results in duplicate lines in the
    rt_tables file.
    
    Move the opening brace for the action to make the implicit
    continuation work as expected.
    
    An alternative would be to revert the removal of the explicit
    continuations and add shellcheck tags.  However, that doesn't mean
    that an author of future code will necessarily use explicit
    continuations, so the same mistake might still be make in the future.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12516
    
    Reported-by: Barry Evans <bevans at pixitmedia.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit f9368f8e129cb32ee30cb6501a6fe728db37e1d5)

commit 5319e508dd5ea5df7b6454cbbf7530b31d665dfe
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Jan 13 16:00:45 2017 +1100

    ctdb-daemon: Remove stale eventd socket
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12513
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Tue Jan 17 15:00:15 CET 2017 on sn-devel-144

commit e3c4968b8299026f3c7ba6e9cd375bfbca50e23f
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jan 16 13:38:50 2017 +1100

    ctdb-scripts: Fix remaining uses of "ctdb gratiousarp"
    
    This changed to "ctdb gratarp" some time ago but the scripts were
    never updated.
    
    Fix the documentation for the ctdb tool too.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12512
    
    Reported-by: Ralph Böhme <slow at samba.org>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 5e00a6b346325f52e35b9785eaffd72239aebcf5)

commit 77a80b7caca76e4bfb960c033e22bfea0cca19dd
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jan 11 19:20:08 2017 +1100

    ctdb-tests: Add takeover helper tests with banned/disconnected nodes
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12511
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Thu Jan 12 23:11:28 CET 2017 on sn-devel-144
    
    (cherry picked from commit 4d8cba6f5db1851a738d74030b6b6a118c535c45)

commit e733776c689bcc3d8410b605f47281f64495a0f5
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jan 12 06:52:32 2017 +1100

    ctdb-takeover: Handle case where there are no RELEASE_IPs to send
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12511
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit a5b187202fa13661aec14cb9e4cbb3b93d4c33f6)

commit 11841d37b7771bfdcf1d3bd0f4335fa25174006e
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jan 11 16:49:33 2017 +1100

    ctdb-takeover: Known and available IP lists should be the same size as nodemap
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12511
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit b7cfac778e8813b22d29859102bab1598cdb5ff0)

commit c331736117b414901e6ef27f2f890179fcad6406
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jan 11 20:37:00 2017 +1100

    ctdb-common: Add wait_send/wait_recv to sock_daemon_funcs
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12510
    
    To be able to terminate the daemon from within the implementation,
    create a subreq using wait_send() provided by the implementation.
    When the subreq is finished, it signals the sock_daemon code to terminate
    the daemon.
    
    This avoids the need to keep track of the top level tevent_req causing
    layer violation and keeps the code flow straighforward.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Mon Jan 16 21:16:51 CET 2017 on sn-devel-144
    
    (cherry picked from commit ed722c3aa9690873af495cb467dd440c1a714d82)

commit a13e48f65342ea5b5832c86f00dd04320d96782a
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jan 11 19:54:36 2017 +1100

    ctdb-common: Avoid any processing after finishing tevent_req
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12510
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit d09469e575233242eab2a8c1c0767f52e7cad1e5)

commit 29308326b02ae4fb845e88411e7a6eb77532df70
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Jan 13 10:43:44 2017 +1100

    ctdb-common: Pass tevent_req to the computation sub-functions
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12510
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit d5be55725000eb34611dc76a2e8e7188eea2503f)

commit 6b67083045268797d142dc7377929adb08a87211
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Jan 13 10:40:43 2017 +1100

    ctdb-common: Use consistent naming for sock_daemon_run computation functions
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12510
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 31274cf7aec1bb26e8dac0dbd1b9a3fa799b2b85)

commit bc79bda3c53e71a6dea5d8d580c534bd96422329
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jan 11 19:50:34 2017 +1100

    ctdb-common: Correct name of sock_daemon_run_send/recv state structure
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12510
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 9e09a253b4ca1b5f9aa432c986c1755a173a9566)

commit bc8e36afc51c32497ddf893959d9fa831473d70b
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Dec 2 15:11:20 2016 +1100

    ctdb-tests: Add robust mutex test
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469
    
    This demonstrates robust mutex bug on linux/glibc system.
    
    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): Thu Jan 12 07:59:34 CET 2017 on sn-devel-144
    
    (cherry picked from commit 7794497bc909fa7b02da9d9ce1fc496a8fa2a9ae)

commit f1c8b354b4e01d3fac43fff3100572a5c3b57419
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Nov 29 17:20:45 2016 +1100

    ctdb-locking: Explicitly unlock record/db in lock helper
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469
    
    Instead of killing lock helper processes with SIGKILL, send SIGTERM so
    lock helper processes can explicitly unlock record/db.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 3a56a16b06cf6d1cce613ec29f5ea46630902072)

commit cb31b712073ca347caa506b22b319307a46159f1
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Nov 29 17:13:41 2016 +1100

    ctdb-locking: Remove support for locking multiple databases
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469
    
    The code to lock multiple databases has been dropped from ctdb_lock.c.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 5b1076dc61f5e3f006c1b8cef98e7d2d3cc1bfba)

commit 28ed3cd912d2cef284dba606407f83a9c62c204a
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Jan 10 10:00:43 2017 +1300

    python/schema: fix tests flapping due to oid collision
    
    These tests would sometimes fail because the randomly generated OIDs
    would collide. This fixes that by giving a unique OID to each attribute
    and class.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12507
    
    Pair-Programmed-With: Bob Campbell <bobcampbell at catalyst.net.nz>
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Jan 10 13:44:02 CET 2017 on sn-devel-144
    
    (cherry picked from commit 207fa2331831f570eb4855e98b676782d2008f34)

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

Summary of changes:
 WHATSNEW.txt                                     |  47 ++++
 ctdb/common/sock_daemon.c                        | 132 +++++++-----
 ctdb/common/sock_daemon.h                        |  14 +-
 ctdb/config/events.d/10.interface                |   4 +-
 ctdb/config/events.d/13.per_ip_routing           |   8 +-
 ctdb/config/events.d/91.lvs                      |   2 +-
 ctdb/doc/ctdb.1.xml                              |   4 +-
 ctdb/server/ctdb_lock.c                          |   6 +-
 ctdb/server/ctdb_lock_helper.c                   | 194 ++++++++++++++---
 ctdb/server/ctdb_takeover_helper.c               |  23 +-
 ctdb/server/eventscript.c                        |   9 +
 ctdb/tests/cunit/sock_daemon_test_001.sh         |   2 +
 ctdb/tests/eventscripts/13.per_ip_routing.024.sh |  31 +++
 ctdb/tests/eventscripts/stubs/ctdb               |   2 +-
 ctdb/tests/src/sock_daemon_test.c                | 175 +++++++++++----
 ctdb/tests/src/test_mutex_raw.c                  | 261 +++++++++++++++++++++++
 ctdb/tests/takeover_helper/{010.sh => 027.sh}    |  10 +-
 ctdb/tests/takeover_helper/{010.sh => 028.sh}    |  10 +-
 ctdb/wscript                                     |   8 +-
 source3/modules/vfs_default.c                    |   2 +-
 source3/winbindd/wb_gettoken.c                   |  81 ++++---
 source3/winbindd/wb_sids2xids.c                  |   2 +-
 source3/winbindd/winbindd_ads.c                  |  13 +-
 source3/winbindd/winbindd_cache.c                |   1 +
 source3/winbindd/winbindd_msrpc.c                |   3 +-
 source3/winbindd/winbindd_rpc.c                  |   1 +
 source3/winbindd/winbindd_samr.c                 |   7 +-
 source4/dsdb/tests/python/dsdb_schema_info.py    |  12 +-
 source4/dsdb/tests/python/ldap_schema.py         |  54 ++---
 source4/setup/schema_samba4.ldif                 |   4 +
 30 files changed, 877 insertions(+), 245 deletions(-)
 create mode 100755 ctdb/tests/eventscripts/13.per_ip_routing.024.sh
 create mode 100644 ctdb/tests/src/test_mutex_raw.c
 copy ctdb/tests/takeover_helper/{010.sh => 027.sh} (72%)
 copy ctdb/tests/takeover_helper/{010.sh => 028.sh} (72%)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 7795523..c040bd8 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -174,6 +174,53 @@ CTDB changes
   To build/install these, use the --enable-etcd-reclock and
   --enable-ceph-reclock configure options.
 
+winbind changes
+---------------
+
+4.6 winbind simplifies the calculation of supplementary groups to make
+it more reliable and predictable. Before 4.6, winbind contained code
+that tried to emulate the group membership calculation that domain
+controllers do when a user logs in. This group membership calculation
+is a very complex process, in particular for domain trust relationship
+situations. Also, in many scenarios it is impossible for winbind to
+correctly do this calculation due to access restrictions in the
+domains: winbind using its machine account simply does not have the
+rights to ask for an arbitrary user's group memberships.
+
+When a user logs in to a Samba server, the domain controller correctly
+calculates the user's group memberships authoritatively and makes the
+information available to the Samba server. This is the only reliable
+way Samba can get informed about the groups a user is member of.
+
+Because of its flakiness, the fallback group membership code was
+removed.
+
+This means that "id <username>" without the user having logged in
+previously stops showing any supplementary groups. Also, it will show
+"DOMAIN\Domain Users" as the primary group. Once the user has logged
+in, "id <username>" will correctly show the primary group and
+supplementary group list.
+
+winbind primary group and nss info
+----------------------------------
+
+With 4.6, it will be possible to optionally use the primary group as
+set in the "Unix Attributes" tab for the local unix token of a domain
+user.  Before 4.6, the Windows primary group was always chosen as
+primary group for the local unix token.
+
+To activate the unix primary group, set
+
+idmap config <DOMAIN> : unix_primary_group = yes
+
+Similarly, set
+
+idmap config <DOMAIN> : unix_nss_info = yes
+
+to retrieve the home directory and login shell from the "Unix
+Attributes" of the user. This supersedes the "winbind nss info"
+parameter with a per-domain configuration option.
+
 
 smb.conf changes
 ================
diff --git a/ctdb/common/sock_daemon.c b/ctdb/common/sock_daemon.c
index ca4086d..b53b4d8 100644
--- a/ctdb/common/sock_daemon.c
+++ b/ctdb/common/sock_daemon.c
@@ -70,7 +70,6 @@ struct sock_daemon_context {
 
 	struct pidfile_context *pid_ctx;
 	struct sock_socket *socket_list;
-	struct tevent_req *req;
 };
 
 /*
@@ -451,8 +450,6 @@ bool sock_socket_write_recv(struct tevent_req *req, int *perr)
  * Socket daemon
  */
 
-static int sock_daemon_context_destructor(struct sock_daemon_context *sockd);
-
 int sock_daemon_setup(TALLOC_CTX *mem_ctx, const char *daemon_name,
 		      const char *logging, const char *debug_level,
 		      const char *pidfile,
@@ -487,21 +484,10 @@ int sock_daemon_setup(TALLOC_CTX *mem_ctx, const char *daemon_name,
 		}
 	}
 
-	talloc_set_destructor(sockd, sock_daemon_context_destructor);
-
 	*out = sockd;
 	return 0;
 }
 
-static int sock_daemon_context_destructor(struct sock_daemon_context *sockd)
-{
-	if (sockd->req != NULL) {
-		tevent_req_done(sockd->req);
-	}
-
-	return 0;
-}
-
 int sock_daemon_add_unix(struct sock_daemon_context *sockd,
 			 const char *sockpath,
 			 struct sock_socket_funcs *funcs,
@@ -529,7 +515,7 @@ int sock_daemon_add_unix(struct sock_daemon_context *sockd,
  * Run socket daemon
  */
 
-struct sock_daemon_start_state {
+struct sock_daemon_run_state {
 	struct tevent_context *ev;
 	struct sock_daemon_context *sockd;
 	pid_t pid_watch;
@@ -537,15 +523,16 @@ struct sock_daemon_start_state {
 	int fd;
 };
 
-static void sock_daemon_started(struct tevent_req *subreq);
-static void sock_daemon_signal_handler(struct tevent_context *ev,
-				       struct tevent_signal *se,
-				       int signum, int count, void *siginfo,
-				       void *private_data);
-static void sock_daemon_socket_fail(struct tevent_req *subreq);
-static void sock_daemon_watch_pid(struct tevent_req *subreq);
-static void sock_daemon_reconfigure(struct sock_daemon_start_state *state);
-static void sock_daemon_shutdown(struct sock_daemon_start_state *state);
+static void sock_daemon_run_started(struct tevent_req *subreq);
+static void sock_daemon_run_signal_handler(struct tevent_context *ev,
+					   struct tevent_signal *se,
+					   int signum, int count, void *siginfo,
+					   void *private_data);
+static void sock_daemon_run_reconfigure(struct tevent_req *req);
+static void sock_daemon_run_shutdown(struct tevent_req *req);
+static void sock_daemon_run_socket_fail(struct tevent_req *subreq);
+static void sock_daemon_run_watch_pid(struct tevent_req *subreq);
+static void sock_daemon_run_wait_done(struct tevent_req *subreq);
 
 struct tevent_req *sock_daemon_run_send(TALLOC_CTX *mem_ctx,
 					struct tevent_context *ev,
@@ -553,12 +540,12 @@ struct tevent_req *sock_daemon_run_send(TALLOC_CTX *mem_ctx,
 					pid_t pid_watch)
 {
 	struct tevent_req *req, *subreq;
-	struct sock_daemon_start_state *state;
+	struct sock_daemon_run_state *state;
 	struct tevent_signal *se;
 	struct sock_socket *sock;
 
 	req = tevent_req_create(mem_ctx, &state,
-				struct sock_daemon_start_state);
+				struct sock_daemon_run_state);
 	if (req == NULL) {
 		return NULL;
 	}
@@ -573,28 +560,28 @@ struct tevent_req *sock_daemon_run_send(TALLOC_CTX *mem_ctx,
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
 	}
-	tevent_req_set_callback(subreq, sock_daemon_started, req);
+	tevent_req_set_callback(subreq, sock_daemon_run_started, req);
 
 	se = tevent_add_signal(ev, state, SIGHUP, 0,
-			       sock_daemon_signal_handler, req);
+			       sock_daemon_run_signal_handler, req);
 	if (tevent_req_nomem(se, req)) {
 		return tevent_req_post(req, ev);
 	}
 
 	se = tevent_add_signal(ev, state, SIGUSR1, 0,
-			       sock_daemon_signal_handler, req);
+			       sock_daemon_run_signal_handler, req);
 	if (tevent_req_nomem(se, req)) {
 		return tevent_req_post(req, ev);
 	}
 
 	se = tevent_add_signal(ev, state, SIGINT, 0,
-			       sock_daemon_signal_handler, req);
+			       sock_daemon_run_signal_handler, req);
 	if (tevent_req_nomem(se, req)) {
 		return tevent_req_post(req, ev);
 	}
 
 	se = tevent_add_signal(ev, state, SIGTERM, 0,
-			       sock_daemon_signal_handler, req);
+			       sock_daemon_run_signal_handler, req);
 	if (tevent_req_nomem(se, req)) {
 		return tevent_req_post(req, ev);
 	}
@@ -604,7 +591,8 @@ struct tevent_req *sock_daemon_run_send(TALLOC_CTX *mem_ctx,
 		if (tevent_req_nomem(subreq, req)) {
 			return tevent_req_post(req, ev);
 		}
-		tevent_req_set_callback(subreq, sock_daemon_socket_fail, req);
+		tevent_req_set_callback(subreq, sock_daemon_run_socket_fail,
+					req);
 
 		sock->req = subreq;
 	}
@@ -615,20 +603,30 @@ struct tevent_req *sock_daemon_run_send(TALLOC_CTX *mem_ctx,
 		if (tevent_req_nomem(subreq, req)) {
 			return tevent_req_post(req, ev);
 		}
-		tevent_req_set_callback(subreq, sock_daemon_watch_pid, req);
+		tevent_req_set_callback(subreq, sock_daemon_run_watch_pid,
+					req);
 	}
 
-	sockd->req = req;
+	if (sockd->funcs != NULL && sockd->funcs->wait_send != NULL &&
+	    sockd->funcs->wait_recv != NULL) {
+		subreq = sockd->funcs->wait_send(state, ev,
+						 sockd->private_data);
+		if (tevent_req_nomem(subreq, req)) {
+			return tevent_req_post(req, ev);
+		}
+		tevent_req_set_callback(subreq, sock_daemon_run_wait_done,
+					req);
+	}
 
 	return req;
 }
 
-static void sock_daemon_started(struct tevent_req *subreq)
+static void sock_daemon_run_started(struct tevent_req *subreq)
 {
 	struct tevent_req *req = tevent_req_callback_data(
 		subreq, struct tevent_req);
-	struct sock_daemon_start_state *state = tevent_req_data(
-		req, struct sock_daemon_start_state);
+	struct sock_daemon_run_state *state = tevent_req_data(
+		req, struct sock_daemon_run_state);
 	struct sock_daemon_context *sockd = state->sockd;
 
 	D_NOTICE("daemon started, pid=%u\n", getpid());
@@ -638,31 +636,31 @@ static void sock_daemon_started(struct tevent_req *subreq)
 	}
 }
 
-static void sock_daemon_signal_handler(struct tevent_context *ev,
-				       struct tevent_signal *se,
-				       int signum, int count, void *siginfo,
-				       void *private_data)
+static void sock_daemon_run_signal_handler(struct tevent_context *ev,
+					   struct tevent_signal *se,
+					   int signum, int count, void *siginfo,
+					   void *private_data)
 {
 	struct tevent_req *req = talloc_get_type_abort(
 		private_data, struct tevent_req);
-	struct sock_daemon_start_state *state = tevent_req_data(
-		req, struct sock_daemon_start_state);
 
 	D_NOTICE("Received signal %d\n", signum);
 
 	if (signum == SIGHUP || signum == SIGUSR1) {
-		sock_daemon_reconfigure(state);
+		sock_daemon_run_reconfigure(req);
 		return;
 	}
 
 	if (signum == SIGINT || signum == SIGTERM) {
-		sock_daemon_shutdown(state);
+		sock_daemon_run_shutdown(req);
 		tevent_req_error(req, EINTR);
 	}
 }
 
-static void sock_daemon_reconfigure(struct sock_daemon_start_state *state)
+static void sock_daemon_run_reconfigure(struct tevent_req *req)
 {
+	struct sock_daemon_run_state *state = tevent_req_data(
+		req, struct sock_daemon_run_state);
 	struct sock_daemon_context *sockd = state->sockd;
 
 	if (sockd->funcs != NULL && sockd->funcs->reconfigure != NULL) {
@@ -670,8 +668,10 @@ static void sock_daemon_reconfigure(struct sock_daemon_start_state *state)
 	}
 }
 
-static void sock_daemon_shutdown(struct sock_daemon_start_state *state)
+static void sock_daemon_run_shutdown(struct tevent_req *req)
 {
+	struct sock_daemon_run_state *state = tevent_req_data(
+		req, struct sock_daemon_run_state);
 	struct sock_daemon_context *sockd = state->sockd;
 	struct sock_socket *sock;
 
@@ -690,32 +690,29 @@ static void sock_daemon_shutdown(struct sock_daemon_start_state *state)
 	TALLOC_FREE(sockd->pid_ctx);
 }
 
-static void sock_daemon_socket_fail(struct tevent_req *subreq)
+static void sock_daemon_run_socket_fail(struct tevent_req *subreq)
 {
 	struct tevent_req *req = tevent_req_callback_data(
 		subreq, struct tevent_req);
-	struct sock_daemon_start_state *state = tevent_req_data(
-		req, struct sock_daemon_start_state);
 	int ret = 0;
 	bool status;
 
 	status = sock_socket_start_recv(subreq, &ret);
 	TALLOC_FREE(subreq);
+	sock_daemon_run_shutdown(req);
 	if (! status) {
 		tevent_req_error(req, ret);
 	} else {
 		tevent_req_done(req);
 	}
-
-	sock_daemon_shutdown(state);
 }
 
-static void sock_daemon_watch_pid(struct tevent_req *subreq)
+static void sock_daemon_run_watch_pid(struct tevent_req *subreq)
 {
 	struct tevent_req *req = tevent_req_callback_data(
 		subreq, struct tevent_req);
-	struct sock_daemon_start_state *state = tevent_req_data(
-		req, struct sock_daemon_start_state);
+	struct sock_daemon_run_state *state = tevent_req_data(
+		req, struct sock_daemon_run_state);
 	int ret;
 	bool status;
 
@@ -730,7 +727,7 @@ static void sock_daemon_watch_pid(struct tevent_req *subreq)
 	if (ret == -1) {
 		if (errno == ESRCH) {
 			D_ERR("PID %d gone away, exiting\n", state->pid_watch);
-			sock_daemon_shutdown(state);
+			sock_daemon_run_shutdown(req);
 			tevent_req_error(req, ESRCH);
 			return;
 		} else {
@@ -744,7 +741,27 @@ static void sock_daemon_watch_pid(struct tevent_req *subreq)
 	if (tevent_req_nomem(subreq, req)) {
 		return;
 	}
-	tevent_req_set_callback(subreq, sock_daemon_watch_pid, req);
+	tevent_req_set_callback(subreq, sock_daemon_run_watch_pid, req);
+}
+
+static void sock_daemon_run_wait_done(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct sock_daemon_run_state *state = tevent_req_data(
+		req, struct sock_daemon_run_state);
+	struct sock_daemon_context *sockd = state->sockd;
+	int ret;
+	bool status;
+
+	status = sockd->funcs->wait_recv(subreq, &ret);
+	TALLOC_FREE(subreq);
+	sock_daemon_run_shutdown(req);
+	if (! status) {
+		tevent_req_error(req, ret);
+	} else {
+		tevent_req_done(req);
+	}
 }
 
 bool sock_daemon_run_recv(struct tevent_req *req, int *perr)
@@ -777,7 +794,6 @@ int sock_daemon_run(struct tevent_context *ev,
 	tevent_req_poll(req, ev);
 
 	status = sock_daemon_run_recv(req, &ret);
-	sockd->req = NULL;
 	TALLOC_FREE(req);
 	if (! status) {
 		return ret;
diff --git a/ctdb/common/sock_daemon.h b/ctdb/common/sock_daemon.h
index 6c474ac..81853f6 100644
--- a/ctdb/common/sock_daemon.h
+++ b/ctdb/common/sock_daemon.h
@@ -50,12 +50,24 @@ struct sock_client_context;
  * startup() is called when the daemon starts running
  *            either via sock_daemon_run() or via sock_daemon_run_send()
  * reconfigure() is called when process receives SIGUSR1 or SIGHUP
- * shutdown() is called when process receives SIGINT or SIGTERM
+ * shutdown() is called when process receives SIGINT or SIGTERM or
+ *             when wait computation has finished
+ *
+ * wait_send() starts the async computation to keep running the daemon
+ * wait_recv() ends the async computation to keep running the daemon
+ *
+ * If wait_send()/wait_recv() is NULL, then daemon will keep running forever.
+ * If wait_send() returns req, then when req is over, daemon will shutdown.
  */
 struct sock_daemon_funcs {
 	void (*startup)(void *private_data);
 	void (*reconfigure)(void *private_data);
 	void (*shutdown)(void *private_data);
+
+	struct tevent_req * (*wait_send)(TALLOC_CTX *mem_ctx,
+					 struct tevent_context *ev,
+					 void *private_data);
+	bool (*wait_recv)(struct tevent_req *req, int *perr);
 };
 
 /**
diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface
index 073bc85..97227e8 100755
--- a/ctdb/config/events.d/10.interface
+++ b/ctdb/config/events.d/10.interface
@@ -215,7 +215,7 @@ updateip)
 	# 2) remove the IP from the old interface (and new interface, to be sure)
 	# 3) add the IP to the new interface
 	# 4) remove the firewall rule
-	# 5) use ctdb gratiousarp to propagate the new mac address
+	# 5) use ctdb gratarp to propagate the new mac address
 	# 6) use netstat -tn to find existing connections, and tickle them
 	_oiface=$2
 	niface=$3
@@ -247,7 +247,7 @@ updateip)
 	flush_route_cache
 
 	# propagate the new mac address
-	$CTDB gratiousarp "$ip" "$niface"
+	$CTDB gratarp "$ip" "$niface"
 
 	# tickle all existing connections, so that dropped packets
 	# are retransmited and the tcp streams work
diff --git a/ctdb/config/events.d/13.per_ip_routing b/ctdb/config/events.d/13.per_ip_routing
index c4b2535..4fff73b 100755
--- a/ctdb/config/events.d/13.per_ip_routing
+++ b/ctdb/config/events.d/13.per_ip_routing
@@ -184,8 +184,8 @@ clean_up_table_ids ()
 	    -v pre="$table_id_prefix" \
 	    '/^#/ ||
 	     !(min <= $1 && $1 <= max) &&
-	     !(index($2, pre) == 1)
-	     { print $0 }' "$rt_tables" >"$_tmp"
+	     !(index($2, pre) == 1) {
+		print $0 }' "$rt_tables" >"$_tmp"
 
 	mv "$_tmp" "$rt_tables"
     ) 9>"$rt_tables_lock"
@@ -396,7 +396,7 @@ takeip)
 	# flush our route cache
 	set_proc sys/net/ipv4/route/flush 1
 
-	$CTDB gratiousarp "$ip" "$iface"
+	$CTDB gratarp "$ip" "$iface"
 	;;
 
 updateip)
@@ -414,7 +414,7 @@ updateip)
 	# flush our route cache
 	set_proc sys/net/ipv4/route/flush 1
 
-	$CTDB gratiousarp "$ip" "$niface"
+	$CTDB gratarp "$ip" "$niface"
 	tickle_tcp_connections "$ip"
 	;;
 
diff --git a/ctdb/config/events.d/91.lvs b/ctdb/config/events.d/91.lvs
index 052b509..9725ee8 100755
--- a/ctdb/config/events.d/91.lvs
+++ b/ctdb/config/events.d/91.lvs
@@ -110,7 +110,7 @@ ipreallocated)
 	ipvsadm -a -t "$CTDB_LVS_PUBLIC_IP" -r 127.0.0.1
 	ipvsadm -a -u "$CTDB_LVS_PUBLIC_IP" -r 127.0.0.1
 
-	$CTDB gratiousarp \
+	$CTDB gratarp \
 	     "$CTDB_LVS_PUBLIC_IP" "$CTDB_LVS_PUBLIC_IFACE" >/dev/null 2>&1
 
 	flush_route_cache
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 1d6979a..f24f8dd 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -1479,9 +1479,9 @@ dbid:0xb775fff6 name:secrets.tdb path:/usr/local/var/lib/ctdb/persistent/secrets
     </refsect2>
 
     <refsect2>
-      <title>gratiousarp <parameter>IPADDR</parameter> <parameter>INTERFACE</parameter></title>
+      <title>gratarp <parameter>IPADDR</parameter> <parameter>INTERFACE</parameter></title>
       <para>
-	Send out a gratious ARP for the specified interface through
+	Send out a gratuitous ARP for the specified interface through
 	the specified interface. This command is mainly used by the
 	ctdb eventscripts.
       </para>
diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c
index 0203369..b2c6d15 100644
--- a/ctdb/server/ctdb_lock.c
+++ b/ctdb/server/ctdb_lock.c
@@ -192,7 +192,7 @@ static int ctdb_lock_context_destructor(struct lock_context *lock_ctx)
 		lock_ctx->request->lctx = NULL;
 	}
 	if (lock_ctx->child > 0) {
-		ctdb_kill(lock_ctx->ctdb, lock_ctx->child, SIGKILL);
+		ctdb_kill(lock_ctx->ctdb, lock_ctx->child, SIGTERM);
 		if (lock_ctx->type == LOCK_RECORD) {
 			DLIST_REMOVE(lock_ctx->ctdb_db->lock_current, lock_ctx);
 		} else {
@@ -683,7 +683,7 @@ static void ctdb_lock_schedule(struct ctdb_context *ctdb)
 					    ctdb_lock_timeout_handler,
 					    (void *)lock_ctx);
 	if (lock_ctx->ttimer == NULL) {
-		ctdb_kill(ctdb, lock_ctx->child, SIGKILL);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list