s3:winbindd/nss_info: change nss_map_{to|from}_alias to take nss_domain_entry
authorMichael Adam <obnox@samba.org>
Mon, 1 Dec 2008 03:17:55 +0000 (04:17 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 1 Dec 2008 03:37:20 +0000 (04:37 +0100)
instead of just the domain name

Michael

source3/include/nss_info.h
source3/winbindd/idmap_ad.c
source3/winbindd/idmap_adex/idmap_adex.c
source3/winbindd/idmap_hash/idmap_hash.c
source3/winbindd/nss_info.c
source3/winbindd/nss_info_template.c

index e756136b76ab062af280794c04aee0c6e79e8d3c..0224be099fa1cd5e40e46b8552cb760a64df4de7 100644 (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 );
 };
 
index 60a2d8642aacd2d3c563f204ea9252d6589bc097..0f2ac5127e4d073054811e99ffde62f166e99be1 100644 (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 )
 {
index 7596b1cbd8371c018e4614a53f09e3d61cdf83ba..7e186ca8a124b68e19ae496363339ed2411398e6 100644 (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
index a050f99bc80f11e37f993261de629a226141f85d..7dd94aede0d1a94b6b762b2179dbb7106806c943 100644 (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)
 {
index 0e8cb602571bb53b9adae25958a4292292bc88b6..c35df4fbed8c46a404f9c5b23d74851b2ead0ce7 100644 (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 );
 }
 
 /********************************************************************
index d8f903ddd08348edb5ffc3c12975c42b95c5d5a5..f44c73f3a60c6128a63cc912258e886a7bf2e0e5 100644 (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 )
 {