The branch, master has been updated via a3e089d... s4-ldb: display security descriptors with correct SDL for known SIDs via d5091a1... s4-dsdb: added samdb_domain_sid_cache_only() from fd92db5... s3: Remove a pointless "else" branch from add_ccache_to_list()
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit a3e089db19384221c65996b158b7fa3aaf512792 Author: Andrew Tridgell <tri...@samba.org> Date: Sun Jan 10 12:53:07 2010 +1100 s4-ldb: display security descriptors with correct SDL for known SIDs This makes it much easier to compare SDs commit d5091a1dd9cf669817355bb932249e5337e664b1 Author: Andrew Tridgell <tri...@samba.org> Date: Sun Jan 10 12:52:22 2010 +1100 s4-dsdb: added samdb_domain_sid_cache_only() ----------------------------------------------------------------------- Summary of changes: source4/dsdb/common/util.c | 9 ++++++++- source4/lib/ldb-samba/ldif_handlers.c | 2 +- source4/lib/ldb/tools/cmdline.c | 6 ++++++ 3 files changed, 15 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 139ea4d..6147940 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -1196,11 +1196,18 @@ const struct dom_sid *samdb_domain_sid(struct ldb_context *ldb) return domain_sid; failed: - DEBUG(1,("Failed to find domain_sid for open ldb\n")); talloc_free(tmp_ctx); return NULL; } +/* + get domain sid from cache +*/ +const struct dom_sid *samdb_domain_sid_cache_only(struct ldb_context *ldb) +{ + return (struct dom_sid *)ldb_get_opaque(ldb, "cache.domain_sid"); +} + bool samdb_set_domain_sid(struct ldb_context *ldb, const struct dom_sid *dom_sid_in) { TALLOC_CTX *tmp_ctx; diff --git a/source4/lib/ldb-samba/ldif_handlers.c b/source4/lib/ldb-samba/ldif_handlers.c index 10a7333..88888bf 100644 --- a/source4/lib/ldb-samba/ldif_handlers.c +++ b/source4/lib/ldb-samba/ldif_handlers.c @@ -406,7 +406,7 @@ static int ldif_write_ntSecurityDescriptor(struct ldb_context *ldb, void *mem_ct talloc_free(sd); return -1; } - out->data = (uint8_t *)sddl_encode(mem_ctx, sd, NULL); + out->data = (uint8_t *)sddl_encode(mem_ctx, sd, samdb_domain_sid_cache_only(ldb)); talloc_free(sd); if (out->data == NULL) { return -1; diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c index 39a4607..44ae23b 100644 --- a/source4/lib/ldb/tools/cmdline.c +++ b/source4/lib/ldb/tools/cmdline.c @@ -33,6 +33,7 @@ #include "auth/auth.h" #include "ldb_wrap.h" #include "param/param.h" +#include "dsdb/common/proto.h" #endif static struct ldb_cmdline options; /* needs to be static for older compilers */ @@ -321,6 +322,11 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, goto failed; } +#if (_SAMBA_BUILD_ >= 4) + /* get the domain SID into the cache for SDDL processing */ + samdb_domain_sid(ldb); +#endif + return ret; failed: -- Samba Shared Repository