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

Karolin Seeger kseeger at samba.org
Thu Aug 8 11:21:04 UTC 2019


The branch, v4-9-test has been updated
       via  2627724e1b2 Revert "s3:messages: protect against usage of wrapper tevent_context objects for messaging"
       via  5a3fa18389b Revert "s3:messages: allow messaging_{dgm,ctdb}_register_tevent_context() to use wrapper tevent_context"
       via  a4ad9d6e7cf Revert "s3:messages: allow messaging_dgm_ref() to use wrapper tevent_context"
       via  116c4a79456 Revert "s3:messages: allow messaging_filtered_read_send() to use wrapper tevent_context"
       via  9daacf18383 Revert "s4:messaging: make sure only imessaging_client_init() can be used with a wrapper tevent_context wrapper"
       via  de909ff8860 ctdb-config: depend on /etc/ctdb/nodes file
       via  97727eefe49 vfs_catia: pass stat info to synthetic_smb_fname()
       via  db44860c93d samba-tool: add 'import samba.drs_utils' to fsmo.py
       via  f1eeb8e63af samba-tool: use only one LDAP modify for dns partition fsmo role transfer
       via  8fb77c2d1c8 s4:torture:fsmo.py: remove unused 'net_cmd' variable
       via  6b9d7481fe8 samba-tool: fix replication after dns partition fsmo role transfer
       via  cf5002e0345 s4:torture:fsmo.py: test role transfers of dns partitions
       via  043675f3a0c dnsp.idl: fix payload for DSPROPERTY_ZONE_DELETED_FROM_HOSTNAME
       via  8ce25bdb054 dnsp.idl: fix the dnsp_dns_addr_array definition
       via  b59569126d9 dnsp.idl: fix dnsp_ip4_array definition
       via  d9b747c0ca0 s4:torture: add local.ndr.dnsp tests
       via  4fd604b1657 dbcheck: fallback to the default tombstoneLifetime of 180 days
       via  9af7a1ccb33 lib/util: remove unused prototypes in debug.h
       via  bdc11a6b825 lib/util: fix call to dbghdrclass() for DEBUGC()
      from  f7a5adf0256 s4/libnet: Fix joining a Windows pre-2008R2 DC

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


- Log -----------------------------------------------------------------
commit 2627724e1b2bba9f814c4a7dd767b878d5371291
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 27 12:48:30 2018 +0100

    Revert "s3:messages: protect against usage of wrapper tevent_context objects for messaging"
    
    This reverts commit 7f2afc20e1b6397c364a98d1be006377c95e4665.
    
    See the discussion in
    
    https://lists.samba.org/archive/samba-technical/2018-December/131731.html
    
    for the reasoning behind this revert.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14033
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 2a62a98f5c7107f2f83c0bfc2892243d83e2c88a)
    
    Autobuild-User(v4-9-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-9-test): Thu Aug  8 11:20:26 UTC 2019 on sn-devel-144

commit 5a3fa18389b76bb31541e8b93de8353fa6b548d7
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 27 12:45:42 2018 +0100

    Revert "s3:messages: allow messaging_{dgm,ctdb}_register_tevent_context() to use wrapper tevent_context"
    
    This reverts commit 660cf86639753edaa7a7a21a5b5ae207ae7d4260.
    
    See the discussion in
    
    https://lists.samba.org/archive/samba-technical/2018-December/131731.html
    
    for the reasoning behind this revert.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14033
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 1c3676f3aa9c1564eb140a24ced5ee72b859b87f)

commit a4ad9d6e7cfdd1be1ea71f08ce5b6c404260281e
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 27 12:45:28 2018 +0100

    Revert "s3:messages: allow messaging_dgm_ref() to use wrapper tevent_context"
    
    This reverts commit 9dc332060cf5f249ea887dbc60ec7a39b6f91120.
    
    See the discussion in
    
    https://lists.samba.org/archive/samba-technical/2018-December/131731.html
    
    for the reasoning behind this revert.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14033
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 26107832cd9d200fb171ef1f991d7ef5478cac18)

