[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Mon Sep 12 06:25:04 MDT 2011


The branch, master has been updated
       via  368ad28 doc: suggest samba-tool dbcheck in upgrading-samba4.txt
       via  8268c2d s4-s3-upgrade Remove upgrade_from_s3 script, use samba-tool domain samba3upgrade
       via  3e246a3 start Samba 4.0alpha17 release notes
       via  28ad50e s3-selftest: Set path to bin/net and bin/wbinfo in command line to test scripts
       via  e223a65 samba-tool: Add "domain samba3upgrade" subcommand
       via  c7b1f15 s4-s3-upgrade: Check for duplicate sids before provisioning
       via  662818b s4-provision: Fix the informational message from dns provisioning
       via  c7c29a3 s4-provision: Create private dir for dns in a separate function
       via  c6a4094 s4-s3-upgrade: Check for common user/group names before provisioning
       via  0b08988 s4-provision: Generate appropriate named.conf file depending on dns_backend
       via  295361c s4-provision: Remove dupliate creation of dns/spn_update_list files
       via  9a5524e s4-provision: Add named.conf template for BIND9 with DLZ support
       via  41e9f9d s4-provision: Add Seperate instructions for BIND 9.7.x and 9.8.x.
       via  1860e6b s4-provision: Enable SPNs for DNS
      from  6f4264a s4:samba-tool/domain.py - rename arguments "domain" -> "domain-level", "forest" -> "forest-level"

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


- Log -----------------------------------------------------------------
commit 368ad28a6e95911739f6ad1485b63e87cf2adcc6
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Sep 12 20:41:29 2011 +1000

    doc: suggest samba-tool dbcheck in upgrading-samba4.txt
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Mon Sep 12 14:24:20 CEST 2011 on sn-devel-104

commit 8268c2d4e231b05b439bc70331b75342b35daa4e
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Sep 12 20:21:53 2011 +1000

    s4-s3-upgrade Remove upgrade_from_s3 script, use samba-tool domain samba3upgrade

commit 3e246a3cf47214b95fa7d45dafa24b98271c657b
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Sep 12 14:16:12 2011 +1000

    start Samba 4.0alpha17 release notes

commit 28ad50e5fd1887fff149d05793b2dabe5a08051a
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun Sep 11 08:16:50 2011 +1000

    s3-selftest: Set path to bin/net and bin/wbinfo in command line to test scripts
    
    This makes it easier to reproduce these tests outside the test
    environment, as we rely less on environment variables.
    
    Andrew Bartlett

commit e223a65b1011f82687e2fdfa102f305e1fd76214
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Sep 12 16:03:34 2011 +1000

    samba-tool: Add "domain samba3upgrade" subcommand
    
    Added new command to upgrade from samba3 to samba4.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit c7b1f156bbf23801515547bae50c4bbbbca90911
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Sep 12 15:09:49 2011 +1000

    s4-s3-upgrade: Check for duplicate sids before provisioning
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 662818b123ea7813f72053bd976aad4628637cd1
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Sep 12 13:17:50 2011 +1000

    s4-provision: Fix the informational message from dns provisioning
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit c7c29a3523a721737aa647b2e40e23a0775b3958
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Sep 12 13:14:42 2011 +1000

    s4-provision: Create private dir for dns in a separate function
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit c6a40942b2c5b2f330b73a5513927ffe9ed1af20
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Sep 12 12:14:00 2011 +1000

    s4-s3-upgrade: Check for common user/group names before provisioning
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 0b089880f021121320744f4f1b742857c0cb5cbf
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Sep 8 15:33:41 2011 +1000

    s4-provision: Generate appropriate named.conf file depending on dns_backend
    
    For --dns_backend=BIND9, generate the dns zone file, and named.conf with
    zone information.
    
    For --dns-backend=BIND9_DLZ, generate the named.conf with dlz directive.
    
    If no option is specified, default dns_backend is BIND9.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 295361c13d12782b2248e53b30e4101a41a96f90
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Sep 8 15:29:59 2011 +1000

    s4-provision: Remove dupliate creation of dns/spn_update_list files
    
    dns_update_list and spn_update_list are set up using
    create_dns_update_list() function.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 9a5524e00ad8f257305f823d4a9936026e6d9160
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Sep 8 15:24:11 2011 +1000

    s4-provision: Add named.conf template for BIND9 with DLZ support
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 41e9f9d504a31e8eed24cb4260c2e574812961e2
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Sep 8 14:44:44 2011 +1000

    s4-provision: Add Seperate instructions for BIND 9.7.x and 9.8.x.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 1860e6b1a32bb8844ca25cef484ac1bccab572ce
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Sep 5 16:20:00 2011 +1000

    s4-provision: Enable SPNs for DNS
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 WHATSNEW.txt                                       |   84 ++++++++-----
 source3/script/tests/test_net_conf.sh              |    7 +-
 source3/script/tests/test_net_misc.sh              |    5 +-
 source3/script/tests/test_net_registry.sh          |    7 +-
 .../script/tests/test_net_registry_roundtrip.sh    |    9 +-
 source3/script/tests/test_smbclient_s3.sh          |    7 +-
 source3/selftest/tests.py                          |   24 ++--
 source4/scripting/python/samba/netcmd/domain.py    |  108 ++++++++++++++++-
 .../scripting/python/samba/provision/__init__.py   |   98 +++++++++------
 .../scripting/python/samba/provision/sambadns.py   |    2 +-
 source4/scripting/python/samba/upgrade.py          |   20 +++
 source4/setup/named.conf.dlz                       |   14 ++
 source4/setup/named.txt                            |   86 ++++++++-----
 source4/setup/spn_update_list                      |    6 +-
 source4/setup/tests/blackbox_s3upgrade.sh          |    7 +-
 source4/setup/upgrade_from_s3                      |  132 --------------------
 upgrading-samba4.txt                               |   15 ++-
 17 files changed, 358 insertions(+), 273 deletions(-)
 create mode 100644 source4/setup/named.conf.dlz
 delete mode 100755 source4/setup/upgrade_from_s3


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 0251ffd..6b6e685 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,4 +1,4 @@
-What's new in Samba 4 alpha16
+What's new in Samba 4 alpha17
 =============================
 
 Samba 4.0 will be the next version of the Samba suite and incorporates
@@ -10,14 +10,11 @@ and above.
 WARNINGS
 ========
 
-Samba4 alpha16 is not a final Samba release, however we are now making
+Samba4 alpha17 is not a final Samba release, however we are now making
 good progress towards a Samba 4.0 release, of which this is a preview.
 Be aware the this release contains both the technology of Samba 3.6
 (that you can reasonably expect to upgrade existing Samba 3.x releases
 to) and the AD domain controller work previously known as 'samba4'.
-No migration path is currently provided between these two sets of
-technology.  These missing migration paths will be the focus of
-development between now and a Samba 4.0 release.
 
 While binaries for the stable file server are provided in this
 release, for a stable, supported file server, Samba3 domain or AD
@@ -58,37 +55,70 @@ programs to interface to Samba's internals, and many tools and
 internal workings of the DC code is now implemented in python.
 
 
-CHANGES SINCE alpha15
+CHANGES SINCE alpha16
 =====================
 
 For a list of changes since alpha 15, please see the git log.
 
 $ git clone git://git.samba.org/samba.git
 $ cd samba.git
-$ git log release-4-0-0alpha15..release-4-0-0alpha16
+$ git log release-4-0-0alpha16..release-4-0-0alpha17
 
-The biggest user-visible change is that binaries from the Samba 3.x
-series of development are now built and installed.  These binaries
-(smbd, nmbd, winbindd, net, testparm, etc) operate much as they do in
-the Samba 3.6 release candidates. 
+Some major user-visible changes include:
 
-CHANGES
-=======
+samba-tool dbcheck
+------------------
 
-smb.conf changes
-----------------
+We now have an fsck-like tool for Samba's internal sam.ldb database.
+Run samba-tool dbcheck after installation to check your database for
+self-consistency.  Any database created with a previous Samba4 alpha
+will have a very large number of consistency errors, which this tool
+can fix.
 
-   Parameter Name                      Description     Default
-   --------------                      -----------     -------
-   announce version 		       Removed
-   announce as	 		       Removed
+See also the -H option to point dbcheck at a different database to the
+default, and the --fix and --yes options to make changes and to not
+prompt about those changes. 
 
-Those familiar with Samba 3 can find a list of user-visible changes
-between the two technology sets provided in the NEWS file.
+New default paths
+-----------------
+
+The configure options for paths have changed again, and the
+--enable-fhs option has been reinstated.  Packagers should attempt to
+first package Samba using:
+
+./configure --enable-fhs --prefix=/usr --sysconfdir=/etc --localstatedir=/var
+
+and only after examining the location Samba uses with these options
+should further changes be made.  Existing packaging scripts are not
+expected to work unmodified, instead the Samba Team's aim is to
+simplify such scripts for the long term. 
+
+samba-tool domain samba3upgrade
+-------------------------------
+
+The new samba-tool domain samba3upgrade command is a supported upgrade route from Samba
+3.x domain controllers to Samba 4.0 AD domain controllers.  This
+provides a one-time migration of all users, domain members, passwords,
+groups, group members and account polcies. 
+
+This tool is still under development and may fail when presented with
+an inconsistant Samba3 database (such as many LDAP configurations).
+We hope to improve the error handling and recovery in these
+situations, so please provide feedback using the samba-technical
+mailing list.
 
 KNOWN ISSUES
 ============
 
+- Installation on systems without a system iconv (and developer
+  headers at compile time) is known to cause errors when dealing with
+  non-ASCII characters.
+
+- In some situations, group members may not be upgraded by the
+  samba-tool domain upgrade_from_s3 script
+
+- The samba-tool domain join script will not join Windows 2000 domains.
+
 - Domain member support in the 'samba' binary is in it's infancy, and
   is not comparable to the support found in winbindd.  As such, do not
   use the 'samba' binary (provided for the AD server) on a member
@@ -96,8 +126,8 @@ KNOWN ISSUES
 
 - There is no printing support in the 'samba' binary (use smbd instead)
 
-- There is no NetBIOS browsing support in the 'samba' binary (use nmbd
-  and smbd instead)
+- There is no NetBIOS browsing support (network neighbourhood) in the
+  'samba' binary (use nmbd and smbd instead)
 
 - Clock Synchronisation is critical.  Many 'wrong password' errors are
   actually due to Kerberos objecting to a clock skew between client
@@ -108,14 +138,6 @@ KNOWN ISSUES
   experience issues with DRS replication, as we have fixed many issues
   here in response to feedback from our production users. 
 
-- Users upgrading existing databases to Samba4 should carefully
-  consult upgrading-samba4.txt.  We have made a number of changes in
-  this release that should make it easier to upgrade in future.
-  Btw: there exists also a script under the "setup" directory of the
-  source distribution called "upgrade_from_s3" which should allow a step-up
-  from Samba3 to Samba4. It's not included yet in the binary distributions
-  since it's completely experimental!
-
 RUNNING Samba 4.0 as an AD DC
 =============================
 
diff --git a/source3/script/tests/test_net_conf.sh b/source3/script/tests/test_net_conf.sh
index ee2903b..6d3d2a1 100755
--- a/source3/script/tests/test_net_conf.sh
+++ b/source3/script/tests/test_net_conf.sh
@@ -6,15 +6,16 @@
 
 if [ $# -lt 3 ]; then
 cat <<EOF
-Usage: test_net_conf.sh SCRIPTDIR SERVERCONFFILE CONFIGURATION [rpc]
+Usage: test_net_conf.sh SCRIPTDIR SERVERCONFFILE NET CONFIGURATION [rpc]
 EOF
 exit 1;
 fi
 
 SCRIPTDIR="$1"
 SERVERCONFFILE="$2"
-CONFIGURATION="$3"
-RPC="$4"
+NET="$3"
+CONFIGURATION="$4"
+RPC="$5"
 
 LOGDIR_PREFIX="conf_test"
 
diff --git a/source3/script/tests/test_net_misc.sh b/source3/script/tests/test_net_misc.sh
index 82775dc..566694b 100755
--- a/source3/script/tests/test_net_misc.sh
+++ b/source3/script/tests/test_net_misc.sh
@@ -4,14 +4,15 @@
 
 if [ $# -lt 3 ]; then
 cat <<EOF
-Usage: test_net_misc.sh SCRIPTDIR SERVERCONFFILE CONFIGURATION
+Usage: test_net_misc.sh SCRIPTDIR SERVERCONFFILE NET CONFIGURATION
 EOF
 exit 1;
 fi
 
 SCRIPTDIR="$1"
 SERVERCONFFILE="$2"
-CONFIGURATION="$3"
+NET="$3"
+CONFIGURATION="$4"
 
 NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
 
diff --git a/source3/script/tests/test_net_registry.sh b/source3/script/tests/test_net_registry.sh
index b76a988..5158d61 100755
--- a/source3/script/tests/test_net_registry.sh
+++ b/source3/script/tests/test_net_registry.sh
@@ -9,15 +9,16 @@
 
 if [ $# -lt 3 ]; then
 cat <<EOF
-Usage: test_net_registry.sh SCRIPTDIR SERVERCONFFILE CONFIGURATION RPC
+Usage: test_net_registry.sh SCRIPTDIR SERVERCONFFILE NET CONFIGURATION RPC
 EOF
 exit 1;
 fi
 
 SCRIPTDIR="$1"
 SERVERCONFFILE="$2"
-CONFIGURATION="$3"
-RPC="$4"
+NET="$3"
+CONFIGURATION="$4"
+RPC="$5"
 
 NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
 
diff --git a/source3/script/tests/test_net_registry_roundtrip.sh b/source3/script/tests/test_net_registry_roundtrip.sh
index 72bc693..050311a 100755
--- a/source3/script/tests/test_net_registry_roundtrip.sh
+++ b/source3/script/tests/test_net_registry_roundtrip.sh
@@ -7,17 +7,18 @@
 
 if [ $# -lt 3 ]; then
 cat <<EOF
-Usage: test_net_registry_roundtrip.sh SCRIPTDIR SERVERCONFFILE PREFIX CONFIGURATION
+Usage: test_net_registry_roundtrip.sh SCRIPTDIR SERVERCONFFILE NET CONFIGURATION RPC
 EOF
 exit 1;
 fi
 
 SCRIPTDIR="$1"
 SERVERCONFFILE="$2"
-CONFIGURATION="$3"
-RPC="$4"
+NET="$3"
+CONFIGURATION="$4"
+RPC="$5"
 
-NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
+NET="$VALGRIND ${NET} $CONFIGURATION"
 
 if test "x${RPC}" = "xrpc" ; then
 	NETCMD="${NET} -U${USERNAME}%${PASSWORD} -I ${SERVER_IP} rpc"
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 05bc8ef..d2c5049 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -4,7 +4,7 @@
 
 if [ $# -lt 7 ]; then
 cat <<EOF
-Usage: test_smbclient_s3.sh SERVER SERVER_IP DOMAIN USERNAME PASSWORD USERID LOCAL_PATH PREFIX SMBCLIENT
+Usage: test_smbclient_s3.sh SERVER SERVER_IP DOMAIN USERNAME PASSWORD USERID LOCAL_PATH PREFIX SMBCLIENT WBINFO
 EOF
 exit 1;
 fi
@@ -18,9 +18,10 @@ USERID="$6"
 LOCAL_PATH="$7"
 PREFIX="$8"
 SMBCLIENT="$9"
+WBINFO="$10"
 SMBCLIENT="$VALGRIND ${SMBCLIENT}"
-WBINFO="$VALGRIND ${WBINFO:-$BINDIR/wbinfo}"
-shift 9
+WBINFO="$VALGRIND ${WBINFO}"
+shift 10
 ADDARGS="$*"
 
 incdir=`dirname $0`/../../../testprogs/blackbox
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index dba4713..ff350eb 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -116,38 +116,38 @@ plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) bad username" % env, en
 
 # plain
 for env in ["s3dc"]:
-    plantestsuite("samba3.blackbox.smbclient_s3.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), configuration])
+    plantestsuite("samba3.blackbox.smbclient_s3.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration])
 
 for env in ["member"]:
-    plantestsuite("samba3.blackbox.smbclient_s3.plain (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER\\\\$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), configuration])
+    plantestsuite("samba3.blackbox.smbclient_s3.plain (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER\\\\$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration])
 
 for env in ["s3dc"]:
-    plantestsuite("samba3.blackbox.smbclient_s3.sign (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), configuration, "--signing=required"])
+    plantestsuite("samba3.blackbox.smbclient_s3.sign (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration, "--signing=required"])
 
 for env in ["member"]:
-    plantestsuite("samba3.blackbox.smbclient_s3.sign (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER\\\\$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), configuration, "--signing=required"])
+    plantestsuite("samba3.blackbox.smbclient_s3.sign (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER\\\\$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration, "--signing=required"])
 
 # encrypted
 for env in ["s3dc"]:
-    plantestsuite("samba3.blackbox.smbclient_s3.crypt (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), configuration, "-e"])
+    plantestsuite("samba3.blackbox.smbclient_s3.crypt (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration, "-e"])
 
 #TODO encrypted against member, with member creds, and with DC creds
 plantestsuite("samba3.blackbox.net.misc", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"),
-                                                       scriptdir, "$SMB_CONF_PATH", configuration])
+                                                       scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration])
 plantestsuite("samba3.blackbox.net.local.registry", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
-                                                       scriptdir, "$SMB_CONF_PATH", configuration])
+                                                       scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration])
 plantestsuite("samba3.blackbox.net.rpc.registry", "s3dc", [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
-                                                       scriptdir, "$SMB_CONF_PATH", configuration, 'rpc'])
+                                                       scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration, 'rpc'])
 
 plantestsuite("samba3.blackbox.net.local.registry.roundtrip", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
-                                                       scriptdir, "$SMB_CONF_PATH", configuration,])
+                                                       scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration,])
 plantestsuite("samba3.blackbox.net.rpc.registry.roundtrip", "s3dc", [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
-                                                       scriptdir, "$SMB_CONF_PATH", configuration, 'rpc'])
+                                                       scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration, 'rpc'])
 
 plantestsuite("samba3.blackbox.net.local.conf", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
-                                                       scriptdir, "$SMB_CONF_PATH", configuration,])
+                                                       scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration,])
 plantestsuite("samba3.blackbox.net.rpc.conf", "s3dc", [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
-                                                       scriptdir, "$SMB_CONF_PATH", configuration, 'rpc'])
+                                                       scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration, 'rpc'])
 
 
 plantestsuite("samba3.blackbox.testparm", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_testparm_s3.sh"),
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py
index d76b092..c311748 100644
--- a/source4/scripting/python/samba/netcmd/domain.py
+++ b/source4/scripting/python/samba/netcmd/domain.py
@@ -25,7 +25,9 @@
 
 import samba.getopt as options
 import ldb
-import os
+import sys, os
+import tempfile
+import logging
 from samba import Ldb
 from samba.net import Net, LIBNET_JOIN_AUTOMATIC
 from samba.dcerpc.misc import SEC_CHAN_WKSTA
@@ -39,6 +41,10 @@ from samba.netcmd import (
     SuperCommand,
     Option
     )
+from samba.samba3 import Samba3
+from samba.samba3 import param as s3param
+from samba.upgrade import upgrade_from_samba3
+from samba.provision import ProvisioningError
 
 from samba.dsdb import (
     DS_DOMAIN_FUNCTION_2000,
@@ -512,6 +518,105 @@ class cmd_domain_passwordsettings(Command):
             raise CommandError("Wrong argument '%s'!" % subcommand)
 
 
+class cmd_domain_samba3upgrade(Command):
+    """Upgrade from Samba3 database to Samba4 AD database"""
+
+    synopsis = "%prog domain samba3upgrade [options] <samba3_smb_conf> <targetdir>"
+
+    long_description = """Specify either samba3 database directory (with --libdir) or
+samba3 testparm utility (with --testparm)."""
+
+    takes_optiongroups = {
+        "sambaopts": options.SambaOptions,
+        "versionopts": options.VersionOptions
+    }
+
+    takes_options = [
+        Option("--libdir", type="string", metavar="DIR",
+                  help="Path to samba3 database directory"),
+        Option("--testparm", type="string", metavar="PATH",
+                  help="Path to samba3 testparm utility"),
+        Option("--quiet", help="Be quiet"),
+        Option("--use-xattrs", type="choice", choices=["yes","no","auto"], metavar="[yes|no|auto]",
+                   help="Define if we should use the native fs capabilities or a tdb file for storing attributes likes ntacl, auto tries to make an inteligent guess based on the user rights and system capabilities", default="auto"),
+    ]
+
+    takes_args = ["smbconf", "targetdir"]
+
+    def run(self, smbconf=None, targetdir=None, libdir=None, testparm=None, 
+            quiet=None, use_xattrs=None, sambaopts=None, versionopts=None):
+
+        if not os.path.exists(smbconf):
+            raise CommandError("File %s does not exist" % smbconf)
+        
+        if not os.path.isdir(targetdir):
+            raise CommandError("Directory %s does not exist" % targetdir)
+
+        if testparm and not os.path.exists(testparm):
+            raise CommandError("Testparm utility %s does not exist" % testparm)
+
+        if libdir and not os.path.exists(libdir):
+            raise CommandError("Directory %s does not exist" % libdir)
+
+        if not libdir and not testparm:
+            raise CommandError("Please specify either libdir or testparm")
+
+        if libdir and testparm:
+            self.outf.write("warning: both libdir and testparm specified, ignoring libdir.\n")
+            libdir = None
+
+        logger = logging.getLogger("upgrade")
+        logger.addHandler(logging.StreamHandler(sys.stdout))
+        if quiet:
+        	logger.setLevel(logging.WARNING)
+        else:
+        	logger.setLevel(logging.INFO)
+
+        lp = sambaopts.get_loadparm()
+        realm = lp.get("realm")
+
+        s3conf = s3param.get_context()
+
+        if realm:
+            s3conf.set("realm", realm)
+
+        eadb = True
+        if use_xattrs == "yes":
+        	eadb = False
+        elif use_xattrs == "auto" and not s3conf.get("posix:eadb"):
+        	tmpfile = tempfile.NamedTemporaryFile()
+    	try:
+    		samba.ntacls.setntacl(lp, tmpfile.name,
+    			"O:S-1-5-32G:S-1-5-32", "S-1-5-32", "native")
+    		eadb = False
+    	except:
+    		logger.info("You are not root or your system do not support xattr, using tdb backend for attributes. "
+			    "If you intend to use this provision in production, rerun the script as root on a system supporting xattrs.")
+    	tmpfile.close()
+
+        # Set correct default values from libdir or testparm
+        paths = {}
+        if libdir:
+            paths["state directory"] = libdir
+            paths["private dir"] = libdir
+            paths["lock directory"] = libdir
+        else:
+            paths["state directory"] = get_testparm_var(testparm, "state directory")
+            paths["private dir"] = get_testparm_var(testparm, "private dir")
+            paths["lock directory"] = get_testparm_var(testparm, "lock directory")
+    
+        for p in paths:
+            s3conf.set(p, paths[p])
+    
+        # load smb.conf parameters
+        logger.info("Reading smb.conf")
+        s3conf.load(smbconf)
+        samba3 = Samba3(smbconf, s3conf)
+    
+        logger.info("Provisioning")
+        upgrade_from_samba3(samba3, logger, targetdir, session_info=system_session(), 
+                            useeadb=eadb)
+
 
 class cmd_domain(SuperCommand):
     """Domain management"""
@@ -522,3 +627,4 @@ class cmd_domain(SuperCommand):
     subcommands["level"] = cmd_domain_level()
     subcommands["machinepassword"] = cmd_domain_machinepassword()
     subcommands["passwordsettings"] = cmd_domain_passwordsettings()
+    subcommands["samba3upgrade"] = cmd_domain_samba3upgrade()
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index 9c28157..9f49f44 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -1784,6 +1784,10 @@ def provision(logger, session_info, credentials, smbconf=None,
                     dnsdomain=names.dnsdomain,
                     dns_keytab_path=paths.dns_keytab, dnspass=dnspass)
 
+                # Default DNS backend is BIND9 using txt files for zone information 
+                if not dns_backend:
+                    dns_backend = "BIND9"
+
                 setup_ad_dns(samdb, names, logger, hostip=hostip, hostip6=hostip6,
                             dns_backend=dns_backend, os_level=dom_for_fun_level)
 
@@ -1791,15 +1795,18 @@ def provision(logger, session_info, credentials, smbconf=None,
                     attribute="objectGUID")
                 assert isinstance(domainguid, str)
 
+                create_dns_dir(logger, paths)
+
                 # Only make a zone file on the first DC, it should be
                 # replicated with DNS replication
-                create_zone_file(lp, logger, paths, targetdir,
-                    dnsdomain=names.dnsdomain, hostip=hostip, hostip6=hostip6,
-                    hostname=names.hostname, realm=names.realm,
-                    domainguid=domainguid, ntdsguid=names.ntdsguid)
+                if dns_backend == "BIND9":
+                    create_zone_file(lp, logger, paths, targetdir,
+                        dnsdomain=names.dnsdomain, hostip=hostip, hostip6=hostip6,
+                        hostname=names.hostname, realm=names.realm,
+                        domainguid=domainguid, ntdsguid=names.ntdsguid)
 
                 create_named_conf(paths, realm=names.realm,
-                    dnsdomain=names.dnsdomain, private_dir=paths.private_dir)
+                    dnsdomain=names.dnsdomain, dns_backend=dns_backend)
 
                 create_named_txt(paths.namedtxt,
                     realm=names.realm, dnsdomain=names.dnsdomain,
@@ -1940,6 +1947,32 @@ def create_phpldapadmin_config(path, ldapi_uri):
             {"S4_LDAPI_URI": ldapi_uri})
 
 
+def create_dns_dir(logger, paths):
+    """Write out a DNS zone file, from the info in the current database.
+


-- 
Samba Shared Repository


More information about the samba-cvs mailing list