s4-dsdb: added samdb_domain_sid_cache_only()
authorAndrew Tridgell <tridge@samba.org>
Sun, 10 Jan 2010 01:52:22 +0000 (12:52 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sun, 10 Jan 2010 02:23:37 +0000 (13:23 +1100)
source4/dsdb/common/util.c

index 139ea4dc6b4ab2d2e8911abe6c50397a86c3e124..6147940e3b79905ce8f60c6a2f0f1ae9643ceef1 100644 (file)
@@ -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;