1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

s3-secrets: only include secrets.h when needed.

Guenther
This commit is contained in:
Günther Deschner 2010-08-05 02:25:37 +02:00
parent 1946ab5a1b
commit c136b84f0d
56 changed files with 108 additions and 59 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -218,6 +218,15 @@ struct pdb_domain_info {
struct GUID guid;
};
/*
* 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.
*/

View File

@ -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);

View File

@ -61,15 +61,6 @@ struct machine_acct_pass {
time_t mod_time;
};
/*
* 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 */

View File

@ -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"
/****************************************************************
****************************************************************/

View File

@ -20,6 +20,7 @@
#include "includes.h"
#include "lib/netapi/netapi.h"
#include "lib/netapi/netapi_private.h"
#include "secrets.h"
extern bool AllowDebugChange;

View File

@ -24,6 +24,7 @@
#include "includes.h"
#include "smbldap.h"
#include "secrets.h"
/* Try not to hit the up or down server forever */

View File

@ -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);

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "secrets.h"
extern char *global_clobber_region_function;
extern unsigned int global_clobber_region_line;

View File

@ -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

View File

@ -28,6 +28,7 @@
#include "includes.h"
#include "smb_krb5.h"
#include "ads.h"
#include "secrets.h"
#ifdef HAVE_KRB5

View File

@ -26,6 +26,7 @@
#include "includes.h"
#include "smb_krb5.h"
#include "libads/kerberos_proto.h"
#include "secrets.h"
#ifdef HAVE_KRB5

View File

@ -19,6 +19,7 @@
#include "includes.h"
#include "ads.h"
#include "secrets.h"
#ifdef HAVE_KRB5

View File

@ -32,7 +32,7 @@
#include "lib/smbconf/smbconf.h"
#include "lib/smbconf/smbconf_reg.h"
#include "../libds/common/flags.h"
#include "secrets.h"
/****************************************************************
****************************************************************/

View File

@ -25,6 +25,7 @@
#include "includes.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
#include "secrets.h"
/*

View File

@ -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.

View File

@ -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};

View File

@ -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;

View File

@ -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)

View File

@ -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.

View File

@ -24,6 +24,7 @@
#include "includes.h"
#include "../libcli/auth/libcli_auth.h"
#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB

View File

@ -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

View File

@ -24,6 +24,7 @@
#include "includes.h"
#include "../libcli/auth/libcli_auth.h"
#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB

View File

@ -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;

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB

View File

@ -45,6 +45,7 @@
#include "includes.h"
#include "../libcli/auth/libcli_auth.h"
#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB

View File

@ -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

View File

@ -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 */

View File

@ -24,6 +24,7 @@
#include "rpc_server/srv_spoolss_util.h"
#include "nt_printing.h"
#include "ads.h"
#include "secrets.h"
#ifdef HAVE_ADS
/*****************************************************************

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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) \

View File

@ -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"

View File

@ -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,

View File

@ -26,6 +26,7 @@
#include "librpc/gen_ndr/messaging.h"
#include "registry.h"
#include "libcli/auth/schannel.h"
#include "secrets.h"
static_decl_rpc;

View File

@ -42,6 +42,7 @@
#include "includes.h"
#include "utils/net.h"
#include "secrets.h"
extern bool AllowDebugChange;

View File

@ -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

View File

@ -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) { \

View File

@ -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);

View File

@ -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 */

View File

@ -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,

View File

@ -17,6 +17,7 @@
* this program; if not, see <http://www.gnu.org/licenses/>. */
#include "includes.h"
#include "secrets.h"
extern bool AllowDebugChange;

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -24,6 +24,7 @@
#include "includes.h"
#include "winbindd.h"
#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -22,6 +22,7 @@
#include "includes.h"
#include "winbindd.h"
#include "secrets.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND