svn commit: samba r25091 - in branches: SAMBA_3_2/source/passdb SAMBA_3_2_0/source/passdb

obnox at samba.org obnox at samba.org
Tue Sep 11 16:38:31 GMT 2007


Author: obnox
Date: 2007-09-11 16:38:31 +0000 (Tue, 11 Sep 2007)
New Revision: 25091

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25091

Log:
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


Modified:
   branches/SAMBA_3_2/source/passdb/pdb_ldap.c
   branches/SAMBA_3_2_0/source/passdb/pdb_ldap.c


Changeset:
Modified: branches/SAMBA_3_2/source/passdb/pdb_ldap.c
===================================================================
--- branches/SAMBA_3_2/source/passdb/pdb_ldap.c	2007-09-11 16:30:38 UTC (rev 25090)
+++ branches/SAMBA_3_2/source/passdb/pdb_ldap.c	2007-09-11 16:38:31 UTC (rev 25091)
@@ -5470,7 +5470,46 @@
 	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 @@
 	(*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)) ) {

Modified: branches/SAMBA_3_2_0/source/passdb/pdb_ldap.c
===================================================================
--- branches/SAMBA_3_2_0/source/passdb/pdb_ldap.c	2007-09-11 16:30:38 UTC (rev 25090)
+++ branches/SAMBA_3_2_0/source/passdb/pdb_ldap.c	2007-09-11 16:38:31 UTC (rev 25091)
@@ -5470,7 +5470,46 @@
 	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 @@
 	(*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)) ) {



More information about the samba-cvs mailing list