1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3:winbindd/nss_info: change nss_map_{to|from}_alias to take nss_domain_entry

instead of just the domain name

Michael
This commit is contained in:
Michael Adam 2008-12-01 04:17:55 +01:00
parent 8340d100f6
commit 757a1f5132
6 changed files with 24 additions and 22 deletions

View File

@ -66,10 +66,12 @@ struct nss_info_methods {
TALLOC_CTX *ctx,
ADS_STRUCT *ads, LDAPMessage *msg,
char **homedir, char **shell, char **gecos, gid_t *p_gid);
NTSTATUS (*map_to_alias)( TALLOC_CTX *mem_ctx, const char *domain,
const char *name, char **alias );
NTSTATUS (*map_from_alias)( TALLOC_CTX *mem_ctx, const char *domain,
const char *alias, char **name );
NTSTATUS (*map_to_alias)(TALLOC_CTX *mem_ctx,
struct nss_domain_entry *e,
const char *name, char **alias);
NTSTATUS (*map_from_alias)(TALLOC_CTX *mem_ctx,
struct nss_domain_entry *e,
const char *alias, char **name);
NTSTATUS (*close_fn)( void );
};

View File

@ -824,7 +824,7 @@ done:
*********************************************************************/
static NTSTATUS nss_ad_map_to_alias(TALLOC_CTX *mem_ctx,
const char *domain,
struct nss_domain_entry *e,
const char *name,
char **alias)
{
@ -838,7 +838,7 @@ static NTSTATUS nss_ad_map_to_alias(TALLOC_CTX *mem_ctx,
/* Check incoming parameters */
if ( !domain || !name || !*alias) {
if ( !e || !e->domain || !name || !*alias) {
nt_status = NT_STATUS_INVALID_PARAMETER;
goto done;
}
@ -896,7 +896,7 @@ done:
*********************************************************************/
static NTSTATUS nss_ad_map_from_alias( TALLOC_CTX *mem_ctx,
const char *domain,
struct nss_domain_entry *e,
const char *alias,
char **name )
{

View File

@ -329,9 +329,9 @@ static NTSTATUS _nss_adex_get_info(struct
/**********************************************************************
*********************************************************************/
static NTSTATUS _nss_adex_map_to_alias(TALLOC_CTX * mem_ctx, const char
*domain, const char
*name, char **alias)
static NTSTATUS _nss_adex_map_to_alias(TALLOC_CTX * mem_ctx,
struct nss_domain_entry *e,
const char *name, char **alias)
{
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
struct likewise_cell *cell = NULL;
@ -344,7 +344,7 @@ static NTSTATUS _nss_adex_map_to_alias(TALLOC_CTX * mem_ctx, const char
BAIL_ON_NTSTATUS_ERROR(nt_status);
}
nt_status = cell->provider->map_to_alias(mem_ctx, domain,
nt_status = cell->provider->map_to_alias(mem_ctx, e->domain,
name, alias);
/* go ahead and allow the cache mgr to mark this in
@ -360,9 +360,9 @@ done:
/**********************************************************************
*********************************************************************/
static NTSTATUS _nss_adex_map_from_alias(TALLOC_CTX * mem_ctx, const char
*domain, const char
*alias, char **name)
static NTSTATUS _nss_adex_map_from_alias(TALLOC_CTX * mem_ctx,
struct nss_domain_entry *e,
const char *alias, char **name)
{
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
struct likewise_cell *cell = NULL;
@ -376,7 +376,7 @@ static NTSTATUS _nss_adex_map_from_alias(TALLOC_CTX * mem_ctx, const char
}
nt_status = cell->provider->map_from_alias(mem_ctx, domain,
nt_status = cell->provider->map_from_alias(mem_ctx, e->domain,
alias, name);
/* go ahead and allow the cache mgr to mark this in

View File

@ -304,14 +304,14 @@ done:
*********************************************************************/
static NTSTATUS nss_hash_map_to_alias(TALLOC_CTX *mem_ctx,
const char *domain,
struct nss_domain_entry *e,
const char *name,
char **alias)
{
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
const char *value;
value = talloc_asprintf(mem_ctx, "%s\\%s", domain, name);
value = talloc_asprintf(mem_ctx, "%s\\%s", e->domain, name);
BAIL_ON_PTR_NT_ERROR(value, nt_status);
nt_status = mapfile_lookup_key(mem_ctx, value, alias);
@ -325,7 +325,7 @@ done:
*********************************************************************/
static NTSTATUS nss_hash_map_from_alias(TALLOC_CTX *mem_ctx,
const char *domain,
struct nss_domain_entry *e,
const char *alias,
char **name)
{

View File

@ -295,7 +295,7 @@ static struct nss_domain_entry *find_nss_domain( const char *domain )
m = p->backend->methods;
return m->map_to_alias( mem_ctx, domain, name, alias );
return m->map_to_alias(mem_ctx, p, name, alias);
}
@ -316,7 +316,7 @@ static struct nss_domain_entry *find_nss_domain( const char *domain )
m = p->backend->methods;
return m->map_from_alias( mem_ctx, domain, alias, name );
return m->map_from_alias( mem_ctx, p, alias, name );
}
/********************************************************************

View File

@ -62,7 +62,7 @@ static NTSTATUS nss_template_get_info( struct nss_domain_entry *e,
*********************************************************************/
static NTSTATUS nss_template_map_to_alias( TALLOC_CTX *mem_ctx,
const char *domain,
struct nss_domain_entry *e,
const char *name,
char **alias )
{
@ -73,7 +73,7 @@ static NTSTATUS nss_template_map_to_alias( TALLOC_CTX *mem_ctx,
*********************************************************************/
static NTSTATUS nss_template_map_from_alias( TALLOC_CTX *mem_ctx,
const char *domain,
struct nss_domain_entry *e,
const char *alias,
char **name )
{