s4:param: pass flags via secrets_db_connect() to ldb_wrap_connect()
[metze/samba/wip.git] / source4 / param / secrets.h
index 9d98db0d084c3ca721a45bf69dc8e98724ce1a1a..2f55ea6073934620df88aaae548e38876a5c6503 100644 (file)
  * this program; if not, see <http://www.gnu.org/licenses/>.  
  */
 
-#ifndef _SECRETS_H
-#define _SECRETS_H
-
-/* structure for storing machine account password
-   (ie. when samba server is member of a domain */
-struct machine_acct_pass {
-       uint8_t hash[16];
-       time_t mod_time;
-};
+#ifndef _SOURCE4_PARAM_SECRETS_H
+#define _SOURCE4_PARAM_SECRETS_H
 
 #define SECRETS_PRIMARY_DOMAIN_DN "cn=Primary Domains"
 #define SECRETS_PRINCIPALS_DN "cn=Principals"
@@ -33,20 +26,26 @@ struct machine_acct_pass {
 #define SECRETS_PRIMARY_REALM_FILTER "(&(realm=%s)(objectclass=primaryDomain))"
 #define SECRETS_KRBTGT_SEARCH "(&((|(realm=%s)(flatname=%s))(samAccountName=krbtgt)))"
 #define SECRETS_PRINCIPAL_SEARCH "(&(|(realm=%s)(flatname=%s))(servicePrincipalName=%s))"
+#define SECRETS_LDAP_FILTER "(&(objectclass=ldapSecret)(cn=SAMDB Credentials))"
 
-/**
- * Use a TDB to store an incrementing random seed.
- *
- * Initialised to the current pid, the very first time Samba starts,
- * and incremented by one each time it is needed.  
- * 
- * @note Not called by systems with a working /dev/urandom.
- */
-void secrets_shutdown(void);
-bool secrets_init(void);
 struct loadparm_context;
-struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx);
-struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, const char *domain);
+struct tevent_context;
+struct ldb_message;
+struct ldb_context;
+
+#include "librpc/gen_ndr/misc.h"
+
+bool randseed_init(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx);
+
+struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx,
+                                      struct loadparm_context *lp_ctx,
+                                      unsigned int flags);
+struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx,
+                                      struct loadparm_context *lp_ctx,
+                                      const char *domain,
+                                      enum netr_SchannelType *sec_channel_type,
+                                      char **errstring);
+char *keytab_name_from_msg(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, struct ldb_message *msg);
 
 
-#endif /* _SECRETS_H */
+#endif /* _SOURCE4_PARAM_SECRETS_H */