s3:libsmb: Convert (state->received) to (state->received != 0)
[ira/wip.git] / source3 / passdb / pdb_wbc_sam.c
index e8116d0995210b969bcb3a27c3869ac15268b768..df80411a7a284c190538497efaf3364f2056a18b 100644 (file)
@@ -81,22 +81,6 @@ static bool pdb_wbc_sam_gid_to_sid(struct pdb_methods *methods, gid_t gid,
        return winbind_gid_to_sid(sid, gid);
 }
 
-static bool pdb_wbc_sam_sid_to_id(struct pdb_methods *methods,
-                                 const DOM_SID *sid,
-                                 union unid_t *id, enum lsa_SidType *type)
-{
-       if (winbind_sid_to_uid(&id->uid, sid)) {
-               *type = SID_NAME_USER;
-       } else if (winbind_sid_to_gid(&id->gid, sid)) {
-               /* We assume all gids are groups, not aliases */
-               *type = SID_NAME_DOM_GRP;
-       } else {
-               return false;
-       }
-
-       return true;
-}
-
 static NTSTATUS pdb_wbc_sam_enum_group_members(struct pdb_methods *methods,
                                               TALLOC_CTX *mem_ctx,
                                               const DOM_SID *group,
@@ -183,12 +167,12 @@ done:
        return result;
 }
 
-static NTSTATUS pdb_wbc_sam_get_account_policy(struct pdb_methods *methods, int policy_index, uint32 *value)
+static NTSTATUS pdb_wbc_sam_get_account_policy(struct pdb_methods *methods, enum pdb_policy_type type, uint32_t *value)
 {
        return NT_STATUS_UNSUCCESSFUL;
 }
 
-static NTSTATUS pdb_wbc_sam_set_account_policy(struct pdb_methods *methods, int policy_index, uint32 value)
+static NTSTATUS pdb_wbc_sam_set_account_policy(struct pdb_methods *methods, enum pdb_policy_type type, uint32_t value)
 {
        return NT_STATUS_UNSUCCESSFUL;
 }
@@ -332,13 +316,12 @@ static NTSTATUS pdb_wbc_sam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map
                                 const char *name)
 {
        NTSTATUS result = NT_STATUS_OK;
-       char *user_name = NULL;
-       char *domain = NULL;
+       const char *domain = "";
        DOM_SID sid;
        gid_t gid;
        enum lsa_SidType name_type;
 
-       if (!winbind_lookup_name(domain, user_name, &sid, &name_type)) {
+       if (!winbind_lookup_name(domain, name, &sid, &name_type)) {
                result = NT_STATUS_NO_SUCH_GROUP;
                goto done;
        }
@@ -356,7 +339,7 @@ static NTSTATUS pdb_wbc_sam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map
                goto done;
        }
 
-       if (!_make_group_map(methods, domain, user_name, name_type, gid, &sid, map)) {
+       if (!_make_group_map(methods, domain, name, name_type, gid, &sid, map)) {
                result = NT_STATUS_NO_SUCH_GROUP;
                goto done;
        }
@@ -382,8 +365,10 @@ static NTSTATUS pdb_wbc_sam_get_aliasinfo(struct pdb_methods *methods,
 }
 
 static NTSTATUS pdb_wbc_sam_enum_aliasmem(struct pdb_methods *methods,
-                                  const DOM_SID *alias, DOM_SID **pp_members,
-                                  size_t *p_num_members)
+                                         const DOM_SID *alias,
+                                         TALLOC_CTX *mem_ctx,
+                                         DOM_SID **pp_members,
+                                         size_t *p_num_members)
 {
        return NT_STATUS_NOT_IMPLEMENTED;
 }
@@ -430,7 +415,6 @@ static NTSTATUS pdb_init_wbc_sam(struct pdb_methods **pdb_method, const char *lo
        (*pdb_method)->set_account_policy = pdb_wbc_sam_set_account_policy;
        (*pdb_method)->uid_to_sid = pdb_wbc_sam_uid_to_sid;
        (*pdb_method)->gid_to_sid = pdb_wbc_sam_gid_to_sid;
-       (*pdb_method)->sid_to_id = pdb_wbc_sam_sid_to_id;
 
        (*pdb_method)->search_groups = pdb_wbc_sam_search_groups;
        (*pdb_method)->search_aliases = pdb_wbc_sam_search_aliases;