Add some const to winbind_userinfo
[samba.git] / source3 / winbindd / idmap_hash / idmap_hash.c
index a050f99bc80f11e37f993261de629a226141f85d..7d4dd2b5ab01578ff758cd6374a83d3aae364f36 100644 (file)
@@ -160,6 +160,11 @@ static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        nt_status = be_init(dom, NULL);
        BAIL_ON_NTSTATUS_ERROR(nt_status);
 
@@ -206,6 +211,11 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
        int i;
 
+       /* initialize the status to avoid suprise */
+       for (i = 0; ids[i]; i++) {
+               ids[i]->status = ID_UNKNOWN;
+       }
+       
        nt_status = be_init(dom, NULL);
        BAIL_ON_NTSTATUS_ERROR(nt_status);
 
@@ -266,9 +276,9 @@ static NTSTATUS nss_hash_get_info(struct nss_domain_entry *e,
                                    TALLOC_CTX *ctx,
                                    ADS_STRUCT *ads,
                                    LDAPMessage *msg,
-                                   char **homedir,
-                                   char **shell,
-                                   char **gecos,
+                                   const char **homedir,
+                                   const char **shell,
+                                   const char **gecos,
                                    gid_t *p_gid )
 {
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
@@ -304,14 +314,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 +335,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)
 {