[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Mon Mar 31 16:55:04 MDT 2014


The branch, master has been updated
       via  d550acf rpcclient: abort shadow-copy set on commit failure
       via  cbc6082 torture: test FSRVP UNCs with and without trailing slashes
       via  d9bc82d rpcclient: append a trailing slash to FSRVP request UNCs
       via  cb435fd messaging4: Simplify irpc_namedb_open a bit
       via  1f43a4c messaging4: Remove lp_ctx from imessaging_context
       via  27d2cd4 messaging4: Store a names_db handle in the imessaging_context
       via  da8b009 messaging4: Add some NULL checks
       via  193bd7d messaging4: Add "goto fail" to imessaging_init
       via  d6db35d tdb_wrap: Remove tdb_wrap_open_ again
       via  f995c6e ntvfs: Avoid passing lp_ctx to tdb_wrap_open in py_wrap_setxattr
       via  328afb8 mutex: Avoid passing lp_ctx to tdb_wrap_open in grab_named_mutex
       via  994d755 dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_ctdb
       via  604b970 serverid: Avoid passing lp_ctx to tdb_wrap_open in serverid_parent_init
       via  801b947 vfs: Avoid passing lp_ctx to tdb_wrap_open in posix_eadb_init
       via  12b8df1 messaging: Avoid passing lp_ctx to tdb_wrap_open in messaging_tdb_parent_init
       via  d169d0d messaging: Avoid passing lp_ctx to tdb_wrap_open in messaging_tdb_init
       via  acbc1ed dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_tdb
       via  db630a5 imessaging: Avoid passing lp_ctx to tdb_wrap_open in irpc_namedb_open
       via  0b59f05 ntvfs: Avoid passing lp_ctx to tdb_wrap_open in py_wrap_getxattr
       via  3a0ea07 ntvfs: Avoid passing lp_ctx to tdb_wrap_open in pvfs_setup_options
       via  2ae3565 torture: Avoid passing lp_ctx to tdb_wrap_open in test_tdb_speed
       via  eee3723 dsdb: Avoid passing lp_ctx to tdb_wrap_open in partition_metadata_open
       via  76318ac dsdb: Avoid passing lp_ctx to tdb_wrap_open in schema_metadata_open
       via  92d20d7 secrets: Avoid passing lp_ctx to tdb_wrap_open in randseed_init
       via  e2e06b3 param: Add lpcfg_tdb_flags()
       via  6008e8f param: Add lpcfg_tdb_hash_size()
       via  66e6ffd lib: Add interim tdb_wrap_open_ without lp_ctx
       via  ccec132 lib: Pull up lp_ctx use one level
       via  a9ebe2f lib: Fix blank line endings
       via  07b495b fix 2 typos
       via  465bb58 s3:rpcclient: fix build without HAVE_IPV6
      from  7667da6 ctdb-readonly: Do not use hard-coded value for readonly revoke timeout

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


- Log -----------------------------------------------------------------
commit d550acf24a8ec20e3e32891ed702c6cc42bc3dee
Author: David Disseldorp <ddiss at samba.org>
Date:   Sat Mar 29 02:18:20 2014 +0100

    rpcclient: abort shadow-copy set on commit failure
    
    Use similar behaviour to the diskshadow.exe FSRVP client, which aborts
    the shadow-copy set if it receives a failed commit response.
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Apr  1 00:54:06 CEST 2014 on sn-devel-104

commit cbc6082ec75ee97ae28d94ccfb92c3d93705798a
Author: David Disseldorp <ddiss at samba.org>
Date:   Sat Mar 29 02:18:19 2014 +0100

    torture: test FSRVP UNCs with and without trailing slashes
    
    The trailing slash should not make a difference, unless the target share
    is hidden.
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d9bc82d90d6c4425028e225cf470283dd3a98049
Author: David Disseldorp <ddiss at samba.org>
Date:   Sat Mar 29 02:18:18 2014 +0100

    rpcclient: append a trailing slash to FSRVP request UNCs
    
    The Windows Server 2012 FSRVP server exhibits strange behaviour when
    exposing hidden shadow copy shares. If the hidden share UNC in the
    AddToShadowCopySet request includes a trailing backslash (e.g.
    "\\server\share$\"), then the new shadow-copy share will also be hidden
    (e.g. "\\server\share$@{ShadowCopy.ShadowCopyId}$").
    However, if the UNC does not include a trailing backslash, which until
    now was rpcclient's default behaviour, then the exposed shadow-copy
    share is not hidden.
    
    Thanks to the MS Open Specifications team for helping me track down this
    one.
    
    bug: https://bugzilla.samba.org/show_bug.cgi?id=10521
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit cb435fd493823fcfb300e4a293d8739fe365fe40
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 27 10:42:34 2014 +0000

    messaging4: Simplify irpc_namedb_open a bit
    
    It does not really need the msg_ctx, and it also removes the implicit talloc
    hierarchy.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1f43a4ccaf81eb787b68b185d58728b8af211557
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 27 10:18:05 2014 +0000

    messaging4: Remove lp_ctx from imessaging_context
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 27d2cd4daa79f46d9571fc51cf1bed29fd9c9c64
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 27 10:16:08 2014 +0000

    messaging4: Store a names_db handle in the imessaging_context
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit da8b009ff72b801b930830a31009d1edc5418aea
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 27 10:08:55 2014 +0000

    messaging4: Add some NULL checks
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 193bd7d9761ffd63487892b75e076ed2d46a9731
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 27 10:07:34 2014 +0000

    messaging4: Add "goto fail" to imessaging_init
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d6db35d7a564ee556b74131ef4c3a3cdb8097e14
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:41:03 2014 +0000

    tdb_wrap: Remove tdb_wrap_open_ again
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit f995c6e6d4bfe4a50ca0017c722bdfb329121958
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:19:16 2014 +0000

    ntvfs: Avoid passing lp_ctx to tdb_wrap_open in py_wrap_setxattr
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 328afb8d3e90f5d516dbe3a21ee80c2bd336a66d
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:35:31 2014 +0000

    mutex: Avoid passing lp_ctx to tdb_wrap_open in grab_named_mutex
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 994d75574b695bd335aa3bb1c9c9334c5a6b4b19
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:32:58 2014 +0000

    dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_ctdb
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 604b970d676fa9561781b0be6b373283410fa8ea
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:31:16 2014 +0000

    serverid: Avoid passing lp_ctx to tdb_wrap_open in serverid_parent_init
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 801b947e12530d9756aa687056362d497f198491
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:28:57 2014 +0000

    vfs: Avoid passing lp_ctx to tdb_wrap_open in posix_eadb_init
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 12b8df1ba277ffc8e48b4c96aa4e48bf36e4e220
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:35:31 2014 +0000

    messaging: Avoid passing lp_ctx to tdb_wrap_open in messaging_tdb_parent_init
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d169d0d9e2a22b96d1d41e9e4adde524965509c7
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:35:31 2014 +0000

    messaging: Avoid passing lp_ctx to tdb_wrap_open in messaging_tdb_init
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit acbc1ed7037e5fab550ca33c8c86dd4d919cd59a
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:26:24 2014 +0000

    dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_tdb
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit db630a525348d84dcf572f8d55639071a798894c
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:20:44 2014 +0000

    imessaging: Avoid passing lp_ctx to tdb_wrap_open in irpc_namedb_open
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 0b59f05de794d919eb60210072f10f009d1c396c
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:19:16 2014 +0000

    ntvfs: Avoid passing lp_ctx to tdb_wrap_open in py_wrap_getxattr
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3a0ea071ad060c48284e66e9503c8e528a7b11d3
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:17:07 2014 +0000

    ntvfs: Avoid passing lp_ctx to tdb_wrap_open in pvfs_setup_options
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 2ae3565a55daee5a62108172075fc419c6f5450b
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:14:45 2014 +0000

    torture: Avoid passing lp_ctx to tdb_wrap_open in test_tdb_speed
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit eee3723df0fef75a3adaa5ae2ec55fd523e3a126
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:12:24 2014 +0000

    dsdb: Avoid passing lp_ctx to tdb_wrap_open in partition_metadata_open
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 76318acc608dc99da30719495c5e5ef19c0c9a7b
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:11:21 2014 +0000

    dsdb: Avoid passing lp_ctx to tdb_wrap_open in schema_metadata_open
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 92d20d77b1d9bc32bc971454016adabd8de79587
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:08:40 2014 +0000

    secrets: Avoid passing lp_ctx to tdb_wrap_open in randseed_init
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit e2e06b342a826bcbb6e6a116edf2ffc4fd43ad22
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:06:08 2014 +0000

    param: Add lpcfg_tdb_flags()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 6008e8f9447603f3c93e308bc3c1fc9a961bbbfd
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 14:04:41 2014 +0000

    param: Add lpcfg_tdb_hash_size()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 66e6ffd666f96ebd3be956a57f23f3436512b4c9
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 13:36:48 2014 +0000

    lib: Add interim tdb_wrap_open_ without lp_ctx
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ccec132502586ce5dd93617dd92d9e117b703cc1
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 13:32:16 2014 +0000

    lib: Pull up lp_ctx use one level
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit a9ebe2f71a067fac0b0dd1187037e820283077b9
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 26 13:08:13 2014 +0000

    lib: Fix blank line endings
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 07b495b271821f5cc397e28cc8ba0b0255bd51c2
Author: Guenter Kukkukk <linux at kukkukk.com>
Date:   Fri Mar 28 00:05:02 2014 +0100

    fix 2 typos
    
    Signed-off-by: Guenter Kukkukk <linux at kukkukk.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 465bb58fed360c6637c0731ef93ec8700a9a3726
Author: Gregor Beck <gbeck at sernet.de>
Date:   Wed Mar 26 09:30:24 2014 +0100

    s3:rpcclient: fix build without HAVE_IPV6
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 lib/dbwrap/dbwrap_tdb.c                            |   10 +-
 lib/param/loadparm.c                               |   27 ++++
 lib/param/wscript_build                            |    2 +-
 lib/tdb_wrap/tdb_wrap.c                            |   25 +---
 lib/tdb_wrap/tdb_wrap.h                            |    3 +-
 python/samba/netcmd/domain.py                      |    4 +-
 source3/lib/dbwrap/dbwrap_ctdb.c                   |    9 +-
 source3/lib/messages_local.c                       |   22 ++-
 source3/lib/server_mutex.c                         |   16 ++-
 source3/lib/serverid.c                             |   12 +-
 source3/modules/vfs_posix_eadb.c                   |    4 +-
 source3/rpcclient/cmd_fss.c                        |   57 ++++++-
 source3/rpcclient/cmd_witness.c                    |   19 ++-
 .../dsdb/samdb/ldb_modules/partition_metadata.c    |    6 +-
 source4/dsdb/samdb/ldb_modules/schema_load.c       |    4 +-
 source4/lib/messaging/messaging.c                  |  155 +++++++++-----------
 source4/ntvfs/posix/python/pyposix_eadb.c          |   15 ++-
 source4/ntvfs/posix/vfs_posix.c                    |    7 +-
 source4/param/secrets.c                            |    5 +-
 source4/torture/local/dbspeed.c                    |    5 +-
 source4/torture/rpc/fsrvp.c                        |   11 +-
 21 files changed, 251 insertions(+), 167 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/dbwrap/dbwrap_tdb.c b/lib/dbwrap/dbwrap_tdb.c
index 1b061e3..a76d90f 100644
--- a/lib/dbwrap/dbwrap_tdb.c
+++ b/lib/dbwrap/dbwrap_tdb.c
@@ -25,6 +25,7 @@
 #include "lib/util/util_tdb.h"
 #include "system/filesys.h"
 #include "ccan/str/str.h"
+#include "lib/param/param.h"
 
 struct db_tdb_ctx {
 	struct tdb_wrap *wtdb;
@@ -427,8 +428,13 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
 	}
 	result->lock_order = lock_order;
 
-	db_tdb->wtdb = tdb_wrap_open(db_tdb, name, hash_size, tdb_flags,
-				     open_flags, mode, lp_ctx);
+	if (hash_size == 0) {
+		hash_size = lpcfg_tdb_hash_size(lp_ctx, name);
+	}
+
+	db_tdb->wtdb = tdb_wrap_open(db_tdb, name, hash_size,
+				     lpcfg_tdb_flags(lp_ctx, tdb_flags),
+				     open_flags, mode);
 	if (db_tdb->wtdb == NULL) {
 		DEBUG(3, ("Could not open tdb: %s\n", strerror(errno)));
 		goto fail;
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 51053ba..fd5e5e3 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -66,6 +66,7 @@
 #include "lib/param/s3_param.h"
 #include "lib/util/bitmap.h"
 #include "libcli/smb/smb_constants.h"
+#include "tdb.h"
 
 #define standard_sub_basic talloc_strdup
 
@@ -2778,3 +2779,29 @@ bool lpcfg_server_signing_allowed(struct loadparm_context *lp_ctx, bool *mandato
 
 	return allowed;
 }
+
+int lpcfg_tdb_hash_size(struct loadparm_context *lp_ctx, const char *name)
+{
+	const char *base;
+
+	if (name == NULL) {
+		return 0;
+	}
+
+	base = strrchr_m(name, '/');
+	if (base != NULL) {
+		base += 1;
+	} else {
+		base = name;
+	}
+	return lpcfg_parm_int(lp_ctx, NULL, "tdb_hashsize", base, 0);
+
+}
+
+int lpcfg_tdb_flags(struct loadparm_context *lp_ctx, int tdb_flags)
+{
+	if (!lpcfg_use_mmap(lp_ctx)) {
+		tdb_flags |= TDB_NOMMAP;
+	}
+	return tdb_flags;
+}
diff --git a/lib/param/wscript_build b/lib/param/wscript_build
index 8fe751c..3c72a73 100644
--- a/lib/param/wscript_build
+++ b/lib/param/wscript_build
@@ -33,7 +33,7 @@ bld.SAMBA_LIBRARY('samba-hostconfig',
 	source='loadparm.c generic.c util.c',
 	pc_files='samba-hostconfig.pc',
 	vnum='0.0.1',
-	deps='DYNCONFIG server-role',
+	deps='DYNCONFIG server-role tdb',
 	public_deps='samba-util param_local.h',
 	public_headers='param.h',
 	autoproto='param_proto.h'
diff --git a/lib/tdb_wrap/tdb_wrap.c b/lib/tdb_wrap/tdb_wrap.c
index 312d17f..970c91f 100644
--- a/lib/tdb_wrap/tdb_wrap.c
+++ b/lib/tdb_wrap/tdb_wrap.c
@@ -88,8 +88,7 @@ static struct tdb_wrap_private *tdb_wrap_private_open(TALLOC_CTX *mem_ctx,
 						      int hash_size,
 						      int tdb_flags,
 						      int open_flags,
-						      mode_t mode,
-						      struct loadparm_context *lp_ctx)
+						      mode_t mode)
 {
 	struct tdb_wrap_private *result;
 	struct tdb_logging_context lctx;
@@ -103,22 +102,6 @@ static struct tdb_wrap_private *tdb_wrap_private_open(TALLOC_CTX *mem_ctx,
 		goto fail;
 	}
 
-	if (!lpcfg_use_mmap(lp_ctx)) {
-		tdb_flags |= TDB_NOMMAP;
-	}
-
-	if ((hash_size == 0) && (name != NULL)) {
-		const char *base;
-		base = strrchr_m(name, '/');
-
-		if (base != NULL) {
-			base += 1;
-		} else {
-			base = name;
-		}
-		hash_size = lpcfg_parm_int(lp_ctx, NULL, "tdb_hashsize", base, 0);
-	}
-
 	lctx.log_fn = tdb_wrap_log;
 	lctx.log_private = NULL;
 
@@ -142,8 +125,7 @@ fail:
  */
 struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
 			       const char *name, int hash_size, int tdb_flags,
-			       int open_flags, mode_t mode,
-			       struct loadparm_context *lp_ctx)
+			       int open_flags, mode_t mode)
 {
 	struct tdb_wrap *result;
 	struct tdb_wrap_private *w;
@@ -168,7 +150,7 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
 
 	if (w == NULL) {
 		w = tdb_wrap_private_open(result, name, hash_size, tdb_flags,
-					  open_flags, mode, lp_ctx);
+					  open_flags, mode);
 	} else {
 		/*
 		 * Correctly use talloc_reference: The tdb will be
@@ -193,4 +175,3 @@ fail:
 	TALLOC_FREE(result);
 	return NULL;
 }
-
diff --git a/lib/tdb_wrap/tdb_wrap.h b/lib/tdb_wrap/tdb_wrap.h
index 3e1fb83..e44aed6 100644
--- a/lib/tdb_wrap/tdb_wrap.h
+++ b/lib/tdb_wrap/tdb_wrap.h
@@ -39,7 +39,6 @@ struct loadparm_context;
 
 struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
 			       const char *name, int hash_size, int tdb_flags,
-			       int open_flags, mode_t mode,
-			       struct loadparm_context *lp_ctx);
+			       int open_flags, mode_t mode);
 
 #endif /* _TDB_WRAP_H_ */
diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py
index 9824da1..2765902 100644
--- a/python/samba/netcmd/domain.py
+++ b/python/samba/netcmd/domain.py
@@ -850,7 +850,7 @@ class cmd_domain_demote(Command):
             remote_samdb.rename(newdn, dc_dn)
             raise CommandError("Error while sending a removeDsServer", e)
 
-        for s in ("CN=Entreprise,CN=Microsoft System Volumes,CN=System,CN=Configuration",
+        for s in ("CN=Enterprise,CN=Microsoft System Volumes,CN=System,CN=Configuration",
                   "CN=%s,CN=Microsoft System Volumes,CN=System,CN=Configuration" % lp.get("realm"),
                   "CN=Domain System Volumes (SYSVOL share),CN=File Replication Service,CN=System"):
             try:
@@ -859,7 +859,7 @@ class cmd_domain_demote(Command):
             except ldb.LdbError, l:
                 pass
 
-        for s in ("CN=Entreprise,CN=NTFRS Subscriptions",
+        for s in ("CN=Enterprise,CN=NTFRS Subscriptions",
                   "CN=%s, CN=NTFRS Subscriptions" % lp.get("realm"),
                   "CN=Domain system Volumes (SYSVOL Share), CN=NTFRS Subscriptions",
                   "CN=NTFRS Subscriptions"):
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index b113344..7cf90ce 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1661,8 +1661,13 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
 
 	lp_ctx = loadparm_init_s3(db_path, loadparm_s3_helpers());
 
-	db_ctdb->wtdb = tdb_wrap_open(db_ctdb, db_path, hash_size, tdb_flags,
-				      O_RDWR, 0, lp_ctx);
+	if (hash_size == 0) {
+		hash_size = lpcfg_tdb_hash_size(lp_ctx, db_path);
+	}
+
+	db_ctdb->wtdb = tdb_wrap_open(db_ctdb, db_path, hash_size,
+				      lpcfg_tdb_flags(lp_ctx, tdb_flags),
+				      O_RDWR, 0);
 	talloc_unlink(db_path, lp_ctx);
 	if (db_ctdb->wtdb == NULL) {
 		DEBUG(0, ("Could not open tdb %s: %s\n", db_path, strerror(errno)));
diff --git a/source3/lib/messages_local.c b/source3/lib/messages_local.c
index acc5ba6..1fe89c3 100644
--- a/source3/lib/messages_local.c
+++ b/source3/lib/messages_local.c
@@ -92,6 +92,7 @@ NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx,
 	struct messaging_tdb_context *ctx;
 	struct loadparm_context *lp_ctx;
 	static bool have_context = false;
+	const char *fname;
 
 	if (have_context) {
 		DEBUG(0, ("No two messaging contexts per process\n"));
@@ -122,9 +123,14 @@ NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx,
 	ctx->msg_ctx = msg_ctx;
 	ctx->have_context = &have_context;
 
-	ctx->tdb = tdb_wrap_open(ctx, lock_path("messages.tdb"), 0,
-				 TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_VOLATILE|TDB_INCOMPATIBLE_HASH,
-				 O_RDWR|O_CREAT,0600, lp_ctx);
+	fname = lock_path("messages.tdb");
+
+	ctx->tdb = tdb_wrap_open(
+		ctx, fname, lpcfg_tdb_hash_size(lp_ctx, fname),
+		lpcfg_tdb_flags(lp_ctx, TDB_CLEAR_IF_FIRST|TDB_DEFAULT|
+				TDB_VOLATILE| TDB_INCOMPATIBLE_HASH),
+		O_RDWR|O_CREAT,0600);
+
 	talloc_unlink(result, lp_ctx);
 
 	if (!ctx->tdb) {
@@ -168,6 +174,7 @@ bool messaging_tdb_parent_init(TALLOC_CTX *mem_ctx)
 {
 	struct tdb_wrap *db;
 	struct loadparm_context *lp_ctx;
+	const char *fname;
 
 	lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_helpers());
 	if (lp_ctx == NULL) {
@@ -181,9 +188,12 @@ bool messaging_tdb_parent_init(TALLOC_CTX *mem_ctx)
 	 * work.
 	 */
 
-	db = tdb_wrap_open(mem_ctx, lock_path("messages.tdb"), 0,
-			   TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_VOLATILE|TDB_INCOMPATIBLE_HASH,
-			   O_RDWR|O_CREAT,0600, lp_ctx);
+	fname = lock_path("messages.tdb");
+	db = tdb_wrap_open(
+		mem_ctx, fname, lpcfg_tdb_hash_size(lp_ctx, fname),
+		lpcfg_tdb_flags(lp_ctx, TDB_CLEAR_IF_FIRST|TDB_DEFAULT|
+				TDB_VOLATILE|TDB_INCOMPATIBLE_HASH),
+		O_RDWR|O_CREAT,0600);
 	talloc_unlink(mem_ctx, lp_ctx);
 	if (db == NULL) {
 		DEBUG(1, ("could not open messaging.tdb: %s\n",
diff --git a/source3/lib/server_mutex.c b/source3/lib/server_mutex.c
index c86047b..43cf77b 100644
--- a/source3/lib/server_mutex.c
+++ b/source3/lib/server_mutex.c
@@ -48,6 +48,8 @@ struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name,
 {
 	struct named_mutex *result;
 	struct loadparm_context *lp_ctx;
+	const char *fname;
+
 	result = talloc(mem_ctx, struct named_mutex);
 	if (result == NULL) {
 		DEBUG(0, ("talloc failed\n"));
@@ -68,11 +70,15 @@ struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name,
 		return NULL;
 	}
 
-	result->tdb = tdb_wrap_open(result, lock_path("mutex.tdb"), 0,
-				    TDB_DEFAULT |
-				    TDB_CLEAR_IF_FIRST |
-				    TDB_INCOMPATIBLE_HASH,
-				    O_RDWR|O_CREAT, 0600, lp_ctx);
+	fname = lock_path("mutex.tdb");
+
+	result->tdb = tdb_wrap_open(result, fname,
+				    lpcfg_tdb_hash_size(lp_ctx, fname),
+				    lpcfg_tdb_flags(lp_ctx,
+						    TDB_DEFAULT |
+						    TDB_CLEAR_IF_FIRST |
+						    TDB_INCOMPATIBLE_HASH),
+				    O_RDWR|O_CREAT, 0600);
 	talloc_unlink(result, lp_ctx);
 	if (result->tdb == NULL) {
 		DEBUG(1, ("Could not open mutex.tdb: %s\n",
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index 5d59818..48b09f7 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -43,6 +43,7 @@ bool serverid_parent_init(TALLOC_CTX *mem_ctx)
 {
 	struct tdb_wrap *db;
 	struct loadparm_context *lp_ctx;
+	const char *fname;
 
 	lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_helpers());
 	if (lp_ctx == NULL) {
@@ -56,9 +57,14 @@ bool serverid_parent_init(TALLOC_CTX *mem_ctx)
 	 * work.
 	 */
 
-	db = tdb_wrap_open(mem_ctx, lock_path("serverid.tdb"),
-			   0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT,
-			   0644, lp_ctx);
+	fname = lock_path("serverid.tdb");
+
+	db = tdb_wrap_open(mem_ctx, fname,
+			   lpcfg_tdb_hash_size(lp_ctx, fname),
+			   lpcfg_tdb_flags(lp_ctx,
+					   TDB_DEFAULT|TDB_CLEAR_IF_FIRST|
+					   TDB_INCOMPATIBLE_HASH),
+			   O_RDWR|O_CREAT, 0644);
 	talloc_unlink(mem_ctx, lp_ctx);
 	if (db == NULL) {
 		DEBUG(1, ("could not open serverid.tdb: %s\n",
diff --git a/source3/modules/vfs_posix_eadb.c b/source3/modules/vfs_posix_eadb.c
index d188780..27996db 100644
--- a/source3/modules/vfs_posix_eadb.c
+++ b/source3/modules/vfs_posix_eadb.c
@@ -257,8 +257,8 @@ static bool posix_eadb_init(int snum, struct tdb_wrap **p_db)
 
 	become_root();
 	db = tdb_wrap_open(NULL, eadb, 50000,
-			   TDB_DEFAULT, O_RDWR|O_CREAT, 0600,
-			   lp_ctx);
+			   lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT),
+			   O_RDWR|O_CREAT, 0600);
 
 	unbecome_root();
 	talloc_unlink(NULL, lp_ctx);
diff --git a/source3/rpcclient/cmd_fss.c b/source3/rpcclient/cmd_fss.c
index 238bd79..945f4d9 100644
--- a/source3/rpcclient/cmd_fss.c
+++ b/source3/rpcclient/cmd_fss.c
@@ -136,7 +136,7 @@ static NTSTATUS cmd_fss_is_path_sup(struct rpc_pipe_client *cli,
 	}
 
 	ZERO_STRUCT(r);
-	r.in.ShareName = talloc_asprintf(mem_ctx, "%s\\%s",
+	r.in.ShareName = talloc_asprintf(mem_ctx, "%s\\%s\\",
 					 cli->srv_name_slash, argv[1]);
 	if (r.in.ShareName == NULL) {
 		return NT_STATUS_NO_MEMORY;
@@ -235,8 +235,24 @@ static NTSTATUS cmd_fss_create_expose_parse(TALLOC_CTX *mem_ctx, int argc,
 	}
 
 	for (i = 0; i < num_share_args; i++) {
-		map_array[i].ShareNameUNC = talloc_asprintf(mem_ctx, "\\\\%s\\%s",
-					desthost, argv[i + num_non_share_args]);
+		/*
+		 * A trailing slash should to be present in the request UNC,
+		 * otherwise Windows Server 2012 FSRVP servers don't append
+		 * a '$' to exposed hidden share shadow-copies. E.g.
+		 *   AddToShadowCopySet(UNC=\\server\hidden$)
+		 *   CommitShadowCopySet()
+		 *   ExposeShadowCopySet()
+		 *   -> new share = \\server\hidden$@{ShadowCopy.ShadowCopyId}
+		 * But...
+		 *   AddToShadowCopySet(UNC=\\server\hidden$\)
+		 *   CommitShadowCopySet()
+		 *   ExposeShadowCopySet()
+		 *   -> new share = \\server\hidden$@{ShadowCopy.ShadowCopyId}$
+		 */
+		map_array[i].ShareNameUNC = talloc_asprintf(mem_ctx,
+							    "\\\\%s\\%s\\",
+							    desthost,
+						argv[i + num_non_share_args]);
 		if (map_array[i].ShareNameUNC == NULL) {
 			return NT_STATUS_NO_MEMORY;
 		}
@@ -247,6 +263,24 @@ static NTSTATUS cmd_fss_create_expose_parse(TALLOC_CTX *mem_ctx, int argc,
 	return NT_STATUS_OK;
 }
 
+static NTSTATUS cmd_fss_abort(TALLOC_CTX *mem_ctx,
+			      struct dcerpc_binding_handle *b,
+			      struct GUID *sc_set_id)
+{
+	NTSTATUS status;
+	struct fss_AbortShadowCopySet r_scset_abort;
+
+	ZERO_STRUCT(r_scset_abort);
+	r_scset_abort.in.ShadowCopySetId = *sc_set_id;
+	status = dcerpc_fss_AbortShadowCopySet_r(b, mem_ctx, &r_scset_abort);
+	if (!NT_STATUS_IS_OK(status) || (r_scset_abort.out.result != 0)) {
+		DEBUG(0, ("AbortShadowCopySet failed: %s result: 0x%x\n",
+			  nt_errstr(status), r_scset_abort.out.result));
+		return NT_STATUS_UNSUCCESSFUL;
+	}
+	return NT_STATUS_OK;
+}
+
 static NTSTATUS cmd_fss_create_expose(struct rpc_pipe_client *cli,
 				     TALLOC_CTX *mem_ctx, int argc,
 				     const char **argv)
@@ -340,7 +374,7 @@ static NTSTATUS cmd_fss_create_expose(struct rpc_pipe_client *cli,
 		if (!NT_STATUS_IS_OK(status) || (r_scset_add.out.result != 0)) {
 			DEBUG(0, ("AddToShadowCopySet failed: %s result: 0x%x\n",
 				  nt_errstr(status), r_scset_add.out.result));
-			goto err_out;
+			goto err_sc_set_abort;
 		}
 		printf("%s(%s): %s shadow-copy added to set\n",
 		       GUID_string(tmp_ctx, r_scset_start.out.pShadowCopySetId),
@@ -358,7 +392,7 @@ static NTSTATUS cmd_fss_create_expose(struct rpc_pipe_client *cli,
 	if (!NT_STATUS_IS_OK(status) || (r_scset_prep.out.result != 0)) {
 		DEBUG(0, ("PrepareShadowCopySet failed: %s result: 0x%x\n",
 			  nt_errstr(status), r_scset_prep.out.result));
-		goto err_out;
+		goto err_sc_set_abort;
 	}
 	printf("%s: prepare completed in %llu secs\n",
 	       GUID_string(tmp_ctx, r_scset_start.out.pShadowCopySetId),
@@ -372,7 +406,7 @@ static NTSTATUS cmd_fss_create_expose(struct rpc_pipe_client *cli,
 	if (!NT_STATUS_IS_OK(status) || (r_scset_commit.out.result != 0)) {
 		DEBUG(0, ("CommitShadowCopySet failed: %s result: 0x%x\n",
 			  nt_errstr(status), r_scset_commit.out.result));
-		goto err_out;
+		goto err_sc_set_abort;
 	}
 	printf("%s: commit completed in %llu secs\n",
 	       GUID_string(tmp_ctx, r_scset_start.out.pShadowCopySetId),
@@ -408,6 +442,11 @@ static NTSTATUS cmd_fss_create_expose(struct rpc_pipe_client *cli,
 		       map->ShadowCopyShareName, map->ShareNameUNC);
 	}
 
+	talloc_free(tmp_ctx);
+	return NT_STATUS_OK;
+
+err_sc_set_abort:
+	cmd_fss_abort(tmp_ctx, b, r_scset_start.out.pShadowCopySetId);
 err_out:
 	talloc_free(tmp_ctx);
 	return status;
@@ -443,7 +482,7 @@ static NTSTATUS cmd_fss_delete(struct rpc_pipe_client *cli,
 	}
 
 	ZERO_STRUCT(r_sharemap_del);
-	r_sharemap_del.in.ShareName = talloc_asprintf(tmp_ctx, "\\\\%s\\%s",
+	r_sharemap_del.in.ShareName = talloc_asprintf(tmp_ctx, "\\\\%s\\%s\\",
 						      cli->desthost, argv[1]);
 	if (r_sharemap_del.in.ShareName == NULL) {
 		status = NT_STATUS_NO_MEMORY;
@@ -497,7 +536,7 @@ static NTSTATUS cmd_fss_is_shadow_copied(struct rpc_pipe_client *cli,
 	}
 
 	ZERO_STRUCT(r);
-	r.in.ShareName = talloc_asprintf(mem_ctx, "%s\\%s",
+	r.in.ShareName = talloc_asprintf(mem_ctx, "%s\\%s\\",
 					 cli->srv_name_slash, argv[1]);
 	if (r.in.ShareName == NULL) {
 		return NT_STATUS_NO_MEMORY;
@@ -552,7 +591,7 @@ static NTSTATUS cmd_fss_get_mapping(struct rpc_pipe_client *cli,
 	}
 
 	ZERO_STRUCT(r_sharemap_get);
-	r_sharemap_get.in.ShareName = talloc_asprintf(tmp_ctx, "\\\\%s\\%s",
+	r_sharemap_get.in.ShareName = talloc_asprintf(tmp_ctx, "\\\\%s\\%s\\",
 						      cli->desthost, argv[1]);
 	if (r_sharemap_get.in.ShareName == NULL) {
 		status = NT_STATUS_NO_MEMORY;
diff --git a/source3/rpcclient/cmd_witness.c b/source3/rpcclient/cmd_witness.c
index f9e4c9e..1812449 100644
--- a/source3/rpcclient/cmd_witness.c
+++ b/source3/rpcclient/cmd_witness.c
@@ -366,8 +366,7 @@ static bool AsyncNotify_Move(TALLOC_CTX *mem_ctx, const uint8_t **ptr)
 	for (n=0; n<num; n++) {
 		uint32_t flags = IVAL(pos,0);
 		struct in_addr ipv4;
-		struct in6_addr ipv6;
-		struct sockaddr_storage sas4, sas6;
+		struct sockaddr_storage sas4;
 		char *str4, *str6;
 		pos += 4;
 
@@ -376,9 +375,19 @@ static bool AsyncNotify_Move(TALLOC_CTX *mem_ctx, const uint8_t **ptr)
 		str4 = print_canonical_sockaddr(mem_ctx, &sas4);
 		pos += 4;
 
-		memcpy(&ipv6.s6_addr, pos, 16);
-		in6_addr_to_sockaddr_storage(&sas6, ipv6);
-		str6 = print_canonical_sockaddr(mem_ctx, &sas6);
+		{
+#ifdef HAVE_IPV6
+			struct in6_addr ipv6;
+			struct sockaddr_storage sas6;
+
+			memcpy(&ipv6.s6_addr, pos, 16);
+			in6_addr_to_sockaddr_storage(&sas6, ipv6);
+			str6 = print_canonical_sockaddr(mem_ctx, &sas6);
+#else
+			DATA_BLOB ipv6 = data_blob(pos, 16);
+			str6 = data_blob_hex_string_upper(mem_ctx, &ipv6);
+#endif
+		}
 		pos += 16;
 
 		d_printf("Flags 0x%08x", flags);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list