[SCM] Samba Shared Repository - branch v4-10-stable updated

Karolin Seeger kseeger at samba.org
Thu Aug 22 08:11:02 UTC 2019


The branch, v4-10-stable has been updated
       via  c0f6317dade VERSION: Disable GIT_SNAPSHOT for the 4.10.7 release.
       via  db1d9ca55b6 WHATSNEW: Add release notes for Samba 4.10.7.
       via  aabd5558bcf smbtorture: extend rpc.lsa to lookup machine over forest-wide LookupNames
       via  692e9e1f411 lookup_name: allow own domain lookup when flags == 0
       via  a89157e5535 torture/rpc/lsa: allow testing different lookup levels
       via  bf28f9d7bef tests/drs_no_dns: Check dbcheck and ldapcmp pass
       via  bf70fc09852 tests: Add samba_upgradedns to the list of possible cmds
       via  1d2c7ee7061 netcmd: Allow drs replicate --local to create partitions
       via  9dac4d85ad0 join: Use a specific attribute order for the DsAddEntry nTDSDSA object
       via  f839423bdab ctdb-config: depend on /etc/ctdb/nodes file
       via  b0ebe62fe51 vfs_catia: pass stat info to synthetic_smb_fname()
       via  376bed3a0e6 samba-tool: add 'import samba.drs_utils' to fsmo.py
       via  7788b9f3039 samba-tool: use only one LDAP modify for dns partition fsmo role transfer
       via  4d7ce477eb0 s4:torture:fsmo.py: remove unused 'net_cmd' variable
       via  cfce211fff1 samba-tool: fix replication after dns partition fsmo role transfer
       via  65c4f412509 s4:torture:fsmo.py: test role transfers of dns partitions
       via  b2849a889f3 dnsp.idl: fix payload for DSPROPERTY_ZONE_DELETED_FROM_HOSTNAME
       via  d2087e4b480 dnsp.idl: fix the dnsp_dns_addr_array definition
       via  e7dfe3f7f77 dnsp.idl: fix dnsp_ip4_array definition
       via  7dbde4521fe s4:torture: add local.ndr.dnsp tests
       via  bbe41dc7806 dbcheck: fallback to the default tombstoneLifetime of 180 days
       via  c51d810ee99 third_party: Update waf to version 2.0.17
       via  1dcb5dc3844 lib/util: set current_msg_{level,class} also during a DEBUGADD[C]() call
       via  823d57094b9 lib/util: remove unused prototypes in debug.h
       via  fdec94ba7c4 lib/util: fix call to dbghdrclass() for DEBUGC()
       via  b56e010af12 s4/libnet: Fix joining a Windows pre-2008R2 DC
       via  4743188456f vfs:glusterfs_fuse: treat ENOATTR as ENOENT
       via  01a7df07fc9 vfs:glusterfs: treat ENOATTR as ENOENT
       via  27bd08f36bd dsdb: Handle DB corner-case where PSO container doesn't exist
       via  1f0870a7b28 s3:rpc_server:netlogon: simplify AUTH_TYPE_SCHANNEL check in netr_creds_server_step_check()
       via  b7f586ca6c9 s3:rpc_server:netlogon: don't require NEG_AUTHENTICATED_RPC in netr_ServerAuthenticate*()
       via  e9c23a02470 s4:rpc_server:netlogon: don't require NEG_AUTHENTICATED_RPC in netr_ServerAuthenticate*()
       via  58760fe8b72 s4 librpc rpc pyrpc: Fix flapping dcerpc.bare tests
       via  4f70d4d76a0 s4 librpc rpc pyrpc: Ensure tevent_context deleted last
       via  4179bdb6f2a s4/pyrpc_util: appropriately decrement refcounts on failure
       via  8128ceceb87 build: Allow build when --disable-gnutls is set
       via  372ee382939 VERSION: Bump version up to 4.10.7...
      from  9c67187029b VERSION: Disable GIT_SNAPSHOT for the 4.10.6 release.

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


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                                            |   2 +-
 WHATSNEW.txt                                       |  85 ++++-
 buildtools/bin/waf                                 |   2 +-
 buildtools/wafsamba/wafsamba.py                    |   2 +-
 ctdb/config/ctdb.service                           |   1 +
 lib/mscat/wscript                                  |   6 +-
 lib/util/debug.c                                   |  17 +-
 lib/util/debug.h                                   |  11 +-
 librpc/idl/dnsp.idl                                |   9 +-
 python/samba/dbchecker.py                          |   5 +-
 python/samba/join.py                               |  23 +-
 python/samba/netcmd/drs.py                         |   4 +-
 python/samba/netcmd/fsmo.py                        |  27 +-
 python/samba/tests/__init__.py                     |   1 +
 source3/modules/vfs_catia.c                        |  42 +--
 source3/modules/vfs_glusterfs.c                    |   2 +-
 source3/modules/vfs_glusterfs_fuse.c               |   2 +-
 source3/passdb/lookup_sid.c                        |   2 +-
 source3/rpc_server/netlogon/srv_netlog_nt.c        |  52 +--
 source4/dns_server/dnsserver_common.c              |   2 +-
 source4/dsdb/samdb/ldb_modules/operational.c       |  12 +
 source4/libnet/libnet_vampire.c                    |   9 +
 source4/librpc/rpc/pyrpc.c                         |  15 +
 source4/librpc/rpc/pyrpc.h                         |   1 +
 source4/librpc/rpc/pyrpc_util.c                    |  70 ++--
 source4/rpc_server/netlogon/dcerpc_netlogon.c      |  15 -
 .../tests/rpc_dns_server_dnsutils_test.c           |  44 +--
 source4/selftest/tests.py                          |   7 +
 source4/torture/drs/python/fsmo.py                 |  12 +-
 .../torture/drs/python/samba_tool_drs_no_dns.py    | 183 ++++++++++
 source4/torture/ndr/dnsp.c                         | 367 +++++++++++++++++++++
 source4/torture/ndr/ndr.c                          |   1 +
 source4/torture/ndr/ndr.h                          |   9 +
 source4/torture/rpc/lsa.c                          | 128 ++++---
 source4/torture/rpc/schannel.c                     |   2 +-
 source4/torture/wscript_build                      |   1 +
 third_party/waf/waflib/Build.py                    |  62 +++-
 third_party/waf/waflib/ConfigSet.py                |   4 +-
 third_party/waf/waflib/Configure.py                |   5 +-
 third_party/waf/waflib/Context.py                  |  16 +-
 third_party/waf/waflib/Logs.py                     |   9 +-
 third_party/waf/waflib/Node.py                     |   3 +-
 third_party/waf/waflib/Runner.py                   |  60 +++-
 third_party/waf/waflib/Scripting.py                |  15 +-
 third_party/waf/waflib/Task.py                     | 215 +++++++++---
 third_party/waf/waflib/TaskGen.py                  |   6 +-
 third_party/waf/waflib/Tools/c_config.py           |  11 +-
 third_party/waf/waflib/Tools/c_preproc.py          |   8 +-
 third_party/waf/waflib/Tools/ccroot.py             |  22 +-
 third_party/waf/waflib/Tools/d_scan.py             |   8 +-
 third_party/waf/waflib/Tools/fc.py                 |  24 +-
 third_party/waf/waflib/Tools/fc_config.py          |   6 +-
 third_party/waf/waflib/Tools/fc_scan.py            |  12 +-
 third_party/waf/waflib/Tools/ifort.py              |   2 +-
 third_party/waf/waflib/Tools/javaw.py              | 157 ++++++++-
 third_party/waf/waflib/Tools/md5_tstamp.py         |   6 +-
 third_party/waf/waflib/Tools/msvc.py               |  18 +-
 third_party/waf/waflib/Tools/python.py             |  18 +-
 third_party/waf/waflib/Tools/qt5.py                |  14 +-
 third_party/waf/waflib/Tools/waf_unit_test.py      |   4 +-
 third_party/waf/waflib/Tools/winres.py             |   4 +-
 third_party/waf/waflib/Utils.py                    |  26 +-
 third_party/waf/waflib/ansiterm.py                 |   2 +-
 third_party/waf/waflib/extras/buildcopy.py         |   7 +-
 third_party/waf/waflib/extras/clang_cross.py       |  92 ++++++
 .../waf/waflib/extras/clang_cross_common.py        | 113 +++++++
 third_party/waf/waflib/extras/clangxx_cross.py     | 106 ++++++
 third_party/waf/waflib/extras/color_msvc.py        |  59 ++++
 third_party/waf/waflib/extras/cppcheck.py          |  12 +-
 third_party/waf/waflib/extras/cpplint.py           |  77 ++---
 third_party/waf/waflib/extras/cython.py            |  15 +-
 third_party/waf/waflib/extras/distnet.py           |   2 +-
 third_party/waf/waflib/extras/doxygen.py           |  13 +-
 third_party/waf/waflib/extras/erlang.py            |   2 +-
 third_party/waf/waflib/extras/fast_partial.py      |   3 +-
 third_party/waf/waflib/extras/fc_cray.py           |   2 +-
 third_party/waf/waflib/extras/fc_nec.py            |   2 +-
 third_party/waf/waflib/extras/fc_nfort.py          |  52 +++
 third_party/waf/waflib/extras/gccdeps.py           |   6 +-
 third_party/waf/waflib/extras/kde4.py              |   2 +-
 third_party/waf/waflib/extras/msvcdeps.py          |  73 ++--
 third_party/waf/waflib/extras/ocaml.py             |   2 +-
 third_party/waf/waflib/extras/parallel_debug.py    |   9 +-
 third_party/waf/waflib/extras/pgicc.py             |   2 +-
 third_party/waf/waflib/extras/protoc.py            |  93 +++---
 third_party/waf/waflib/extras/pyqt5.py             |  21 +-
 third_party/waf/waflib/extras/qt4.py               |   6 +-
 third_party/waf/waflib/extras/remote.py            |   2 +-
 third_party/waf/waflib/extras/run_do_script.py     |   2 +-
 third_party/waf/waflib/extras/sphinx.py            |  81 +++++
 third_party/waf/waflib/extras/swig.py              |   4 +-
 third_party/waf/waflib/extras/syms.py              |   2 +-
 third_party/waf/waflib/extras/use_config.py        |   2 +-
 third_party/waf/waflib/extras/xcode6.py            |   8 +-
 third_party/waf/waflib/processor.py                |   4 +
 95 files changed, 2190 insertions(+), 596 deletions(-)
 create mode 100644 source4/torture/drs/python/samba_tool_drs_no_dns.py
 create mode 100644 source4/torture/ndr/dnsp.c
 create mode 100644 third_party/waf/waflib/extras/clang_cross.py
 create mode 100644 third_party/waf/waflib/extras/clang_cross_common.py
 create mode 100644 third_party/waf/waflib/extras/clangxx_cross.py
 create mode 100644 third_party/waf/waflib/extras/color_msvc.py
 create mode 100644 third_party/waf/waflib/extras/fc_nfort.py
 create mode 100644 third_party/waf/waflib/extras/sphinx.py


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index abb34d0334c..22967a003f8 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=10
-SAMBA_VERSION_RELEASE=6
+SAMBA_VERSION_RELEASE=7
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 3118e034ba7..09eebbc6274 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,3 +1,84 @@
+                   ==============================
+                   Release Notes for Samba 4.10.7
+                           August 22, 2019
+                   ==============================
+
+
+This is the latest stable release of the Samba 4.10 release series.
+
+
+Changes since 4.10.6:
+---------------------
+
+o  Michael Adam <obnox at samba.org>
+   * BUG 14010: Unable to create or rename file/directory inside shares
+     configured with vfs_glusterfs_fuse module.
+
+o  Andrew Bartlett <abartlet at samba.org>
+   * BUG 13844: build: Allow build when '--disable-gnutls' is set.
+
+o  Björn Baumbach <bb at sernet.de>
+   * BUG 13973: samba-tool: Add 'import samba.drs_utils' to fsmo.py.
+
+o  Tim Beale <timbeale at catalyst.net.nz>
+   * BUG 14008: Fix 'Error 32 determining PSOs in system' message on old DB
+     with FL upgrade.
+   * BUG 14021: s4/libnet: Fix joining a Windows pre-2008R2 DC.
+   * BUG 14046: join: Use a specific attribute order for the DsAddEntry
+     nTDSDSA object.
+
+o  Ralph Boehme <slow at samba.org>
+   * BUG 14015: vfs_catia: Pass stat info to synthetic_smb_fname().
+
+o  Alexander Bokovoy <ab at samba.org>
+   * BUG 14091: lookup_name: Allow own domain lookup when flags == 0.
+
+o  Gary Lockyer <gary at catalyst.net.nz>
+   * BUG 13932: s4 librpc rpc pyrpc: Ensure tevent_context deleted last.
+
+o  Stefan Metzmacher <metze at samba.org>
+   * BUG 13915: DEBUGC and DEBUGADDC doesn't print into a class specific log
+     file.
+   * BUG 13949: Request to keep deprecated option "server schannel", 
+     VMWare Quickprep requires "auto".
+   * BUG 13967: dbcheck: Fallback to the default tombstoneLifetime of 180 days.
+   * BUG 13969: dnsProperty fails to decode values from older Windows versions.
+   * BUG 13973: samba-tool: Use only one LDAP modify for dns partition fsmo
+     role transfer.
+
+o  Andreas Schneider <asn at samba.org>
+   * BUG 13960: third_party: Update waf to version 2.0.17.
+
+o  Garming Sam <garming at catalyst.net.nz>
+   * BUG 14051: netcmd: Allow 'drs replicate --local' to create partitions.
+
+o  Rafael David Tinoco <rafaeldtinoco at ubuntu.com>
+   * BUG 14017: ctdb-config: Depend on /etc/ctdb/nodes file.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
                    ==============================
                    Release Notes for Samba 4.10.6
                            July 8, 2019