commit 116c4a79456c235980813f2d4ea732188ebf42b3
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 27 12:45:15 2018 +0100

    Revert "s3:messages: allow messaging_filtered_read_send() to use wrapper tevent_context"
    
    This reverts commit 2b05f1098187e00166649c8ea7c63e6901b9d242.
    
    See the discussion in
    
    https://lists.samba.org/archive/samba-technical/2018-December/131731.html
    
    for the reasoning behind this revert.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14033
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit e2a5272ac6831b407a0c51bb8615252ec68be6a8)

commit 9daacf183831851f4f33fa075dbabf4a99566323
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 27 12:41:25 2018 +0100

    Revert "s4:messaging: make sure only imessaging_client_init() can be used with a wrapper tevent_context wrapper"
    
    This reverts commit e186d6a06b1b300256a2cb4138f0532d518d0597.
    
    See the discussion in
    
    https://lists.samba.org/archive/samba-technical/2018-December/131731.html
    
    for the reasoning behind this revert.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14033
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 0bd10a48e4c08d1eb3a20e79d952b3c0f12be46a)

commit de909ff88609c33bdfbc9f679753a37e5467b07e
Author: Rafael David Tinoco <rafaeldtinoco at ubuntu.com>
Date:   Thu Jun 27 20:12:25 2019 +0000

    ctdb-config: depend on /etc/ctdb/nodes file
    
    CTDB should start as a disabled unit (systemd) in most of the
    distributions and, when trying to enable it for the first time, user
    should get an unconfigured, or similar, error.
    
    Depending on /etc/ctdb/nodes file will give a clear direction to final
    user on what is needed in order to get cluster up and running. It should
    work like previous ENABLED=NO variables in SySV like initialization
    scripts.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14017
    RN: ctdb.service should only start if /etc/ctdb/nodes is not empty
    Signed-off-by: Rafael David Tinoco <rafaeldtinoco at ubuntu.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit c5803507df7def388edcd5b6cbfee30cd217b536)

commit 97727eefe494d707ec4c652bda4293ccce957da2
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Jun 27 12:50:37 2019 +0200

    vfs_catia: pass stat info to synthetic_smb_fname()
    
    This doesn't cause visible damage in vanilla Samba, but would affect downstream
    consumers that add additional fields to struct smb_filename.
    
    For the same reason there's no test.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14015
    RN: Ensure vfs_catia passes stat info to stacked VFS modules
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit ae6dd4853e3e651f6e56ce735bcb0a2264857385)

commit db44860c93d09c89352f578238c038437287a662
Author: Björn Baumbach <bb at sernet.de>
Date:   Tue May 28 14:52:36 2019 +0200

    samba-tool: add 'import samba.drs_utils' to fsmo.py
    
    On some systems we're seeing this:
    
     ERROR(<type 'exceptions.AttributeError'>): uncaught exception - 'module' object has no attribute 'drs_utils'
       File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 185, in _run
         return self.run(*args, **kwargs)
       File "/usr/lib/python2.7/dist-packages/samba/netcmd/fsmo.py", line 533, in run
         transfer_dns_role(self.outf, sambaopts, credopts, role, samdb)
       File "/usr/lib/python2.7/dist-packages/samba/netcmd/fsmo.py", line 136, in transfer_dns_role
         except samba.drs_utils.drsException as e:
    
    E.g. it happens on debian stretch (9.9) with python 2.7.13 (on 4.10.4)
    
    While it doesn't happen on ubuntu 18.04 with python 2.7.15rc1 or
    with python 3.6.7.
    
    There were also some reports on the mailing lists, see:
    https://lists.samba.org/archive/samba-technical/2019-May/133624.html
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Björn Baumbach <bbaumbach at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu May 30 08:27:24 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 320a5c5425e6ced18b1a9bf19b4f361ee16821ed)

commit f1eeb8e63afa6c9a5bec69d25820a44d01539d88
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue May 28 14:54:19 2019 +0200

    samba-tool: use only one LDAP modify for dns partition fsmo role transfer
    
    We should not risk that we end with no role owner.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (similar to commit 6a2e3a15585086bcceb18283216978a2fcb30da3)

