summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/passdb.h26
-rw-r--r--source3/include/proto.h7
-rw-r--r--source3/passdb/pdb_interface.c65
3 files changed, 98 insertions, 0 deletions
diff --git a/source3/include/passdb.h b/source3/include/passdb.h
index dc50533cdf..5610897b42 100644
--- a/source3/include/passdb.h
+++ b/source3/include/passdb.h
@@ -225,6 +225,17 @@ struct pdb_domain_info {
struct GUID guid;
};
+struct pdb_trusted_domain {
+ char *domain_name;
+ char *netbios_name;
+ struct dom_sid security_identifier;
+ DATA_BLOB trust_auth_incoming;
+ DATA_BLOB trust_auth_outgoing;
+ uint32_t trust_direction;
+ uint32_t trust_type;
+ uint32_t trust_attributes;
+};
+
/*
* trusted domain entry/entries returned by secrets_get_trusted_domains
* (used in _lsa_enum_trust_dom call)
@@ -438,6 +449,21 @@ struct pdb_methods
TALLOC_CTX *mem_ctx, uint32_t *num_domains,
struct trustdom_info ***domains);
+
+ NTSTATUS (*get_trusted_domain)(struct pdb_methods *methods,
+ TALLOC_CTX *mem_ctx,
+ const char *domain,
+ struct pdb_trusted_domain **td);
+ NTSTATUS (*set_trusted_domain)(struct pdb_methods *methods,
+ const char* domain,
+ const struct pdb_trusted_domain *td);
+ NTSTATUS (*del_trusted_domain)(struct pdb_methods *methods,
+ const char *domain);
+ NTSTATUS (*enum_trusted_domains)(struct pdb_methods *methods,
+ TALLOC_CTX *mem_ctx,
+ uint32_t *num_domains,
+ struct pdb_trusted_domain ***domains);
+
void *private_data; /* Private data of some kind */
void (*free_private_data)(void **);
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 6f0dbae561..a5d69bc214 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -3873,6 +3873,13 @@ bool pdb_set_trusteddom_pw(const char* domain, const char* pwd,
bool pdb_del_trusteddom_pw(const char *domain);
NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
struct trustdom_info ***domains);
+NTSTATUS pdb_get_trusted_domain(TALLOC_CTX *mem_ctx, const char *domain,
+ struct pdb_trusted_domain **td);
+NTSTATUS pdb_set_trusted_domain(const char* domain,
+ const struct pdb_trusted_domain *td);
+NTSTATUS pdb_del_trusted_domain(const char *domain);
+NTSTATUS pdb_enum_trusted_domains(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
+ struct pdb_trusted_domain ***domains);
NTSTATUS make_pdb_method( struct pdb_methods **methods ) ;
/* The following definitions come from passdb/pdb_ldap.c */
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index b48f40958f..7712a85301 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -2098,6 +2098,66 @@ static NTSTATUS pdb_default_enum_trusteddoms(struct pdb_methods *methods,
return secrets_trusted_domains(mem_ctx, num_domains, domains);
}
+/*******************************************************************
+ trusted_domain methods
+ *******************************************************************/
+
+NTSTATUS pdb_get_trusted_domain(TALLOC_CTX *mem_ctx, const char *domain,
+ struct pdb_trusted_domain **td)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->get_trusted_domain(pdb, mem_ctx, domain, td);
+}
+
+NTSTATUS pdb_set_trusted_domain(const char* domain,
+ const struct pdb_trusted_domain *td)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->set_trusted_domain(pdb, domain, td);
+}
+
+NTSTATUS pdb_del_trusted_domain(const char *domain)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->del_trusted_domain(pdb, domain);
+}
+
+NTSTATUS pdb_enum_trusted_domains(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
+ struct pdb_trusted_domain ***domains)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->enum_trusted_domains(pdb, mem_ctx, num_domains, domains);
+}
+
+static NTSTATUS pdb_default_get_trusted_domain(struct pdb_methods *methods,
+ TALLOC_CTX *mem_ctx,
+ const char *domain,
+ struct pdb_trusted_domain **td)
+{
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS pdb_default_set_trusted_domain(struct pdb_methods *methods,
+ const char* domain,
+ const struct pdb_trusted_domain *td)
+{
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS pdb_default_del_trusted_domain(struct pdb_methods *methods,
+ const char *domain)
+{
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS pdb_default_enum_trusted_domains(struct pdb_methods *methods,
+ TALLOC_CTX *mem_ctx,
+ uint32_t *num_domains,
+ struct pdb_trusted_domain ***domains)
+{
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
static struct pdb_domain_info *pdb_default_get_domain_info(
struct pdb_methods *m, TALLOC_CTX *mem_ctx)
{
@@ -2169,5 +2229,10 @@ NTSTATUS make_pdb_method( struct pdb_methods **methods )
(*methods)->del_trusteddom_pw = pdb_default_del_trusteddom_pw;
(*methods)->enum_trusteddoms = pdb_default_enum_trusteddoms;
+ (*methods)->get_trusted_domain = pdb_default_get_trusted_domain;
+ (*methods)->set_trusted_domain = pdb_default_set_trusted_domain;
+ (*methods)->del_trusted_domain = pdb_default_del_trusted_domain;
+ (*methods)->enum_trusted_domains = pdb_default_enum_trusted_domains;
+
return NT_STATUS_OK;
}