summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-09-11 16:38:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:39 -0500
commit3853c7e1447e473bf34f207971b5f1c03a17ffb5 (patch)
tree80e5878a1702f3749a9391007f43d86672a4539a /source3
parentb6c64fab5e95b2e4b3a0ae84e912ff1fd3267401 (diff)
downloadsamba-3853c7e1447e473bf34f207971b5f1c03a17ffb5.tar.gz
samba-3853c7e1447e473bf34f207971b5f1c03a17ffb5.tar.bz2
samba-3853c7e1447e473bf34f207971b5f1c03a17ffb5.zip
r25091: Start adding support for storing trusted domain passwords in LDAP
(for passdb backen = ldapsam). At a first step, add the hooks, calling the secrets_ functions. Michael (This used to be commit 9c03cdf3a449149c50451a44deb420341e65af34)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_ldap.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 2be0e34271..b081ae2bb9 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -5470,6 +5470,45 @@ static NTSTATUS ldapsam_set_primary_group(struct pdb_methods *my_methods,
return NT_STATUS_OK;
}
+
+/**********************************************************************
+ trusted domains functions
+ *********************************************************************/
+
+static BOOL ldapsam_get_trusteddom_pw(struct pdb_methods *methods,
+ const char *domain,
+ char** pwd,
+ DOM_SID *sid,
+ time_t *pass_last_set_time)
+{
+ return secrets_fetch_trusted_domain_password(domain, pwd,
+ sid, pass_last_set_time);
+
+}
+
+static BOOL ldapsam_set_trusteddom_pw(struct pdb_methods *methods,
+ const char* domain,
+ const char* pwd,
+ const DOM_SID *sid)
+{
+ return secrets_store_trusted_domain_password(domain, pwd, sid);
+}
+
+static BOOL ldapsam_del_trusteddom_pw(struct pdb_methods *methods,
+ const char *domain)
+{
+ return trusted_domain_password_delete(domain);
+}
+
+static NTSTATUS ldapsam_enum_trusteddoms(struct pdb_methods *methods,
+ TALLOC_CTX *mem_ctx,
+ uint32 *num_domains,
+ struct trustdom_info ***domains)
+{
+ return secrets_trusted_domains(mem_ctx, num_domains, domains);
+}
+
+
/**********************************************************************
Housekeeping
*********************************************************************/
@@ -5535,6 +5574,11 @@ static NTSTATUS pdb_init_ldapsam_common(struct pdb_methods **pdb_method, const c
(*pdb_method)->rid_algorithm = ldapsam_rid_algorithm;
(*pdb_method)->new_rid = ldapsam_new_rid;
+ (*pdb_method)->get_trusteddom_pw = ldapsam_get_trusteddom_pw;
+ (*pdb_method)->set_trusteddom_pw = ldapsam_set_trusteddom_pw;
+ (*pdb_method)->del_trusteddom_pw = ldapsam_del_trusteddom_pw;
+ (*pdb_method)->enum_trusteddoms = ldapsam_enum_trusteddoms;
+
/* TODO: Setup private data and free */
if ( !(ldap_state = TALLOC_ZERO_P(*pdb_method, struct ldapsam_privates)) ) {