commit 8fb77c2d1c8796664b26c804aff17821a83f96b5
Author: Björn Baumbach <bb at sernet.de>
Date:   Tue May 28 14:57:15 2019 +0200

    s4:torture:fsmo.py: remove unused 'net_cmd' variable
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973
    
    Signed-off-by: Björn Baumbach <bbaumbach at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 0fbb013bef886e425602fdbbef14a4029719818f)

commit 6b9d7481fe8bc365e0e5d7549f1845724130eaa9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue May 28 14:53:09 2019 +0200

    samba-tool: fix replication after dns partition fsmo role transfer
    
    The new role owner need to replicate from the old role owner.
    
    Before we told the old role owner to replicate from itself.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 4793f8ed584a4e6d8a26b06b691ec636e77d8f2a)

commit cf5002e0345152d46439bf96a32085e5df4ba6f1
Author: Björn Baumbach <bb at sernet.de>
Date:   Fri May 24 15:46:17 2019 +0200

    s4:torture:fsmo.py: test role transfers of dns partitions
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Björn Baumbach <bbaumbach at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 5e000a8487d788dd196980b77ec7299c8be74abf)

commit 043675f3a0c93b4b916e2b944d5221c11972deac
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri May 24 18:36:48 2019 +0200

    dnsp.idl: fix payload for DSPROPERTY_ZONE_DELETED_FROM_HOSTNAME
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13969
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Fri Jun 21 11:02:21 UTC 2019 on sn-devel-184
    
    (cherry picked from commit aa2a3d95098231f48d7c308881bf66418164111e)

commit 8ce25bdb054cad26c401ce6173a88aadc35a99df
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 30 14:21:22 2019 +0200

    dnsp.idl: fix the dnsp_dns_addr_array definition
    
    The endian changes are needed in order to get the following result
    from the blobs Windows generated (see the torture test):
    
      AddrArray: ARRAY(3)
          AddrArray: struct dnsp_dns_addr
              family                   : 0x0002 (2)
              port                     : 0x0035 (53)
              ipv4                     : 172.31.99.33
              ipv6                     : 0000:0000:0000:0000:0000:0000:0000:0000
    
    [MS-DNSP] states that the port is supposed to be ignored, but it's still
    good to decode it as port '53' (0x0035) instead of '13568' (0x3500).
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13969
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    (cherry picked from commit 6fc7cc15048673d109042d7b40684ed63eb4ff9e)

commit b59569126d9faca34beda91809af1d8429a55e6b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 30 10:07:51 2019 +0200

    dnsp.idl: fix dnsp_ip4_array definition
    
    In future we should use ipv4address, but that would result in a much
    larger change.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13969
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    (cherry picked from commit 6d958af0b4cb6fd45cfda0298243859b3b043c6f)

commit d9b747c0ca0e7a3111a53f051543b0f30cee4e05
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri May 24 17:39:17 2019 +0200

    s4:torture: add local.ndr.dnsp tests
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13969
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    (cherry picked from commit 9a0c3a475f29138c0c49e0d22cf52ab45178d16b)

commit 4fd604b1657503a9d3d494f50f40a566314c08e6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Apr 29 11:59:50 2019 +0200

    dbcheck: fallback to the default tombstoneLifetime of 180 days
    
    If a domain was provisioned by Windows 2000 this value is missing in the
    database.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13967
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue May 28 08:32:10 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 2ef79a4c1d695a3e498b142810a1317d85b9b6da)

commit 9af7a1ccb3307f3f07df8200e95209c96cb1c978
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Apr 26 13:32:43 2019 +0200

    lib/util: remove unused prototypes in debug.h
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13915
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit d98a971247450d494c581c5454e6c270ad1b6880)

commit bdc11a6b825f7965d685235af2c60bc1cfdc080f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Apr 26 13:21:15 2019 +0200

    lib/util: fix call to dbghdrclass() for DEBUGC()
    
    dbghdrclass() sets the global 'current_msg_class' and for that
    DEBUGC() should pass the given dbgc_class instead of the per file
    DBGC_CLASS.
    
    This is important with the new per class logfile with:
    
     log level = 1 dsdb_audit:10@/var/log/samba/log.dsdb_audit
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13915
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (similar to commit bb0ffbf38cb1955c9e400003add680eabcf706a6)

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

Summary of changes:
 ctdb/config/ctdb.service                           |   1 +
 lib/util/debug.h                                   |   4 +-
 librpc/idl/dnsp.idl                                |   9 +-
 python/samba/dbchecker.py                          |   5 +-
 python/samba/netcmd/fsmo.py                        |  27 +-
 source3/lib/messages.c                             |  37 +--
 source3/lib/messages_ctdb.c                        |  30 +-
 source3/lib/messages_ctdb_ref.c                    |  12 -
 source3/lib/messages_dgm.c                         |  36 +-
 source3/lib/messages_dgm_ref.c                     |  12 -
 source3/modules/vfs_catia.c                        |  42 +--
 source4/dns_server/dnsserver_common.c              |   2 +-
 source4/lib/messaging/messaging.c                  |  28 +-
 .../tests/rpc_dns_server_dnsutils_test.c           |  44 +--
 source4/torture/drs/python/fsmo.py                 |  12 +-
 source4/torture/ndr/dnsp.c                         | 367 +++++++++++++++++++++
 source4/torture/ndr/ndr.c                          |   1 +
 source4/torture/ndr/ndr.h                          |   9 +
 source4/torture/wscript_build                      |   1 +
 19 files changed, 461 insertions(+), 218 deletions(-)
 create mode 100644 source4/torture/ndr/dnsp.c


Changeset truncated at 500 lines:

diff --git a/ctdb/config/ctdb.service b/ctdb/config/ctdb.service
index 675b3147417..fd81c38e26d 100644
--- a/ctdb/config/ctdb.service
+++ b/ctdb/config/ctdb.service
@@ -2,6 +2,7 @@
 Description=CTDB
 Documentation=man:ctdbd(1) man:ctdb(7)
 After=network-online.target time-sync.target
+ConditionFileNotEmpty=/etc/ctdb/nodes
 
 [Service]
 Type=forking
