summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-08-05 02:25:37 +0200
committerGünther Deschner <gd@samba.org>2010-08-05 10:12:25 +0200
commitc136b84f0d28d1a88c5918b06f81766a271a3780 (patch)
treeff9f74effdf63e58517597fecc92474786100ff7 /source3
parent1946ab5a1b4be6d64307fb24847640f959a1e024 (diff)
downloadsamba-c136b84f0d28d1a88c5918b06f81766a271a3780.tar.gz
samba-c136b84f0d28d1a88c5918b06f81766a271a3780.tar.bz2
samba-c136b84f0d28d1a88c5918b06f81766a271a3780.zip
s3-secrets: only include secrets.h when needed.
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/auth/auth_domain.c1
-rw-r--r--source3/auth/auth_netlogond.c1
-rw-r--r--source3/auth/token_util.c1
-rw-r--r--source3/include/includes.h1
-rw-r--r--source3/include/passdb.h9
-rw-r--r--source3/include/proto.h47
-rw-r--r--source3/include/secrets.h56
-rw-r--r--source3/lib/netapi/joindomain.c1
-rw-r--r--source3/lib/netapi/netapi.c1
-rw-r--r--source3/lib/smbldap.c1
-rw-r--r--source3/lib/substitute.c1
-rw-r--r--source3/lib/util.c1
-rw-r--r--source3/libads/kerberos.c1
-rw-r--r--source3/libads/kerberos_keytab.c1
-rw-r--r--source3/libads/kerberos_verify.c1
-rw-r--r--source3/libads/util.c1
-rw-r--r--source3/libnet/libnet_join.c2
-rw-r--r--source3/libsmb/libsmb_context.c1
-rw-r--r--source3/libsmb/trusts_util.c1
-rw-r--r--source3/modules/vfs_smb_traffic_analyzer.c1
-rw-r--r--source3/nmbd/nmbd_processlogon.c1
-rw-r--r--source3/pam_smbpass/support.c1
-rw-r--r--source3/passdb/lookup_sid.c1
-rw-r--r--source3/passdb/machine_account_secrets.c1
-rw-r--r--source3/passdb/machine_sid.c1
-rw-r--r--source3/passdb/passdb.c1
-rw-r--r--source3/passdb/pdb_ads.c1
-rw-r--r--source3/passdb/pdb_interface.c1
-rw-r--r--source3/passdb/pdb_ldap.c1
-rw-r--r--source3/passdb/secrets.c1
-rw-r--r--source3/printing/nt_printing.c1
-rw-r--r--source3/printing/nt_printing_ads.c1
-rw-r--r--source3/rpc_server/srv_dssetup_nt.c1
-rw-r--r--source3/rpc_server/srv_lsa_nt.c1
-rw-r--r--source3/rpc_server/srv_samr_nt.c1
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c1
-rw-r--r--source3/rpc_server/srv_spoolss_util.c1
-rw-r--r--source3/rpcclient/cmd_netlogon.c1
-rw-r--r--source3/smbd/server.c1
-rw-r--r--source3/utils/net.c1
-rw-r--r--source3/utils/net_ads.c1
-rw-r--r--source3/utils/net_idmap.c1
-rw-r--r--source3/utils/net_rpc.c1
-rw-r--r--source3/utils/net_rpc_join.c1
-rw-r--r--source3/utils/net_util.c1
-rw-r--r--source3/utils/smbpasswd.c1
-rw-r--r--source3/utils/smbta-util.c2
-rw-r--r--source3/winbindd/idmap_ad.c1
-rw-r--r--source3/winbindd/idmap_adex/idmap_adex.c1
-rw-r--r--source3/winbindd/idmap_adex/likewise_cell.c1
-rw-r--r--source3/winbindd/idmap_ldap.c1
-rw-r--r--source3/winbindd/winbindd.c1
-rw-r--r--source3/winbindd/winbindd_ads.c1
-rw-r--r--source3/winbindd/winbindd_cm.c1
-rw-r--r--source3/winbindd/winbindd_dual.c1
-rw-r--r--source3/winbindd/winbindd_util.c1
56 files changed, 108 insertions, 59 deletions
diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c
index f25fb4a2c7..0fc6410fec 100644
--- a/source3/auth/auth_domain.c
+++ b/source3/auth/auth_domain.c
@@ -22,6 +22,7 @@
#include "../libcli/auth/libcli_auth.h"
#include "../librpc/gen_ndr/ndr_netlogon.h"
#include "rpc_client/cli_netlogon.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
diff --git a/source3/auth/auth_netlogond.c b/source3/auth/auth_netlogond.c
index 7eea5af605..8be2c6a00c 100644
--- a/source3/auth/auth_netlogond.c
+++ b/source3/auth/auth_netlogond.c
@@ -21,6 +21,7 @@
#include "../libcli/auth/libcli_auth.h"
#include "../librpc/gen_ndr/ndr_netlogon.h"
#include "rpc_client/cli_netlogon.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index 3a288ddcf2..7634e76f1c 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -25,6 +25,7 @@
/* functions moved from auth/auth_util.c to minimize linker deps */
#include "includes.h"
+#include "secrets.h"
/****************************************************************************
Check for a SID in an NT_USER_TOKEN
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 35686e9f31..318c747d53 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -642,7 +642,6 @@ extern void *cmdline_lp_ctx;
#include "smb_signing.h"
#include "smb.h"
#include "nameserv.h"
-#include "secrets.h"
#include "../lib/util/byteorder.h"
#include "privileges.h"
#include "rpc_misc.h"
diff --git a/source3/include/passdb.h b/source3/include/passdb.h
index 08377010d4..b07c117853 100644
--- a/source3/include/passdb.h
+++ b/source3/include/passdb.h
@@ -219,6 +219,15 @@ struct pdb_domain_info {
};
/*
+ * trusted domain entry/entries returned by secrets_get_trusted_domains
+ * (used in _lsa_enum_trust_dom call)
+ */
+struct trustdom_info {
+ char *name;
+ struct dom_sid sid;
+};
+
+/*
* Types of account policy.
*/
enum pdb_policy_type {
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 9fd91b4724..fe977262b6 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4365,53 +4365,6 @@ NTSTATUS pdb_wbc_sam_init(void);
bool init_sam_from_buffer_v2(struct samu *sampass, uint8_t *buf, uint32_t buflen);
NTSTATUS pdb_tdbsam_init(void);
-/* The following definitions come from passdb/secrets.c */
-
-bool secrets_init(void);
-struct db_context *secrets_db_ctx(void);
-void secrets_shutdown(void);
-void *secrets_fetch(const char *key, size_t *size);
-bool secrets_store(const char *key, const void *data, size_t size);
-bool secrets_delete(const char *key);
-bool secrets_store_domain_sid(const char *domain, const struct dom_sid *sid);
-bool secrets_fetch_domain_sid(const char *domain, struct dom_sid *sid);
-bool secrets_store_domain_guid(const char *domain, struct GUID *guid);
-bool secrets_fetch_domain_guid(const char *domain, struct GUID *guid);
-void *secrets_get_trust_account_lock(TALLOC_CTX *mem_ctx, const char *domain);
-enum netr_SchannelType get_default_sec_channel(void);
-bool secrets_fetch_trust_account_password_legacy(const char *domain,
- uint8 ret_pwd[16],
- time_t *pass_last_set_time,
- enum netr_SchannelType *channel);
-bool secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16],
- time_t *pass_last_set_time,
- enum netr_SchannelType *channel);
-bool secrets_fetch_trusted_domain_password(const char *domain, char** pwd,
- struct dom_sid *sid, time_t *pass_last_set_time);
-bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
- const struct dom_sid *sid);
-bool secrets_delete_machine_password(const char *domain);
-bool secrets_delete_machine_password_ex(const char *domain);
-bool secrets_delete_domain_sid(const char *domain);
-bool secrets_store_machine_password(const char *pass, const char *domain, enum netr_SchannelType sec_channel);
-char *secrets_fetch_prev_machine_password(const char *domain);
-char *secrets_fetch_machine_password(const char *domain,
- time_t *pass_last_set_time,
- enum netr_SchannelType *channel);
-bool trusted_domain_password_delete(const char *domain);
-bool secrets_store_ldap_pw(const char* dn, char* pw);
-bool fetch_ldap_pw(char **dn, char** pw);
-NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains,
- struct trustdom_info ***domains);
-bool secrets_store_afs_keyfile(const char *cell, const struct afs_keyfile *keyfile);
-bool secrets_fetch_afs_key(const char *cell, struct afs_key *result);
-void secrets_fetch_ipc_userpass(char **username, char **domain, char **password);
-bool secrets_store_generic(const char *owner, const char *key, const char *secret);
-char *secrets_fetch_generic(const char *owner, const char *key);
-bool secrets_delete_generic(const char *owner, const char *key);
-bool secrets_store_local_schannel_key(uint8_t schannel_key[16]);
-bool secrets_fetch_local_schannel_key(uint8_t schannel_key[16]);
-
/* The following definitions come from passdb/util_builtin.c */
bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name);
diff --git a/source3/include/secrets.h b/source3/include/secrets.h
index 624b1465bb..095ab6ee78 100644
--- a/source3/include/secrets.h
+++ b/source3/include/secrets.h
@@ -62,15 +62,6 @@ struct machine_acct_pass {
};
/*
- * trusted domain entry/entries returned by secrets_get_trusted_domains
- * (used in _lsa_enum_trust_dom call)
- */
-struct trustdom_info {
- char *name;
- struct dom_sid sid;
-};
-
-/*
* Format of an OpenAFS keyfile
*/
@@ -88,4 +79,51 @@ struct afs_keyfile {
#define SECRETS_AFS_KEYFILE "SECRETS/AFS_KEYFILE"
+/* The following definitions come from passdb/secrets.c */
+
+bool secrets_init(void);
+struct db_context *secrets_db_ctx(void);
+void secrets_shutdown(void);
+void *secrets_fetch(const char *key, size_t *size);
+bool secrets_store(const char *key, const void *data, size_t size);
+bool secrets_delete(const char *key);
+bool secrets_store_domain_sid(const char *domain, const struct dom_sid *sid);
+bool secrets_fetch_domain_sid(const char *domain, struct dom_sid *sid);
+bool secrets_store_domain_guid(const char *domain, struct GUID *guid);
+bool secrets_fetch_domain_guid(const char *domain, struct GUID *guid);
+void *secrets_get_trust_account_lock(TALLOC_CTX *mem_ctx, const char *domain);
+enum netr_SchannelType get_default_sec_channel(void);
+bool secrets_fetch_trust_account_password_legacy(const char *domain,
+ uint8 ret_pwd[16],
+ time_t *pass_last_set_time,
+ enum netr_SchannelType *channel);
+bool secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16],
+ time_t *pass_last_set_time,
+ enum netr_SchannelType *channel);
+bool secrets_fetch_trusted_domain_password(const char *domain, char** pwd,
+ struct dom_sid *sid, time_t *pass_last_set_time);
+bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
+ const struct dom_sid *sid);
+bool secrets_delete_machine_password(const char *domain);
+bool secrets_delete_machine_password_ex(const char *domain);
+bool secrets_delete_domain_sid(const char *domain);
+bool secrets_store_machine_password(const char *pass, const char *domain, enum netr_SchannelType sec_channel);
+char *secrets_fetch_prev_machine_password(const char *domain);
+char *secrets_fetch_machine_password(const char *domain,
+ time_t *pass_last_set_time,
+ enum netr_SchannelType *channel);
+bool trusted_domain_password_delete(const char *domain);
+bool secrets_store_ldap_pw(const char* dn, char* pw);
+bool fetch_ldap_pw(char **dn, char** pw);
+NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains,
+ struct trustdom_info ***domains);
+bool secrets_store_afs_keyfile(const char *cell, const struct afs_keyfile *keyfile);
+bool secrets_fetch_afs_key(const char *cell, struct afs_key *result);
+void secrets_fetch_ipc_userpass(char **username, char **domain, char **password);
+bool secrets_store_generic(const char *owner, const char *key, const char *secret);
+char *secrets_fetch_generic(const char *owner, const char *key);
+bool secrets_delete_generic(const char *owner, const char *key);
+bool secrets_store_local_schannel_key(uint8_t schannel_key[16]);
+bool secrets_fetch_local_schannel_key(uint8_t schannel_key[16]);
+
#endif /* _SECRETS_H */
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c
index 94de573395..13a06c7136 100644
--- a/source3/lib/netapi/joindomain.c
+++ b/source3/lib/netapi/joindomain.c
@@ -27,6 +27,7 @@
#include "libnet/libnet_join.h"
#include "libcli/auth/libcli_auth.h"
#include "../librpc/gen_ndr/cli_wkssvc.h"
+#include "secrets.h"
/****************************************************************
****************************************************************/
diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c
index bde6fd823f..975e306b5d 100644
--- a/source3/lib/netapi/netapi.c
+++ b/source3/lib/netapi/netapi.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "lib/netapi/netapi.h"
#include "lib/netapi/netapi_private.h"
+#include "secrets.h"
extern bool AllowDebugChange;
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index b1571536eb..996c1c4c85 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "smbldap.h"
+#include "secrets.h"
/* Try not to hit the up or down server forever */
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index b81f0a1ec8..dbb5f7d08a 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -20,6 +20,7 @@
#include "includes.h"
+#include "secrets.h"
static char *alloc_sub_basic(const char *smb_name, const char *domain_name,
const char *str);
diff --git a/source3/lib/util.c b/source3/lib/util.c
index dc243ecf1d..6770a715d8 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -22,6 +22,7 @@
*/
#include "includes.h"
+#include "secrets.h"
extern char *global_clobber_region_function;
extern unsigned int global_clobber_region_line;
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index c48944ae6f..31af49685a 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -25,6 +25,7 @@
#include "smb_krb5.h"
#include "../librpc/gen_ndr/ndr_misc.h"
#include "libads/kerberos_proto.h"
+#include "secrets.h"
#ifdef HAVE_KRB5
diff --git a/source3/libads/kerberos_keytab.c b/source3/libads/kerberos_keytab.c
index 33b065f654..a874901caf 100644
--- a/source3/libads/kerberos_keytab.c
+++ b/source3/libads/kerberos_keytab.c
@@ -28,6 +28,7 @@
#include "includes.h"
#include "smb_krb5.h"
#include "ads.h"
+#include "secrets.h"
#ifdef HAVE_KRB5
diff --git a/source3/libads/kerberos_verify.c b/source3/libads/kerberos_verify.c
index f8a6602194..aaeff59182 100644
--- a/source3/libads/kerberos_verify.c
+++ b/source3/libads/kerberos_verify.c
@@ -26,6 +26,7 @@
#include "includes.h"
#include "smb_krb5.h"
#include "libads/kerberos_proto.h"
+#include "secrets.h"
#ifdef HAVE_KRB5
diff --git a/source3/libads/util.c b/source3/libads/util.c
index f028c75cfe..44b4c78038 100644
--- a/source3/libads/util.c
+++ b/source3/libads/util.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "ads.h"
+#include "secrets.h"
#ifdef HAVE_KRB5
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 2d18261bfb..bff4e1ebc5 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -32,7 +32,7 @@
#include "lib/smbconf/smbconf.h"
#include "lib/smbconf/smbconf_reg.h"
#include "../libds/common/flags.h"
-
+#include "secrets.h"
/****************************************************************
****************************************************************/
diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c
index c44d92c99a..7f4ede49ef 100644
--- a/source3/libsmb/libsmb_context.c
+++ b/source3/libsmb/libsmb_context.c
@@ -25,6 +25,7 @@
#include "includes.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
+#include "secrets.h"
/*
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index 2daacec912..e122937d6e 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -24,6 +24,7 @@
#include "rpc_client/cli_lsarpc.h"
#include "rpc_client/cli_netlogon.h"
#include "../librpc/gen_ndr/ndr_netlogon.h"
+#include "secrets.h"
/*********************************************************
Change the domain password on the PDC.
diff --git a/source3/modules/vfs_smb_traffic_analyzer.c b/source3/modules/vfs_smb_traffic_analyzer.c
index bf7b4138d0..57d483fa46 100644
--- a/source3/modules/vfs_smb_traffic_analyzer.c
+++ b/source3/modules/vfs_smb_traffic_analyzer.c
@@ -23,6 +23,7 @@
#include "../lib/crypto/crypto.h"
#include "vfs_smb_traffic_analyzer.h"
#include "../libcli/security/dom_sid.h"
+#include "secrets.h"
/* abstraction for the send_over_network function */
enum sock_type {INTERNET_SOCKET = 0, UNIX_DOMAIN_SOCKET};
diff --git a/source3/nmbd/nmbd_processlogon.c b/source3/nmbd/nmbd_processlogon.c
index f07628f3ef..607260b230 100644
--- a/source3/nmbd/nmbd_processlogon.c
+++ b/source3/nmbd/nmbd_processlogon.c
@@ -28,6 +28,7 @@
#include "../libcli/cldap/cldap.h"
#include "../lib/tsocket/tsocket.h"
#include "../libcli/security/dom_sid.h"
+#include "secrets.h"
struct sam_database_info {
uint32 index;
diff --git a/source3/pam_smbpass/support.c b/source3/pam_smbpass/support.c
index 43b9277702..715a0f43bb 100644
--- a/source3/pam_smbpass/support.c
+++ b/source3/pam_smbpass/support.c
@@ -19,6 +19,7 @@
#include "general.h"
#include "support.h"
+#include "secrets.h"
#include "../libcli/auth/libcli_auth.h"
#if defined(HAVE_SECURITY_PAM_EXT_H)
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c
index 9a5edcfa3a..0ec1f420f9 100644
--- a/source3/passdb/lookup_sid.c
+++ b/source3/passdb/lookup_sid.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "../librpc/gen_ndr/ndr_security.h"
+#include "secrets.h"
/*****************************************************************
Dissect a user-provided name into domain, name, sid and type.
diff --git a/source3/passdb/machine_account_secrets.c b/source3/passdb/machine_account_secrets.c
index db99d010ec..c5a8faf694 100644
--- a/source3/passdb/machine_account_secrets.c
+++ b/source3/passdb/machine_account_secrets.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "../libcli/auth/libcli_auth.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
diff --git a/source3/passdb/machine_sid.c b/source3/passdb/machine_sid.c
index 703e6ef268..0f735c40ef 100644
--- a/source3/passdb/machine_sid.c
+++ b/source3/passdb/machine_sid.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "secrets.h"
/* NOTE! the global_sam_sid is the SID of our local SAM. This is only
equal to the domain SID when we are a DC, otherwise its our
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index abcd4d1dc3..1989f6d191 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "../libcli/auth/libcli_auth.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index 1c420f8584..3ca24c4991 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -21,6 +21,7 @@
#include "tldap.h"
#include "tldap_util.h"
#include "../libds/common/flags.h"
+#include "secrets.h"
struct pdb_ads_state {
struct sockaddr_un socket_address;
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index b5da2658e2..ba6725e7a5 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 2e48023d8b..451012d5b0 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -45,6 +45,7 @@
#include "includes.h"
#include "../libcli/auth/libcli_auth.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index b673ad12a4..52c8e8060f 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -25,6 +25,7 @@
#include "includes.h"
#include "../libcli/auth/libcli_auth.h"
#include "librpc/gen_ndr/ndr_secrets.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index a831ef220e..9ead42df5b 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -30,6 +30,7 @@
#include "../librpc/gen_ndr/ndr_spoolss.h"
#include "rpc_server/srv_spoolss_util.h"
#include "nt_printing.h"
+#include "secrets.h"
/* Map generic permissions to printer object specific permissions */
diff --git a/source3/printing/nt_printing_ads.c b/source3/printing/nt_printing_ads.c
index e59f137ed5..fff5051308 100644
--- a/source3/printing/nt_printing_ads.c
+++ b/source3/printing/nt_printing_ads.c
@@ -24,6 +24,7 @@
#include "rpc_server/srv_spoolss_util.h"
#include "nt_printing.h"
#include "ads.h"
+#include "secrets.h"
#ifdef HAVE_ADS
/*****************************************************************
diff --git a/source3/rpc_server/srv_dssetup_nt.c b/source3/rpc_server/srv_dssetup_nt.c
index e690969679..cbc08c0880 100644
--- a/source3/rpc_server/srv_dssetup_nt.c
+++ b/source3/rpc_server/srv_dssetup_nt.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "../librpc/gen_ndr/srv_dssetup.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 10ea1e3b97..68fc2b18f3 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -30,6 +30,7 @@
#include "includes.h"
#include "../librpc/gen_ndr/srv_lsa.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 95f69a3bba..e101240dbe 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -37,6 +37,7 @@
#include "../librpc/gen_ndr/srv_samr.h"
#include "rpc_server/srv_samr_util.h"
#include "../lib/crypto/arcfour.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index d0473ed62a..7ada5fdb9a 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -38,6 +38,7 @@
#include "registry.h"
#include "registry/reg_objects.h"
#include "include/printing.h"
+#include "secrets.h"
/* macros stolen from s4 spoolss server */
#define SPOOLSS_BUFFER_UNION(fn,info,level) \
diff --git a/source3/rpc_server/srv_spoolss_util.c b/source3/rpc_server/srv_spoolss_util.c
index 5b47154f41..ab6be2f69d 100644
--- a/source3/rpc_server/srv_spoolss_util.c
+++ b/source3/rpc_server/srv_spoolss_util.c
@@ -26,6 +26,7 @@
#include "../librpc/gen_ndr/srv_winreg.h"
#include "../librpc/gen_ndr/cli_winreg.h"
#include "../librpc/gen_ndr/ndr_security.h"
+#include "secrets.h"
#define TOP_LEVEL_PRINT_KEY "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print"
#define TOP_LEVEL_PRINT_PRINTERS_KEY TOP_LEVEL_PRINT_KEY "\\Printers"
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index faa2bfff3e..0917badbdf 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -24,6 +24,7 @@
#include "../libcli/auth/libcli_auth.h"
#include "../librpc/gen_ndr/cli_netlogon.h"
#include "rpc_client/cli_netlogon.h"
+#include "secrets.h"
static WERROR cmd_netlogon_logon_ctrl2(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 7b788e8d1a..dba5204326 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -26,6 +26,7 @@
#include "librpc/gen_ndr/messaging.h"
#include "registry.h"
#include "libcli/auth/schannel.h"
+#include "secrets.h"
static_decl_rpc;
diff --git a/source3/utils/net.c b/source3/utils/net.c
index c677e3a9ba..1c342858ee 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -42,6 +42,7 @@
#include "includes.h"
#include "utils/net.h"
+#include "secrets.h"
extern bool AllowDebugChange;
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 71181990b5..ced5674b10 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -32,6 +32,7 @@
#include "librpc/gen_ndr/libnet_join.h"
#include "libnet/libnet_join.h"
#include "smb_krb5.h"
+#include "secrets.h"
#ifdef HAVE_ADS
diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c
index 1400e31174..702c6f9eee 100644
--- a/source3/utils/net_idmap.c
+++ b/source3/utils/net_idmap.c
@@ -20,6 +20,7 @@
#define FOO(x) (x)
#include "includes.h"
#include "utils/net.h"
+#include "secrets.h"
#define ALLOC_CHECK(mem) do { \
if (!mem) { \
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index d27545d1c6..00ebe13af5 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -33,6 +33,7 @@
#include "../librpc/gen_ndr/cli_spoolss.h"
#include "../librpc/gen_ndr/cli_initshutdown.h"
#include "../librpc/gen_ndr/cli_winreg.h"
+#include "secrets.h"
static int net_mode_share;
static bool sync_files(struct copy_clistate *cp_clistate, const char *mask);
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index 4659fe52ec..c17dfa4c32 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -27,6 +27,7 @@
#include "rpc_client/init_samr.h"
#include "../librpc/gen_ndr/ndr_netlogon.h"
#include "rpc_client/cli_netlogon.h"
+#include "secrets.h"
/* Macro for checking RPC error codes to make things more readable */
diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c
index b6ab03d913..11ef42cd61 100644
--- a/source3/utils/net_util.c
+++ b/source3/utils/net_util.c
@@ -24,6 +24,7 @@
#include "../librpc/gen_ndr/cli_lsa.h"
#include "rpc_client/cli_lsarpc.h"
#include "../librpc/gen_ndr/cli_dssetup.h"
+#include "secrets.h"
NTSTATUS net_rpc_lookup_name(struct net_context *c,
TALLOC_CTX *mem_ctx, struct cli_state *cli,
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 7957dd8a62..08ccab2126 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -17,6 +17,7 @@
* this program; if not, see <http://www.gnu.org/licenses/>. */
#include "includes.h"
+#include "secrets.h"
extern bool AllowDebugChange;
diff --git a/source3/utils/smbta-util.c b/source3/utils/smbta-util.c
index 75669c1159..e4f81445bc 100644
--- a/source3/utils/smbta-util.c
+++ b/source3/utils/smbta-util.c
@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "includes.h"
-
+#include "secrets.h"
static void delete_key(void);
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
index def41c6c11..37095c12c8 100644
--- a/source3/winbindd/idmap_ad.c
+++ b/source3/winbindd/idmap_ad.c
@@ -31,6 +31,7 @@
#include "ads.h"
#include "libads/ldap_schema.h"
#include "nss_info.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
diff --git a/source3/winbindd/idmap_adex/idmap_adex.c b/source3/winbindd/idmap_adex/idmap_adex.c
index c815e75a29..ea6d688b72 100644
--- a/source3/winbindd/idmap_adex/idmap_adex.c
+++ b/source3/winbindd/idmap_adex/idmap_adex.c
@@ -22,6 +22,7 @@
#include "ads.h"
#include "idmap_adex.h"
#include "nss_info.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
diff --git a/source3/winbindd/idmap_adex/likewise_cell.c b/source3/winbindd/idmap_adex/likewise_cell.c
index 24343eb554..3e529b427a 100644
--- a/source3/winbindd/idmap_adex/likewise_cell.c
+++ b/source3/winbindd/idmap_adex/likewise_cell.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "ads.h"
#include "idmap_adex.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c
index e7928bf3f7..71a7d0e3a2 100644
--- a/source3/winbindd/idmap_ldap.c
+++ b/source3/winbindd/idmap_ldap.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "winbindd.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 9efa8ed984..05114b2432 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -28,6 +28,7 @@
#include "librpc/gen_ndr/messaging.h"
#include "../librpc/gen_ndr/srv_lsa.h"
#include "../librpc/gen_ndr/srv_samr.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index 949e206d04..1d9f1f0174 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -26,6 +26,7 @@
#include "../librpc/gen_ndr/cli_netlogon.h"
#include "../libds/common/flags.h"
#include "ads.h"
+#include "secrets.h"
#ifdef HAVE_ADS
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index c10d82cb49..0ca8513f81 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -71,6 +71,7 @@
#include "librpc/gen_ndr/messaging.h"
#include "libsmb/clidgram.h"
#include "ads.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 47348b997f..c8bd066747 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -31,6 +31,7 @@
#include "winbindd.h"
#include "../../nsswitch/libwbclient/wbc_async.h"
#include "librpc/gen_ndr/messaging.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index 55874e057f..bd1e1b5bee 100644
--- a/source3/winbindd/winbindd_util.c
+++ b/source3/winbindd/winbindd_util.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "winbindd.h"
+#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND