1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Add pdb_get_domain_info

This commit is contained in:
Volker Lendecke 2009-07-04 11:12:33 +02:00
parent 1c778aa19a
commit b8322ec2b2
4 changed files with 32 additions and 0 deletions

View File

@ -197,6 +197,14 @@ struct pdb_search {
void (*search_end)(struct pdb_search *search); void (*search_end)(struct pdb_search *search);
}; };
struct pdb_domain_info {
char *name;
char *dns_domain;
char *dns_forest;
struct dom_sid sid;
struct GUID guid;
};
#define PDB_CAP_STORE_RIDS 0x0001 #define PDB_CAP_STORE_RIDS 0x0001
#define PDB_CAP_ADS 0x0002 #define PDB_CAP_ADS 0x0002
@ -224,6 +232,9 @@ struct pdb_methods
{ {
const char *name; /* What name got this module */ const char *name; /* What name got this module */
struct pdb_domain_info *(*get_domain_info)(struct pdb_methods *,
TALLOC_CTX *mem_ctx);
NTSTATUS (*getsampwnam)(struct pdb_methods *, struct samu *sam_acct, const char *username); NTSTATUS (*getsampwnam)(struct pdb_methods *, struct samu *sam_acct, const char *username);
NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const DOM_SID *sid); NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const DOM_SID *sid);

View File

@ -4531,6 +4531,7 @@ NTSTATUS smb_register_passdb(int version, const char *name, pdb_init_function in
struct pdb_init_function_entry *pdb_find_backend_entry(const char *name); struct pdb_init_function_entry *pdb_find_backend_entry(const char *name);
struct event_context *pdb_get_event_context(void); struct event_context *pdb_get_event_context(void);
NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected); NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected);
struct pdb_domain_info *pdb_get_domain_info(TALLOC_CTX *mem_ctx);
bool pdb_getsampwnam(struct samu *sam_acct, const char *username) ; bool pdb_getsampwnam(struct samu *sam_acct, const char *username) ;
bool guest_user_info( struct samu *user ); bool guest_user_info( struct samu *user );
bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) ; bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) ;

View File

@ -69,6 +69,12 @@ struct pdb_ads_samu_private {
struct tldap_message *ldapmsg; struct tldap_message *ldapmsg;
}; };
static struct pdb_domain_info *pdb_ads_get_domain_info(
struct pdb_methods *m, TALLOC_CTX *mem_ctx)
{
return NULL;
}
static struct samu *pdb_ads_init_guest(TALLOC_CTX *mem_ctx, static struct samu *pdb_ads_init_guest(TALLOC_CTX *mem_ctx,
struct pdb_methods *m) struct pdb_methods *m)
{ {
@ -1962,6 +1968,7 @@ static NTSTATUS pdb_ads_enum_trusteddoms(struct pdb_methods *m,
static void pdb_ads_init_methods(struct pdb_methods *m) static void pdb_ads_init_methods(struct pdb_methods *m)
{ {
m->name = "ads"; m->name = "ads";
m->get_domain_info = pdb_ads_get_domain_info;
m->getsampwnam = pdb_ads_getsampwnam; m->getsampwnam = pdb_ads_getsampwnam;
m->getsampwsid = pdb_ads_getsampwsid; m->getsampwsid = pdb_ads_getsampwsid;
m->create_user = pdb_ads_create_user; m->create_user = pdb_ads_create_user;

View File

@ -210,6 +210,12 @@ static struct pdb_methods *pdb_get_methods(void)
return pdb_get_methods_reload(False); return pdb_get_methods_reload(False);
} }
struct pdb_domain_info *pdb_get_domain_info(TALLOC_CTX *mem_ctx)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->get_domain_info(pdb, mem_ctx);
}
bool pdb_getsampwnam(struct samu *sam_acct, const char *username) bool pdb_getsampwnam(struct samu *sam_acct, const char *username)
{ {
struct pdb_methods *pdb = pdb_get_methods(); struct pdb_methods *pdb = pdb_get_methods();
@ -1992,6 +1998,12 @@ static NTSTATUS pdb_default_enum_trusteddoms(struct pdb_methods *methods,
return secrets_trusted_domains(mem_ctx, num_domains, domains); return secrets_trusted_domains(mem_ctx, num_domains, domains);
} }
static struct pdb_domain_info *pdb_default_get_domain_info(
struct pdb_methods *m, TALLOC_CTX *mem_ctx)
{
return NULL;
}
/******************************************************************* /*******************************************************************
Create a pdb_methods structure and initialize it with the default Create a pdb_methods structure and initialize it with the default
operations. In this way a passdb module can simply implement operations. In this way a passdb module can simply implement
@ -2008,6 +2020,7 @@ NTSTATUS make_pdb_method( struct pdb_methods **methods )
return NT_STATUS_NO_MEMORY; return NT_STATUS_NO_MEMORY;
} }
(*methods)->get_domain_info = pdb_default_get_domain_info;
(*methods)->getsampwnam = pdb_default_getsampwnam; (*methods)->getsampwnam = pdb_default_getsampwnam;
(*methods)->getsampwsid = pdb_default_getsampwsid; (*methods)->getsampwsid = pdb_default_getsampwsid;
(*methods)->create_user = pdb_default_create_user; (*methods)->create_user = pdb_default_create_user;