diff --git a/lib/util/debug.h b/lib/util/debug.h
index 2895d157887..188e6b647d3 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -45,7 +45,6 @@
 bool dbgtext_va(const char *, va_list ap) PRINTF_ATTRIBUTE(1,0);
 bool dbgtext( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
 bool dbghdrclass( int level, int cls, const char *location, const char *func);
-bool dbghdr( int level, const char *location, const char *func);
 
 /*
  * Redefine DEBUGLEVEL because so we don't have to change every source file
@@ -201,7 +200,7 @@ extern int  *DEBUGLEVEL_CLASS;
 #define DEBUGC( dbgc_class, level, body ) \
   (void)( ((level) <= MAX_DEBUG_LEVEL) && \
 	  unlikely(DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))		\
-       && (dbghdrclass( level, DBGC_CLASS, __location__, __FUNCTION__ )) \
+       && (dbghdrclass( level, dbgc_class, __location__, __FUNCTION__ )) \
        && (dbgtext body) )
 
 #define DEBUGADD( level, body ) \
@@ -318,7 +317,6 @@ void force_check_log_size( void );
 bool need_to_check_log_size( void );
 void check_log_size( void );
 void dbgflush( void );
-bool dbghdrclass(int level, int cls, const char *location, const char *func);
 bool debug_get_output_is_stderr(void);
 bool debug_get_output_is_stdout(void);
 void debug_schedule_reopen_logs(void);
diff --git a/librpc/idl/dnsp.idl b/librpc/idl/dnsp.idl
index d705cfcbfa3..e09a3dcf43d 100644
--- a/librpc/idl/dnsp.idl
+++ b/librpc/idl/dnsp.idl
@@ -169,13 +169,13 @@ interface dnsp
 
 	typedef struct {
 		uint32  addrCount;
-		[size_is(addrCount)] uint32 *addr;
+		uint32 addrArray[addrCount];
 	} dnsp_ip4_array;
 
 	typedef struct {
 		uint16 	family;
-		uint16	port;
-		ipv4address ipv4;
+		[flag(NDR_BIG_ENDIAN)] uint16	port;
+		[flag(NDR_BIG_ENDIAN)] ipv4address ipv4;
 		ipv6address ipv6;
 		uint8	pad[8];
 		uint32	unused[8];
@@ -187,6 +187,7 @@ interface dnsp
 		uint32	Tag;
 		uint16	Family;
 		uint16	Reserved0;
+		uint32	Flags;
 		uint32	MatchFlag;
 		uint32	Reserved1;
 		uint32	Reserved2;
@@ -238,7 +239,7 @@ interface dnsp
 		[case(DSPROPERTY_ZONE_AGING_STATE)]             uint32 aging_enabled;
 		[case(DSPROPERTY_ZONE_SCAVENGING_SERVERS)]      dnsp_ip4_array servers;
 		[case(DSPROPERTY_ZONE_AGING_ENABLED_TIME)]      uint32 next_scavenging_cycle_hours;
-		[case(DSPROPERTY_ZONE_DELETED_FROM_HOSTNAME)]   utf8string deleted_by_hostname;
+		[case(DSPROPERTY_ZONE_DELETED_FROM_HOSTNAME)]   nstring deleted_by_hostname;
 		[case(DSPROPERTY_ZONE_MASTER_SERVERS)]          dnsp_ip4_array master_servers;
 		[case(DSPROPERTY_ZONE_AUTO_NS_SERVERS)]         dnsp_ip4_array ns_servers;
 		[case(DSPROPERTY_ZONE_DCPROMO_CONVERT)]         dns_dcpromo_flag dcpromo_flag;
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index bd43667b99f..d9939a92933 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -199,7 +199,10 @@ class dbcheck(object):
                            scope=ldb.SCOPE_BASE,
                            expression="(objectClass=nTDSService)",
                            attrs=["tombstoneLifetime"])
-        self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0])
+        if "tombstoneLifetime" in res[0]:
+            self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0])
+        else:
+            self.tombstoneLifetime = 180
 
         self.compatibleFeatures = []
         self.requiredFeatures = []
diff --git a/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py
index 91de5dad563..c5ed04be1bb 100644
--- a/python/samba/netcmd/fsmo.py
+++ b/python/samba/netcmd/fsmo.py
@@ -23,6 +23,7 @@ import ldb
 from ldb import LdbError
 from samba.dcerpc import drsuapi, misc
 from samba.auth import system_session
+import samba.drs_utils
 from samba.netcmd import (
     Command,
     CommandError,
@@ -64,6 +65,8 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb):
         forest_dn = samba.dn_from_dns_name(samdb.forest_dns_name())
         role_object = "CN=Infrastructure,DC=ForestDnsZones," + forest_dn
 
+    new_host_dns_name = samdb.host_dns_name()
+
     res = samdb.search(role_object,
                        attrs=["fSMORoleOwner"],
                        scope=ldb.SCOPE_BASE,
@@ -105,22 +108,12 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb):
 
         m = ldb.Message()
         m.dn = ldb.Dn(samdb, role_object)
-        m["fSMORoleOwner"] = ldb.MessageElement(master_owner,
-                                                ldb.FLAG_MOD_DELETE,
-                                                "fSMORoleOwner")
-
-        try:
-            samdb.modify(m)
-        except LdbError as e4:
-            (num, msg) = e4.args
-            raise CommandError("Failed to delete role '%s': %s" %
-                               (role, msg))
-
-        m = ldb.Message()
-        m.dn = ldb.Dn(samdb, role_object)
-        m["fSMORoleOwner"]= ldb.MessageElement(new_owner,
-                                               ldb.FLAG_MOD_ADD,
-                                               "fSMORoleOwner")
+        m["fSMORoleOwner_Del"] = ldb.MessageElement(master_owner,
+                                                    ldb.FLAG_MOD_DELETE,
+                                                    "fSMORoleOwner")
+        m["fSMORoleOwner_Add"] = ldb.MessageElement(new_owner,
+                                                    ldb.FLAG_MOD_ADD,
+                                                    "fSMORoleOwner")
         try:
             samdb.modify(m)
         except LdbError as e5:
@@ -128,7 +121,7 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb):
             raise CommandError("Failed to add role '%s': %s" % (role, msg))
 
         try:
-            connection = samba.drs_utils.drsuapi_connect(samdb.host_dns_name(),
+            connection = samba.drs_utils.drsuapi_connect(new_host_dns_name,
                                                          lp, creds)
         except samba.drs_utils.drsException as e:
             raise CommandError("Drsuapi Connect failed", e)
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 90fffa2c872..df7af2e50f1 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -206,7 +206,7 @@ static bool messaging_register_event_context(struct messaging_context *ctx,
 			continue;
 		}
 
-		if (tevent_context_same_loop(reg->ev, ev)) {
+		if (reg->ev == ev) {
 			reg->refcount += 1;
 			return true;
 		}
@@ -255,7 +255,7 @@ static bool messaging_deregister_event_context(struct messaging_context *ctx,
 			continue;
 		}
 
-		if (tevent_context_same_loop(reg->ev, ev)) {
+		if (reg->ev == ev) {
 			reg->refcount -= 1;
 
 			if (reg->refcount == 0) {
@@ -365,11 +365,6 @@ static bool messaging_alert_event_contexts(struct messaging_context *ctx)
 		 * alternatively would be to track whether the
 		 * immediate has already been scheduled. For
 		 * now, avoid that complexity here.
-		 *
-		 * reg->ev and ctx->event_ctx can't
-		 * be wrapper tevent_context pointers
-		 * so we don't need to use
-		 * tevent_context_same_loop().
 		 */
 
 		if (reg->ev == ctx->event_ctx) {
@@ -498,12 +493,6 @@ static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx,
 
 	sec_init();
 
-	if (tevent_context_is_wrapper(ev)) {
-		/* This is really a programmer error! */
-		DBG_ERR("Should not be used with a wrapper tevent context\n");
-		return NT_STATUS_INVALID_PARAMETER;
-	}
-
 	lck_path = lock_path("msg.lock");
 	if (lck_path == NULL) {
 		return NT_STATUS_NO_MEMORY;
@@ -1025,22 +1014,9 @@ struct tevent_req *messaging_filtered_read_send(
 	state->filter = filter;
 	state->private_data = private_data;
 
-	if (tevent_context_is_wrapper(ev) &&
-	    !tevent_context_same_loop(ev, msg_ctx->event_ctx))
-	{
-		/* This is really a programmer error! */
-		DBG_ERR("Wrapper tevent context doesn't use main context.\n");
-		tevent_req_error(req, EINVAL);
-		return tevent_req_post(req, ev);
-	}
-
 	/*
 	 * We have to defer the callback here, as we might be called from
-	 * within a different tevent_context than state->ev.
-	 *
-	 * This is important for two cases:
-	 * 1. nested event contexts, used by blocking ctdb calls
-	 * 2. possible impersonation using wrapper tevent contexts.
+	 * within a different tevent_context than state->ev
 	 */
 	tevent_req_defer_callback(req, state->ev);
 
@@ -1336,7 +1312,7 @@ static bool messaging_dispatch_waiters(struct messaging_context *msg_ctx,
 
 		state = tevent_req_data(
 			req, struct messaging_filtered_read_state);
-		if (tevent_context_same_loop(ev, state->ev) &&
+		if ((ev == state->ev) &&
 		    state->filter(rec, state->private_data)) {
 			messaging_filtered_read_done(req, rec);
 			return true;
@@ -1358,11 +1334,6 @@ static void messaging_dispatch_rec(struct messaging_context *msg_ctx,
 	bool consumed;
 	size_t i;
 
-	/*
-	 * ev and msg_ctx->event_ctx can't be wrapper tevent_context pointers
-	 * so we don't need to use tevent_context_same_loop().
-	 */
-
 	if (ev == msg_ctx->event_ctx) {
 		consumed = messaging_dispatch_classic(msg_ctx, rec);
 		if (consumed) {
diff --git a/source3/lib/messages_ctdb.c b/source3/lib/messages_ctdb.c
index 11fe72661cc..d3e2e3f8589 100644
--- a/source3/lib/messages_ctdb.c
+++ b/source3/lib/messages_ctdb.c
@@ -226,24 +226,7 @@ struct messaging_ctdb_fde *messaging_ctdb_register_tevent_context(
 			 */
 			continue;
 		}
-
-		/*
-		 * We can only have one tevent_fd
-		 * per low level tevent_context.
-		 *
-		 * This means any wrapper tevent_context
-		 * needs to share the structure with
-		 * the main tevent_context and/or
-		 * any sibling wrapper tevent_context.
-		 *
-		 * This means we need to use tevent_context_same_loop()
-		 * instead of just (fde_ev->ev == ev).
-		 *
-		 * Note: the tevent_context_is_wrapper() check below
-		 * makes sure that fde_ev->ev is always a raw
-		 * tevent context.
-		 */
-		if (tevent_context_same_loop(fde_ev->ev, ev)) {
+		if (fde_ev->ev == ev) {
 			break;
 		}
 	}
@@ -251,17 +234,6 @@ struct messaging_ctdb_fde *messaging_ctdb_register_tevent_context(
 	if (fde_ev == NULL) {
 		int sock = ctdbd_conn_get_fd(ctx->conn);
 
-		if (tevent_context_is_wrapper(ev)) {
-			/*
-			 * This is really a programmer error!
-			 *
-			 * The main/raw tevent context should
-			 * have been registered first!
-			 */
-			DBG_ERR("Should not be used with a wrapper tevent context\n");
-			return NULL;
-		}
-
 		fde_ev = talloc(fde, struct messaging_ctdb_fde_ev);
 		if (fde_ev == NULL) {
 			return NULL;
diff --git a/source3/lib/messages_ctdb_ref.c b/source3/lib/messages_ctdb_ref.c
index 47b4b758dac..3570ed8ae4c 100644
--- a/source3/lib/messages_ctdb_ref.c
+++ b/source3/lib/messages_ctdb_ref.c
@@ -52,18 +52,6 @@ void *messaging_ctdb_ref(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 {
 	struct msg_ctdb_ref *result, *tmp_refs;
 
-	if (tevent_context_is_wrapper(ev)) {
-		/*
-		 * This is really a programmer error!
-		 *
-		 * The main/raw tevent context should
-		 * have been registered first!
-		 */
-		DBG_ERR("Should not be used with a wrapper tevent context\n");
-		*err = EINVAL;
-		return NULL;
-	}
-
 	result = talloc(mem_ctx, struct msg_ctdb_ref);
 	if (result == NULL) {
 		*err = ENOMEM;
diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index 90d253d8e26..72b330eadb1 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -993,12 +993,6 @@ int messaging_dgm_init(struct tevent_context *ev,
 		return EEXIST;
 	}
 
-	if (tevent_context_is_wrapper(ev)) {
-		/* This is really a programmer error! */
-		DBG_ERR("Should not be used with a wrapper tevent context\n");
-		return EINVAL;
-	}
-
 	ctx = talloc_zero(NULL, struct messaging_dgm_context);
 	if (ctx == NULL) {
 		goto fail_nomem;
@@ -1712,40 +1706,12 @@ struct messaging_dgm_fde *messaging_dgm_register_tevent_context(
 			 */
 			continue;
 		}
-
-		/*
-		 * We can only have one tevent_fd
-		 * per low level tevent_context.
-		 *
-		 * This means any wrapper tevent_context
-		 * needs to share the structure with
-		 * the main tevent_context and/or
-		 * any sibling wrapper tevent_context.
-		 *
-		 * This means we need to use tevent_context_same_loop()
-		 * instead of just (fde_ev->ev == ev).
-		 *
-		 * Note: the tevent_context_is_wrapper() check below
-		 * makes sure that fde_ev->ev is always a raw
-		 * tevent context.
-		 */
-		if (tevent_context_same_loop(fde_ev->ev, ev)) {
+		if (fde_ev->ev == ev) {
 			break;
 		}
 	}
 
 	if (fde_ev == NULL) {
-		if (tevent_context_is_wrapper(ev)) {
-			/*
-			 * This is really a programmer error!
-			 *
-			 * The main/raw tevent context should
-			 * have been registered first!
-			 */
-			DBG_ERR("Should not be used with a wrapper tevent context\n");
-			return NULL;
-		}
-
 		fde_ev = talloc(fde, struct messaging_dgm_fde_ev);
 		if (fde_ev == NULL) {
 			return NULL;
diff --git a/source3/lib/messages_dgm_ref.c b/source3/lib/messages_dgm_ref.c
index 12ff21ca628..470dfbeabc7 100644
--- a/source3/lib/messages_dgm_ref.c
+++ b/source3/lib/messages_dgm_ref.c
@@ -75,18 +75,6 @@ void *messaging_dgm_ref(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 	if (refs == NULL) {
 		int ret;
 
-		if (tevent_context_is_wrapper(ev)) {
-			/*
-			 * This is really a programmer error!
-			 *
-			 * The main/raw tevent context should
-			 * have been registered first!
-			 */
-			DBG_ERR("Should not be used with a wrapper tevent context\n");
-			*err = EINVAL;
-			return NULL;
-		}
-
 		ret = messaging_dgm_init(ev, unique, socket_dir, lockfile_dir,
 					 msg_dgm_ref_recv, NULL);
 		DBG_DEBUG("messaging_dgm_init returned %s\n", strerror(ret));
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index fce2dcf8ca5..732bf75ffdf 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -180,7 +180,7 @@ static DIR *catia_opendir(vfs_handle_struct *handle,
 	mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
 				name_mapped,
 				NULL,
-				NULL,
+				&smb_fname->st,
 				smb_fname->flags);
 	if (mapped_smb_fname == NULL) {
 		TALLOC_FREE(mapped_smb_fname);
@@ -709,7 +709,7 @@ static int catia_chown(vfs_handle_struct *handle,
 	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
 					name,
 					NULL,
-					NULL,
+					&smb_fname->st,
 					smb_fname->flags);
 	if (catia_smb_fname == NULL) {
 		TALLOC_FREE(name);
@@ -747,7 +747,7 @@ static int catia_lchown(vfs_handle_struct *handle,
 	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
 					name,
 					NULL,
-					NULL,
+					&smb_fname->st,
 					smb_fname->flags);
 	if (catia_smb_fname == NULL) {
 		TALLOC_FREE(name);
@@ -784,7 +784,7 @@ static int catia_chmod(vfs_handle_struct *handle,
 	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
 					name,
 					NULL,
-					NULL,
+					&smb_fname->st,
 					smb_fname->flags);
 	if (catia_smb_fname == NULL) {
 		TALLOC_FREE(name);
@@ -819,7 +819,7 @@ static int catia_rmdir(vfs_handle_struct *handle,
 	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
 					name,
 					NULL,
-					NULL,
+					&smb_fname->st,
 					smb_fname->flags);
 	if (catia_smb_fname == NULL) {
 		TALLOC_FREE(name);
@@ -854,7 +854,7 @@ static int catia_mkdir(vfs_handle_struct *handle,
 	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
 					name,
 					NULL,
-					NULL,
+					&smb_fname->st,
 					smb_fname->flags);
 	if (catia_smb_fname == NULL) {
 		TALLOC_FREE(name);
@@ -889,7 +889,7 @@ static int catia_chdir(vfs_handle_struct *handle,
 	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
 					name,
 					NULL,
-					NULL,
+					&smb_fname->st,
 					smb_fname->flags);
 	if (catia_smb_fname == NULL) {
 		TALLOC_FREE(name);
@@ -955,7 +955,7 @@ catia_realpath(vfs_handle_struct *handle,
 	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
 					mapped_name,
 					NULL,
-					NULL,
+					&smb_fname->st,
 					smb_fname->flags);
 	if (catia_smb_fname == NULL) {
 		TALLOC_FREE(mapped_name);
@@ -988,7 +988,7 @@ static int catia_chflags(struct vfs_handle_struct *handle,
 	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
 					name,
 					NULL,
-					NULL,
+					&smb_fname->st,
 					smb_fname->flags);
 	if (catia_smb_fname == NULL) {
 		TALLOC_FREE(name);
@@ -1033,7 +1033,7 @@ catia_streaminfo(struct vfs_handle_struct *handle,
 	catia_smb_fname = synthetic_smb_fname(talloc_tos(),
 					mapped_name,
 					NULL,
-					NULL,
+					&smb_fname->st,
 					smb_fname->flags);
 	if (catia_smb_fname == NULL) {
 		TALLOC_FREE(mapped_name);
@@ -1113,7 +1113,7 @@ catia_get_nt_acl(struct vfs_handle_struct *handle,
 	mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
 					mapped_name,
 					NULL,
-					NULL,
+					&smb_fname->st,
 					smb_fname->flags);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list