@@ -102,8 +183,8 @@ database (https://bugzilla.samba.org/).
 ======================================================================
 
 
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+
 
 		   ==============================
                    Release Notes for Samba 4.10.5
diff --git a/buildtools/bin/waf b/buildtools/bin/waf
index 3ee4d5bc4df..8413f2332b7 100755
--- a/buildtools/bin/waf
+++ b/buildtools/bin/waf
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 import os, sys, inspect
 
-VERSION="2.0.8"
+VERSION="2.0.17"
 REVISION="x"
 GIT="x"
 INSTALL="x"
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index a077026c690..760430460b8 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -37,7 +37,7 @@ LIB_PATH="shared"
 
 os.environ['PYTHONUNBUFFERED'] = '1'
 
-if Context.HEXVERSION not in (0x2000800,):
+if Context.HEXVERSION not in (0x2001100,):
     Logs.error('''
 Please use the version of waf that comes with Samba, not
 a system installed version. See http://wiki.samba.org/index.php/Waf
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/mscat/wscript b/lib/mscat/wscript
index 7ca9ef567ee..4d1f752a3c1 100644
--- a/lib/mscat/wscript
+++ b/lib/mscat/wscript
@@ -12,7 +12,11 @@ def configure(conf):
         if not conf.find_program('asn1Parser', var='ASN1PARSER'):
             Logs.warn('WARNING: ans1Parser hasn\'t been found! Please install it (e.g. libtasn1-bin)')
 
-    conf.CHECK_FUNCS_IN('gnutls_pkcs7_get_embedded_data_oid', 'gnutls')
+    # GnuTLS is currently able to be disabled
+    if conf.env.enable_gnutls:
+        conf.CHECK_FUNCS_IN('gnutls_pkcs7_get_embedded_data_oid', 'gnutls')
+    else:
+        Logs.warn('WARNING: gnutls disabled so dumpmscat will not be built')
 
 def build(bld):
     if (bld.CONFIG_SET('HAVE_LIBTASN1') and
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 7f3d13da53c..38df787c658 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -1475,6 +1475,17 @@ void dbgflush( void )
 	bufr_print();
 }
 
+bool dbgsetclass(int level, int cls)
+{
+	/* Set current_msg_level. */
+	current_msg_level = level;
+
+	/* Set current message class */
+	current_msg_class = cls;
+
+	return true;
+}
+
 /***************************************************************************
  Print a Debug Header.
 
@@ -1519,11 +1530,7 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
 		return( true );
 	}
 
-	/* Set current_msg_level. */
-	current_msg_level = level;
-
-	/* Set current message class */
-	current_msg_class = cls;
+	dbgsetclass(level, cls);
 
 	/* Don't print a header if we're logging to stdout. */
 	if ( state.logtype != DEBUG_FILE ) {
diff --git a/lib/util/debug.h b/lib/util/debug.h
index e6f54a7657f..67dbf3357e3 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -45,7 +45,7 @@
 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);
+bool dbgsetclass(int level, int cls);
 
 /*
  * Define all new debug classes here. A class is represented by an entry in
@@ -201,17 +201,19 @@ void debuglevel_set_class(size_t idx, int level);
 #define DEBUGC( dbgc_class, level, body ) \
   (void)( ((level) <= MAX_DEBUG_LEVEL) && \
        unlikely(debuglevel_get_class(dbgc_class) >= (level))             \
-       && (dbghdrclass( level, DBGC_CLASS, __location__, __FUNCTION__ )) \
+       && (dbghdrclass( level, dbgc_class, __location__, __FUNCTION__ )) \
        && (dbgtext body) )
 
 #define DEBUGADD( level, body ) \
   (void)( ((level) <= MAX_DEBUG_LEVEL) && \
-	  unlikely(debuglevel_get_class(DBGC_CLASS) >= (level))	\
+       unlikely(debuglevel_get_class(DBGC_CLASS) >= (level)) \
+       && (dbgsetclass(level, DBGC_CLASS))                   \
        && (dbgtext body) )
 
 #define DEBUGADDC( dbgc_class, level, body ) \
   (void)( ((level) <= MAX_DEBUG_LEVEL) && \
-          unlikely((debuglevel_get_class(dbgc_class) >= (level))) \
+       unlikely((debuglevel_get_class(dbgc_class) >= (level))) \
+       && (dbgsetclass(level, dbgc_class))                     \
        && (dbgtext body) )
 
 /* Print a separator to the debug log. */
@@ -318,7 +320,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 e7ec426de54..3677564fea0 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -218,7 +218,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/join.py b/python/samba/join.py
index da8dcb050d3..6fe4ee7dc90 100644
--- a/python/samba/join.py
+++ b/python/samba/join.py
@@ -48,6 +48,7 @@ import time
 import re
 import os
 import tempfile
+from collections import OrderedDict
 from samba.compat import text_type
 from samba.compat import get_string
 from samba.netcmd import CommandError
@@ -551,11 +552,14 @@ class DCJoinContext(object):
         '''return the ntdsdsa object to add'''
 
         print("Adding %s" % ctx.ntds_dn)
-        rec = {
-            "dn": ctx.ntds_dn,
-            "objectclass": "nTDSDSA",
-            "systemFlags": str(samba.dsdb.SYSTEM_FLAG_DISALLOW_MOVE_ON_DELETE),
-            "dMDLocation": ctx.schema_dn}
+
+        # When joining Windows, the order of certain attributes (mostly only
+        # msDS-HasMasterNCs and HasMasterNCs) seems to matter
+        rec = OrderedDict([
+            ("dn", ctx.ntds_dn),
+            ("objectclass", "nTDSDSA"),
+            ("systemFlags", str(samba.dsdb.SYSTEM_FLAG_DISALLOW_MOVE_ON_DELETE)),
+            ("dMDLocation", ctx.schema_dn)])
 
         nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn]
 
@@ -571,12 +575,17 @@ class DCJoinContext(object):
             rec["options"] = "37"
         else:
             rec["objectCategory"] = "CN=NTDS-DSA,%s" % ctx.schema_dn
+
+            # Note that Windows seems to have an undocumented requirement that
+            # the msDS-HasMasterNCs attribute occurs before HasMasterNCs
+            if ctx.behavior_version >= samba.dsdb.DS_DOMAIN_FUNCTION_2003:
+                rec["msDS-HasMasterNCs"] = ctx.full_nc_list
+
             rec["HasMasterNCs"]      = []
             for nc in nc_list:
                 if nc in ctx.full_nc_list:
                     rec["HasMasterNCs"].append(nc)
-            if ctx.behavior_version >= samba.dsdb.DS_DOMAIN_FUNCTION_2003:
-                rec["msDS-HasMasterNCs"] = ctx.full_nc_list
+
             rec["options"] = "1"
             rec["invocationId"] = ndr_pack(ctx.invocation_id)
 
diff --git a/python/samba/netcmd/drs.py b/python/samba/netcmd/drs.py
index e6b892c2877..5c20d6be6f3 100644
--- a/python/samba/netcmd/drs.py
+++ b/python/samba/netcmd/drs.py
@@ -448,8 +448,10 @@ class cmd_drs_replicate(Command):
         self.server = SOURCE_DC
         drsuapi_connect(self)
 
+        # Override the default flag LDB_FLG_DONT_CREATE_DB
         self.local_samdb = SamDB(session_info=system_session(), url=None,
-                                 credentials=self.creds, lp=self.lp)
+                                 credentials=self.creds, lp=self.lp,
+                                 flags=0)
 
         self.samdb = SamDB(url="ldap://%s" % self.server,
                            session_info=system_session(),
diff --git a/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py
index b916f9c97b8..643d0aec1b6 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,
@@ -65,6 +66,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,
@@ -106,22 +109,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:
@@ -129,7 +122,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/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index f904499b90b..15824bd410a 100644
--- a/python/samba/tests/__init__.py
+++ b/python/samba/tests/__init__.py
@@ -402,6 +402,7 @@ class BlackboxTestCase(TestCaseInTempDir):
 
         python_cmds = ["samba-tool",
             "samba_dnsupdate",
+            "samba_upgradedns",
             "script/traffic_replay",
             "script/traffic_learner"]
 
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index c362be764cc..ce771a11e57 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -193,7 +193,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);
@@ -722,7 +722,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);
@@ -760,7 +760,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);
@@ -797,7 +797,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);
@@ -832,7 +832,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);
@@ -867,7 +867,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);
@@ -902,7 +902,7 @@ static int catia_chdir(vfs_handle_struct *handle,
 	catia_smb_fname = synthetic_smb_fname(talloc_tos(),


-- 
Samba Shared Repository



More information about the samba-cvs mailing list