The branch, master has been updated via 5ec63b8 s3:libsmb: fix some function header comments. via 5c60dc4 lib/ldb-samba: add ldif handler for msDS-TrustForestTrustInfo via 9114396 tdb_wrap: Make mutexes easier to use via c8d05e9 tdb: allow tdb_open_ex() with O_RDONLY of TDB_FEATURE_FLAG_MUTEX tdbs. from 553b83c s3:smbprofile: profile async pread/pwrite/fsync syscalls
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 5ec63b8bc1a16b1bbda7ec8e5442a1b3d6f2d13c Author: Michael Adam <ob...@samba.org> Date: Thu Nov 20 12:59:15 2014 +0100 s3:libsmb: fix some function header comments. Signed-off-by: Michael Adam <ob...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> Autobuild-User(master): Michael Adam <ob...@samba.org> Autobuild-Date(master): Thu Nov 20 18:45:28 CET 2014 on sn-devel-104 commit 5c60dc429f9d4c7d2869a5bbd4b582eab67c10db Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 19 12:24:47 2014 +0100 lib/ldb-samba: add ldif handler for msDS-TrustForestTrustInfo Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Michael Adam <ob...@samba.org> commit 911439639a2caa17a9680cb297e9fe26eba56149 Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 30 11:04:21 2014 +0000 tdb_wrap: Make mutexes easier to use This patch makes sure we work fine and open without mutexes if they are not supported. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Michael Adam <ob...@samba.org> commit c8d05e934ea03fffbc34944d2d51a016b89a7eca Author: Stefan Metzmacher <me...@samba.org> Date: Tue Nov 4 09:51:51 2014 +0100 tdb: allow tdb_open_ex() with O_RDONLY of TDB_FEATURE_FLAG_MUTEX tdbs. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10781 Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Michael Adam <ob...@samba.org> ----------------------------------------------------------------------- Summary of changes: lib/ldb-samba/ldif_handlers.c | 20 ++++++++++++++++++++ lib/ldb-samba/ldif_handlers.h | 1 + lib/tdb/common/open.c | 18 +++++++++--------- lib/tdb_wrap/tdb_wrap.c | 7 +++++++ source3/libsmb/libsmb_setget.c | 6 +++--- 5 files changed, 40 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/ldb-samba/ldif_handlers.c b/lib/ldb-samba/ldif_handlers.c index d9d799c..cf5e3ca 100644 --- a/lib/ldb-samba/ldif_handlers.c +++ b/lib/ldb-samba/ldif_handlers.c @@ -960,6 +960,18 @@ static int ldif_write_trustAuthInOutBlob(struct ldb_context *ldb, void *mem_ctx, } /* + convert a NDR formatted blob to a ldif formatted msDS-TrustForestTrustInfo +*/ +static int ldif_write_ForestTrustInfo(struct ldb_context *ldb, void *mem_ctx, + const struct ldb_val *in, struct ldb_val *out) +{ + return ldif_write_NDR(ldb, mem_ctx, in, out, + sizeof(struct ForestTrustInfo), + (ndr_pull_flags_fn_t)ndr_pull_ForestTrustInfo, + (ndr_print_fn_t)ndr_print_ForestTrustInfo, + true); +} +/* convert a NDR formatted blob of a partialAttributeSet into text */ static int ldif_write_partialAttributeSet(struct ldb_context *ldb, void *mem_ctx, @@ -1332,6 +1344,13 @@ static const struct ldb_schema_syntax samba_syntaxes[] = { .comparison_fn = ldb_comparison_binary, .operator_fn = samba_syntax_operator_fn },{ + .name = LDB_SYNTAX_SAMBA_FORESTTRUSTINFO, + .ldif_read_fn = ldb_handler_copy, + .ldif_write_fn = ldif_write_ForestTrustInfo, + .canonicalise_fn = ldb_handler_copy, + .comparison_fn = ldb_comparison_binary, + .operator_fn = samba_syntax_operator_fn + },{ .name = DSDB_SYNTAX_BINARY_DN, .ldif_read_fn = ldb_handler_copy, .ldif_write_fn = ldb_handler_copy, @@ -1460,6 +1479,7 @@ static const struct { { "replUpToDateVector", LDB_SYNTAX_SAMBA_REPLUPTODATEVECTOR }, { "trustAuthIncoming", LDB_SYNTAX_SAMBA_TRUSTAUTHINOUTBLOB }, { "trustAuthOutgoing", LDB_SYNTAX_SAMBA_TRUSTAUTHINOUTBLOB }, + { "msDS-TrustForestTrustInfo", LDB_SYNTAX_SAMBA_FORESTTRUSTINFO }, { "rIDAllocationPool", LDB_SYNTAX_SAMBA_RANGE64 }, { "rIDPreviousAllocationPool", LDB_SYNTAX_SAMBA_RANGE64 }, { "rIDAvailablePool", LDB_SYNTAX_SAMBA_RANGE64 }, diff --git a/lib/ldb-samba/ldif_handlers.h b/lib/ldb-samba/ldif_handlers.h index 41a2208..4e12293 100644 --- a/lib/ldb-samba/ldif_handlers.h +++ b/lib/ldb-samba/ldif_handlers.h @@ -17,6 +17,7 @@ #define LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS "LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS" #define LDB_SYNTAX_SAMBA_SDDL_SECURITY_DESCRIPTOR "LDB_SYNTAX_SAMBA_SDDL" #define LDB_SYNTAX_SAMBA_TRUSTAUTHINOUTBLOB "LDB_SYNTAX_SAMBA_TRUSTAUTHINOUTBLOB" +#define LDB_SYNTAX_SAMBA_FORESTTRUSTINFO "LDB_SYNTAX_SAMBA_FORESTTRUSTINFO" #define LDB_SYNTAX_SAMBA_PARTIALATTRIBUTESET "LDB_SYNTAX_SAMBA_PARTIALATTRIBUTESET" #include "lib/ldb-samba/ldif_handlers_proto.h" diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c index 16a76a3..3b53fa7 100644 --- a/lib/tdb/common/open.c +++ b/lib/tdb/common/open.c @@ -232,6 +232,14 @@ static bool tdb_mutex_open_ok(struct tdb_context *tdb, { int locked; + if (tdb->flags & TDB_NOLOCK) { + /* + * We don't look at locks, so it does not matter to have a + * compatible mutex implementation. Allow the open. + */ + return true; + } + locked = tdb_nest_lock(tdb, ACTIVE_LOCK, F_WRLCK, TDB_LOCK_NOWAIT|TDB_LOCK_PROBE); @@ -261,14 +269,6 @@ static bool tdb_mutex_open_ok(struct tdb_context *tdb, return false; } - if (tdb->flags & TDB_NOLOCK) { - /* - * We don't look at locks, so it does not matter to have a - * compatible mutex implementation. Allow the open. - */ - return true; - } - check_local_settings: if (!(tdb->flags & TDB_MUTEX_LOCKING)) { @@ -399,7 +399,7 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td tdb->read_only = 1; /* read only databases don't do locking or clear if first */ tdb->flags |= TDB_NOLOCK; - tdb->flags &= ~TDB_CLEAR_IF_FIRST; + tdb->flags &= ~(TDB_CLEAR_IF_FIRST|TDB_MUTEX_LOCKING); } if ((tdb->flags & TDB_ALLOW_NESTING) && diff --git a/lib/tdb_wrap/tdb_wrap.c b/lib/tdb_wrap/tdb_wrap.c index f2f32d1..e762b33 100644 --- a/lib/tdb_wrap/tdb_wrap.c +++ b/lib/tdb_wrap/tdb_wrap.c @@ -149,6 +149,13 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx, } if (w == NULL) { + + if (tdb_flags & TDB_MUTEX_LOCKING) { + if (!tdb_runtime_check_for_robust_mutexes()) { + tdb_flags &= ~TDB_MUTEX_LOCKING; + } + } + w = tdb_wrap_private_open(result, name, hash_size, tdb_flags, open_flags, mode); } else { diff --git a/source3/libsmb/libsmb_setget.c b/source3/libsmb/libsmb_setget.c index 3255b52..d203b09 100644 --- a/source3/libsmb/libsmb_setget.c +++ b/source3/libsmb/libsmb_setget.c @@ -467,14 +467,14 @@ smbc_setOptionNoAutoAnonymousLogin(SMBCCTX *c, smbc_bool b) } } -/** Get whether to enable use of kerberos */ +/** Get whether to enable use of the winbind ccache */ smbc_bool smbc_getOptionUseCCache(SMBCCTX *c) { return c->flags & SMB_CTX_FLAG_USE_CCACHE ? True : False; } -/** Set whether to enable use of kerberos */ +/** Set whether to enable use of the winbind ccache */ void smbc_setOptionUseCCache(SMBCCTX *c, smbc_bool b) { @@ -485,7 +485,7 @@ smbc_setOptionUseCCache(SMBCCTX *c, smbc_bool b) } } -/** Get whether to enable use of the winbind ccache */ +/** Get indication whether the password supplied is the NT hash */ smbc_bool smbc_getOptionUseNTHash(SMBCCTX *c) { -- Samba Shared Repository