s4: Switch to S3-style id mapping data types.
authorKai Blin <kai@samba.org>
Thu, 23 Apr 2009 14:37:11 +0000 (16:37 +0200)
committerKai Blin <kai@samba.org>
Thu, 11 Feb 2010 22:56:35 +0000 (23:56 +0100)
14 files changed:
source4/libcli/wbclient/wbclient.c
source4/libcli/wbclient/wbclient.h
source4/librpc/idl/winbind.idl
source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/posix/pvfs_acl_nfs4.c
source4/ntvfs/unixuid/vfs_unixuid.c
source4/rpc_server/unixinfo/dcesrv_unixinfo.c
source4/winbind/idmap.c
source4/winbind/wb_gid2sid.c
source4/winbind/wb_sid2gid.c
source4/winbind/wb_sid2uid.c
source4/winbind/wb_sids2xids.c
source4/winbind/wb_uid2sid.c
source4/winbind/wb_xids2sids.c

index da7d678da9621e680099af2712b5ad54c2f8f84a..ed722788ada8f6f0dc64ec844fc36b2b3acdf3d6 100644 (file)
@@ -74,7 +74,7 @@ struct wbc_idmap_state {
        struct composite_context *ctx;
        struct winbind_get_idmap *req;
        struct irpc_request *irpc_req;
-       struct id_mapping *ids;
+       struct id_map *ids;
 };
 
 static void sids_to_xids_recv_ids(struct irpc_request *req);
@@ -82,7 +82,7 @@ static void sids_to_xids_recv_ids(struct irpc_request *req);
 struct composite_context *wbc_sids_to_xids_send(struct wbc_context *wbc_ctx,
                                                TALLOC_CTX *mem_ctx,
                                                uint32_t count,
-                                               struct id_mapping *ids)
+                                               struct id_map *ids)
 {
        struct composite_context *ctx;
        struct wbc_idmap_state *state;
@@ -128,7 +128,7 @@ static void sids_to_xids_recv_ids(struct irpc_request *req)
 }
 
 NTSTATUS wbc_sids_to_xids_recv(struct composite_context *ctx,
-                              struct id_mapping **ids)
+                              struct id_map **ids)
 {
        NTSTATUS status = composite_wait(ctx);
                DEBUG(5, ("wbc_sids_to_xids_recv called\n"));
@@ -147,7 +147,7 @@ static void xids_to_sids_recv_ids(struct irpc_request *req);
 struct composite_context *wbc_xids_to_sids_send(struct wbc_context *wbc_ctx,
                                                TALLOC_CTX *mem_ctx,
                                                uint32_t count,
-                                               struct id_mapping *ids)
+                                               struct id_map *ids)
 {
        struct composite_context *ctx;
        struct wbc_idmap_state *state;
@@ -194,7 +194,7 @@ static void xids_to_sids_recv_ids(struct irpc_request *req)
 }
 
 NTSTATUS wbc_xids_to_sids_recv(struct composite_context *ctx,
-                              struct id_mapping **ids)
+                              struct id_map **ids)
 {
        NTSTATUS status = composite_wait(ctx);
                DEBUG(5, ("wbc_xids_to_sids_recv called\n"));
index 416dc783241040f3e9a88dc1abd7135cbfc65f51..28b2df9b3d2c91a61eb3c7b3e294b7ab3809275b 100644 (file)
@@ -35,16 +35,16 @@ struct wbc_context *wbc_init(TALLOC_CTX *mem_ctx,
 struct composite_context *wbc_sids_to_xids_send(struct wbc_context *wbc_ctx,
                                                TALLOC_CTX *mem_ctx,
                                                uint32_t count,
-                                               struct id_mapping *ids);
+                                               struct id_map *ids);
 
 NTSTATUS wbc_sids_to_xids_recv(struct composite_context *ctx,
-                              struct id_mapping **ids);
+                              struct id_map **ids);
 
 struct composite_context *wbc_xids_to_sids_send(struct wbc_context *wbc_ctx,
                                                TALLOC_CTX *mem_ctx,
                                                uint32_t count,
-                                               struct id_mapping *ids);
+                                               struct id_map *ids);
 
 NTSTATUS wbc_xids_to_sids_recv(struct composite_context *ctx,
-                              struct id_mapping **ids);
+                              struct id_map **ids);
 
index 5cefb38f75f28a75e99bb832e20ae36a40277afb..73e725bb9835c936a9529f1628e16de59de75244 100644 (file)
@@ -28,11 +28,18 @@ interface winbind
                id_type type;
        } unixid;
 
+       typedef enum {
+               ID_UNKNOWN,
+               ID_MAPPED,
+               ID_UNMAPPED,
+               ID_EXPIRED
+       } id_mapping;
+
        typedef struct {
                unixid *unixid;
                dom_sid *sid;
-               NTSTATUS status;
-       } id_mapping;
+               id_mapping status;
+       } id_map;
 
        /* a call to get runtime informations */
        void winbind_information(/* TODO */);
@@ -62,7 +69,7 @@ interface winbind
        NTSTATUS winbind_get_idmap(
                [in]     winbind_get_idmap_level level,
                [in]     uint32 count,
-               [in,out] [size_is(count)] id_mapping ids[]
+               [in,out] [size_is(count)] id_map ids[]
        );
 
 }
index c100abe5e73bd38e862615c29ce0417c3b9b1a62..3336cd04625232ab4bd1fe590e796ad9aea1e611 100644 (file)
@@ -156,7 +156,7 @@ static NTSTATUS pvfs_default_acl(struct pvfs_state *pvfs,
        NTSTATUS status;
        struct security_ace ace;
        mode_t mode;
-       struct id_mapping *ids;
+       struct id_map *ids;
        struct composite_context *ctx;
 
        *psd = security_descriptor_initialise(req);
@@ -165,7 +165,7 @@ static NTSTATUS pvfs_default_acl(struct pvfs_state *pvfs,
        }
        sd = *psd;
 
-       ids = talloc_zero_array(sd, struct id_mapping, 2);
+       ids = talloc_zero_array(sd, struct id_map, 2);
        NT_STATUS_HAVE_NO_MEMORY(ids);
 
        ids[0].unixid = talloc(ids, struct unixid);
@@ -298,7 +298,7 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
        gid_t old_gid = -1;
        uid_t new_uid = -1;
        gid_t new_gid = -1;
-       struct id_mapping *ids;
+       struct id_map *ids;
        struct composite_context *ctx;
 
        if (pvfs->acl_ops != NULL) {
@@ -311,11 +311,11 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
                return status;
        }
 
-       ids = talloc(req, struct id_mapping);
+       ids = talloc(req, struct id_map);
        NT_STATUS_HAVE_NO_MEMORY(ids);
        ids->unixid = NULL;
        ids->sid = NULL;
-       ids->status = NT_STATUS_NONE_MAPPED;
+       ids->status = ID_UNKNOWN;
 
        new_sd = info->set_secdesc.in.sd;
        orig_sd = *sd;
@@ -836,7 +836,7 @@ NTSTATUS pvfs_acl_inherited_sd(struct pvfs_state *pvfs,
        struct xattr_NTACL *acl;
        NTSTATUS status;
        struct security_descriptor *parent_sd, *sd;
-       struct id_mapping *ids;
+       struct id_map *ids;
        struct composite_context *ctx;
        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
 
@@ -873,7 +873,7 @@ NTSTATUS pvfs_acl_inherited_sd(struct pvfs_state *pvfs,
        sd = security_descriptor_initialise(req);
        NT_STATUS_HAVE_NO_MEMORY_AND_FREE(sd, tmp_ctx);
 
-       ids = talloc_array(sd, struct id_mapping, 2);
+       ids = talloc_array(sd, struct id_map, 2);
        NT_STATUS_HAVE_NO_MEMORY_AND_FREE(ids, tmp_ctx);
 
        ids[0].unixid = talloc(ids, struct unixid);
@@ -881,14 +881,14 @@ NTSTATUS pvfs_acl_inherited_sd(struct pvfs_state *pvfs,
        ids[0].unixid->id = geteuid();
        ids[0].unixid->type = ID_TYPE_UID;
        ids[0].sid = NULL;
-       ids[0].status = NT_STATUS_NONE_MAPPED;
+       ids[0].status = ID_UNKNOWN;
 
        ids[1].unixid = talloc(ids, struct unixid);
        NT_STATUS_HAVE_NO_MEMORY_AND_FREE(ids[1].unixid, tmp_ctx);
        ids[1].unixid->id = getegid();
        ids[1].unixid->type = ID_TYPE_GID;
        ids[1].sid = NULL;
-       ids[1].status = NT_STATUS_NONE_MAPPED;
+       ids[1].status = ID_UNKNOWN;
 
        ctx = wbc_xids_to_sids_send(pvfs->wbc_ctx, ids, 2, ids);
        NT_STATUS_HAVE_NO_MEMORY_AND_FREE(ctx, tmp_ctx);
index 02ed058af794115b0ba667fb893686867d726b44..c6dbf79c5788ae268fb1a83154639986df5a34a7 100644 (file)
@@ -39,7 +39,7 @@ static NTSTATUS pvfs_acl_load_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
        struct nfs4acl *acl;
        struct security_descriptor *sd;
        int i, num_ids;
-       struct id_mapping *ids;
+       struct id_map *ids;
        struct composite_context *ctx;
 
        acl = talloc_zero(mem_ctx, struct nfs4acl);
@@ -62,7 +62,7 @@ static NTSTATUS pvfs_acl_load_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
 
        /* the number of ids to map is the acl count plus uid and gid */
        num_ids = acl->a_count +2;
-       ids = talloc_array(sd, struct id_mapping, num_ids);
+       ids = talloc_array(sd, struct id_map, num_ids);
        NT_STATUS_HAVE_NO_MEMORY(ids);
 
        ids[0].unixid = talloc(ids, struct unixid);
@@ -70,14 +70,14 @@ static NTSTATUS pvfs_acl_load_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
        ids[0].unixid->id = name->st.st_uid;
        ids[0].unixid->type = ID_TYPE_UID;
        ids[0].sid = NULL;
-       ids[0].status = NT_STATUS_NONE_MAPPED;
+       ids[0].status = ID_UNKNOWN;
 
        ids[1].unixid = talloc(ids, struct unixid);
        NT_STATUS_HAVE_NO_MEMORY(ids[1].unixid);
        ids[1].unixid->id = name->st.st_gid;
        ids[1].unixid->type = ID_TYPE_GID;
        ids[1].sid = NULL;
-       ids[1].status = NT_STATUS_NONE_MAPPED;
+       ids[1].status = ID_UNKNOWN;
 
        for (i=0;i<acl->a_count;i++) {
                struct nfs4ace *a = &acl->ace[i];
@@ -90,7 +90,7 @@ static NTSTATUS pvfs_acl_load_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
                        ids[i+2].unixid->type = ID_TYPE_UID;
                }
                ids[i+2].sid = NULL;
-               ids[i+2].status = NT_STATUS_NONE_MAPPED;
+               ids[i+2].status = ID_UNKNOWN;
        }
 
        /* Allocate memory for the sids from the security descriptor to be on
@@ -127,7 +127,7 @@ static NTSTATUS pvfs_acl_save_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
        struct nfs4acl acl;
        int i;
        TALLOC_CTX *tmp_ctx;
-       struct id_mapping *ids;
+       struct id_map *ids;
        struct composite_context *ctx;
 
        tmp_ctx = talloc_new(pvfs);
@@ -146,7 +146,7 @@ static NTSTATUS pvfs_acl_save_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
                return NT_STATUS_NO_MEMORY;
        }
 
-       ids = talloc_array(tmp_ctx, struct id_mapping, acl.a_count);
+       ids = talloc_array(tmp_ctx, struct id_map, acl.a_count);
        if (ids == NULL) {
                talloc_free(tmp_ctx);
                return NT_STATUS_NO_MEMORY;
@@ -160,7 +160,7 @@ static NTSTATUS pvfs_acl_save_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
                        talloc_free(tmp_ctx);
                        return NT_STATUS_NO_MEMORY;
                }
-               ids[i].status = NT_STATUS_NONE_MAPPED;
+               ids[i].status = ID_UNKNOWN;
        }
 
        ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx,ids, acl.a_count, ids);
index 85c70d7dd107ac1927e92f20a1019e914b9e26b6..f6b73d747358707417e55f656a9c4fb5cdf4bdfe 100644 (file)
@@ -172,7 +172,7 @@ static NTSTATUS nt_token_to_unix_security(struct ntvfs_module_context *ntvfs,
        struct unixuid_private *priv = ntvfs->private_data;
        int i;
        NTSTATUS status;
-       struct id_mapping *ids;
+       struct id_map *ids;
        struct composite_context *ctx;
        *sec = talloc(req, struct unix_sec_ctx);
 
@@ -181,16 +181,16 @@ static NTSTATUS nt_token_to_unix_security(struct ntvfs_module_context *ntvfs,
                return NT_STATUS_ACCESS_DENIED;
        }
 
-       ids = talloc_array(req, struct id_mapping, token->num_sids);
+       ids = talloc_array(req, struct id_map, token->num_sids);
        NT_STATUS_HAVE_NO_MEMORY(ids);
 
        ids[0].unixid = NULL;
        ids[0].sid = token->user_sid;
-       ids[0].status = NT_STATUS_NONE_MAPPED;
+       ids[0].status = ID_UNKNOWN;
 
        ids[1].unixid = NULL;
        ids[1].sid = token->group_sid;
-       ids[1].status = NT_STATUS_NONE_MAPPED;
+       ids[1].status = ID_UNKNOWN;
 
        (*sec)->ngroups = token->num_sids - 2;
        (*sec)->groups = talloc_array(*sec, gid_t, (*sec)->ngroups);
@@ -199,7 +199,7 @@ static NTSTATUS nt_token_to_unix_security(struct ntvfs_module_context *ntvfs,
        for (i=0;i<(*sec)->ngroups;i++) {
                ids[i+2].unixid = NULL;
                ids[i+2].sid = token->sids[i+2];
-               ids[i+2].status = NT_STATUS_NONE_MAPPED;
+               ids[i+2].status = ID_UNKNOWN;
        }
 
        ctx = wbc_sids_to_xids_send(priv->wbc_ctx, ids, token->num_sids, ids);
index 20c1a39c1c2b5e6ca8a1f3481c4c2a30fe75ffdb..0a1e9f645d475602c483055fde8034321c48fead 100644 (file)
@@ -49,16 +49,16 @@ static NTSTATUS dcesrv_unixinfo_SidToUid(struct dcesrv_call_state *dce_call,
        struct wbc_context *wbc_ctx = talloc_get_type_abort(
                                                dce_call->context->private_data,
                                                struct wbc_context);
-       struct id_mapping *ids;
+       struct id_map *ids;
        struct composite_context *ctx;
 
        DEBUG(5, ("dcesrv_unixinfo_SidToUid called\n"));
 
-       ids = talloc(mem_ctx, struct  id_mapping);
+       ids = talloc(mem_ctx, struct id_map);
        NT_STATUS_HAVE_NO_MEMORY(ids);
 
        ids->sid = &r->in.sid;
-       ids->status = NT_STATUS_NONE_MAPPED;
+       ids->status = ID_UNKNOWN;
        ids->unixid = NULL;
        ctx = wbc_sids_to_xids_send(wbc_ctx, ids, 1, ids);
        NT_STATUS_HAVE_NO_MEMORY(ctx);
@@ -82,7 +82,7 @@ static NTSTATUS dcesrv_unixinfo_UidToSid(struct dcesrv_call_state *dce_call,
        struct wbc_context *wbc_ctx = talloc_get_type_abort(
                                                dce_call->context->private_data,
                                                struct wbc_context);
-       struct id_mapping *ids;
+       struct id_map *ids;
        struct composite_context *ctx;
        uint32_t uid;
        NTSTATUS status;
@@ -95,11 +95,11 @@ static NTSTATUS dcesrv_unixinfo_UidToSid(struct dcesrv_call_state *dce_call,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       ids = talloc(mem_ctx, struct id_mapping);
+       ids = talloc(mem_ctx, struct id_map);
        NT_STATUS_HAVE_NO_MEMORY(ids);
 
        ids->sid = NULL;
-       ids->status = NT_STATUS_NONE_MAPPED;
+       ids->status = ID_UNKNOWN;
        ids->unixid = talloc(ids, struct unixid);
        NT_STATUS_HAVE_NO_MEMORY(ids->unixid);
 
@@ -124,16 +124,16 @@ static NTSTATUS dcesrv_unixinfo_SidToGid(struct dcesrv_call_state *dce_call,
        struct wbc_context *wbc_ctx = talloc_get_type_abort(
                                                dce_call->context->private_data,
                                                struct wbc_context);
-       struct id_mapping *ids;
+       struct id_map *ids;
        struct composite_context *ctx;
 
        DEBUG(5, ("dcesrv_unixinfo_SidToGid called\n"));
 
-       ids = talloc(mem_ctx, struct  id_mapping);
+       ids = talloc(mem_ctx, struct id_map);
        NT_STATUS_HAVE_NO_MEMORY(ids);
 
        ids->sid = &r->in.sid;
-       ids->status = NT_STATUS_NONE_MAPPED;
+       ids->status = ID_UNKNOWN;
        ids->unixid = NULL;
        ctx = wbc_sids_to_xids_send(wbc_ctx, ids, 1, ids);
        NT_STATUS_HAVE_NO_MEMORY(ctx);
@@ -157,7 +157,7 @@ static NTSTATUS dcesrv_unixinfo_GidToSid(struct dcesrv_call_state *dce_call,
        struct wbc_context *wbc_ctx = talloc_get_type_abort(
                                                dce_call->context->private_data,
                                                struct wbc_context);
-       struct id_mapping *ids;
+       struct id_map *ids;
        struct composite_context *ctx;
        uint32_t gid;
        NTSTATUS status;
@@ -170,11 +170,11 @@ static NTSTATUS dcesrv_unixinfo_GidToSid(struct dcesrv_call_state *dce_call,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       ids = talloc(mem_ctx, struct id_mapping);
+       ids = talloc(mem_ctx, struct id_map);
        NT_STATUS_HAVE_NO_MEMORY(ids);
 
        ids->sid = NULL;
-       ids->status = NT_STATUS_NONE_MAPPED;
+       ids->status = ID_UNKNOWN;
        ids->unixid = talloc(ids, struct unixid);
        NT_STATUS_HAVE_NO_MEMORY(ids->unixid);
 
index b37de8810b2956d6f99f831d67afb2cfc4f51f90..fc7b8d447db98fab6bbd319af4a98025035dc39f 100644 (file)
@@ -638,22 +638,26 @@ failed:
 
 NTSTATUS idmap_xids_to_sids(struct idmap_context *idmap_ctx,
                            TALLOC_CTX *mem_ctx, int count,
-                           struct id_mapping *id)
+                           struct id_map *id)
 {
        int i;
        int error_count = 0;
+       NTSTATUS status;
 
        for (i = 0; i < count; ++i) {
-               id[i].status = idmap_xid_to_sid(idmap_ctx, mem_ctx,
+               status = idmap_xid_to_sid(idmap_ctx, mem_ctx,
                                                id[i].unixid, &id[i].sid);
-               if (NT_STATUS_EQUAL(id[i].status, NT_STATUS_RETRY)) {
-                       id[i].status = idmap_xid_to_sid(idmap_ctx, mem_ctx,
+               if (NT_STATUS_EQUAL(status, NT_STATUS_RETRY)) {
+                       status = idmap_xid_to_sid(idmap_ctx, mem_ctx,
                                                        id[i].unixid,
                                                        &id[i].sid);
                }
-               if (!NT_STATUS_IS_OK(id[i].status)) {
+               if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(1, ("idmapping xid_to_sid failed for id[%d]\n", i));
                        error_count++;
+                       id[i].status = ID_UNMAPPED;
+               } else {
+                       id[i].status = ID_MAPPED;
                }
        }
 
@@ -683,22 +687,26 @@ NTSTATUS idmap_xids_to_sids(struct idmap_context *idmap_ctx,
 
 NTSTATUS idmap_sids_to_xids(struct idmap_context *idmap_ctx,
                            TALLOC_CTX *mem_ctx, int count,
-                           struct id_mapping *id)
+                           struct id_map *id)
 {
        int i;
        int error_count = 0;
+       NTSTATUS status;
 
        for (i = 0; i < count; ++i) {
-               id[i].status = idmap_sid_to_xid(idmap_ctx, mem_ctx,
+               status = idmap_sid_to_xid(idmap_ctx, mem_ctx,
                                                id[i].sid, &id[i].unixid);
-               if (NT_STATUS_EQUAL(id[i].status, NT_STATUS_RETRY)) {
-                       id[i].status = idmap_sid_to_xid(idmap_ctx, mem_ctx,
+               if (NT_STATUS_EQUAL(status, NT_STATUS_RETRY)) {
+                       status = idmap_sid_to_xid(idmap_ctx, mem_ctx,
                                                        id[i].sid,
                                                        &id[i].unixid);
                }
-               if (!NT_STATUS_IS_OK(id[i].status)) {
+               if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(1, ("idmapping sid_to_xid failed for id[%d]\n", i));
                        error_count++;
+                       id[i].status = ID_UNMAPPED;
+               } else {
+                       id[i].status = ID_MAPPED;
                }
        }
 
index e569ceaca506781047524082c467d2d568ff5494..1cd34fce1869913ece39b2b49671af367fd1b29b 100644 (file)
@@ -38,7 +38,7 @@ struct composite_context *wb_gid2sid_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct gid2sid_state *state;
        struct unixid *unixid;
-       struct id_mapping *ids;
+       struct id_map *ids;
 
        DEBUG(5, ("wb_gid2sid_send called\n"));
 
@@ -57,7 +57,7 @@ struct composite_context *wb_gid2sid_send(TALLOC_CTX *mem_ctx,
        unixid->id = gid;
        unixid->type = ID_TYPE_GID;
 
-       ids = talloc(result, struct id_mapping);
+       ids = talloc(result, struct id_map);
        if (composite_nomem(ids, result)) return result;
        ids->unixid = unixid;
        ids->sid = NULL;
@@ -73,12 +73,12 @@ static void gid2sid_recv_sid(struct composite_context *ctx)
 {
        struct gid2sid_state *state = talloc_get_type(ctx->async.private_data,
                                                      struct gid2sid_state);
-       struct id_mapping *ids = NULL;
+       struct id_map *ids = NULL;
        state->ctx->status = wb_xids2sids_recv(ctx, &ids);
        if (!composite_is_ok(state->ctx)) return;
 
-       if (!NT_STATUS_IS_OK(ids->status)) {
-               composite_error(state->ctx, ids->status);
+       if (ids->status != ID_MAPPED) {
+               composite_error(state->ctx, NT_STATUS_UNSUCCESSFUL);
                return;
        }
 
index eb4d6b0d21b74a5fbe00d9ef859a88b81f9c7356..9d9fabbbf8cdb3f798ae098d3fd53e181212f7e6 100644 (file)
@@ -38,7 +38,7 @@ struct composite_context *wb_sid2gid_send(TALLOC_CTX *mem_ctx,
 {
        struct composite_context *result, *ctx;
        struct sid2gid_state *state;
-       struct id_mapping *ids;
+       struct id_map *ids;
 
        DEBUG(5, ("wb_sid2gid_send called\n"));
 
@@ -52,7 +52,7 @@ struct composite_context *wb_sid2gid_send(TALLOC_CTX *mem_ctx,
        result->private_data = state;
        state->service = service;
 
-       ids = talloc(result, struct id_mapping);
+       ids = talloc(result, struct id_map);
        if (composite_nomem(ids, result)) return result;
 
        ids->sid = dom_sid_dup(result, sid);
@@ -70,13 +70,13 @@ static void sid2gid_recv_gid(struct composite_context *ctx)
        struct sid2gid_state *state = talloc_get_type(ctx->async.private_data,
                                                      struct sid2gid_state);
 
-       struct id_mapping *ids = NULL;
+       struct id_map *ids = NULL;
 
        state->ctx->status = wb_sids2xids_recv(ctx, &ids);
        if (!composite_is_ok(state->ctx)) return;
 
-       if (!NT_STATUS_IS_OK(ids->status)) {
-               composite_error(state->ctx, ids->status);
+       if (ids->status != ID_MAPPED) {
+               composite_error(state->ctx, NT_STATUS_UNSUCCESSFUL);
                return;
        }
 
index ee5b09c7fa660434778d8831105bbe4fb2b5d5e4..7431601038cc6ff13dbf1a7b45c1112ecb68ec32 100644 (file)
@@ -38,7 +38,7 @@ struct composite_context *wb_sid2uid_send(TALLOC_CTX *mem_ctx,
 {
        struct composite_context *result, *ctx;
        struct sid2uid_state *state;
-       struct id_mapping *ids;
+       struct id_map *ids;
 
        DEBUG(5, ("wb_sid2uid_send called\n"));
 
@@ -52,7 +52,7 @@ struct composite_context *wb_sid2uid_send(TALLOC_CTX *mem_ctx,
        result->private_data = state;
        state->service = service;
 
-       ids = talloc(result, struct id_mapping);
+       ids = talloc(result, struct id_map);
        if (composite_nomem(ids, result)) return result;
 
        ids->sid = dom_sid_dup(result, sid);
@@ -70,13 +70,13 @@ static void sid2uid_recv_uid(struct composite_context *ctx)
        struct sid2uid_state *state = talloc_get_type(ctx->async.private_data,
                                                      struct sid2uid_state);
 
-       struct id_mapping *ids = NULL;
+       struct id_map *ids = NULL;
 
        state->ctx->status = wb_sids2xids_recv(ctx, &ids);
        if (!composite_is_ok(state->ctx)) return;
 
-       if (!NT_STATUS_IS_OK(ids->status)) {
-               composite_error(state->ctx, ids->status);
+       if (ids->status != ID_MAPPED) {
+               composite_error(state->ctx, NT_STATUS_UNSUCCESSFUL);
                return;
        }
 
index 51fa2212ee70a43985b4296eb8858216756a373a..617318ce52480a4b7d15ae533f2564d664b91e41 100644 (file)
 struct sids2xids_state {
        struct composite_context *ctx;
        struct wbsrv_service *service;
-       struct id_mapping *ids;
+       struct id_map *ids;
        int count;
 };
 
 struct composite_context *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
                                            struct wbsrv_service *service,
-                                           int count, struct id_mapping *ids)
+                                           int count, struct id_map *ids)
 {
        struct composite_context *result;
        struct sids2xids_state *state;
@@ -61,7 +61,7 @@ struct composite_context *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
 }
 
 NTSTATUS wb_sids2xids_recv(struct composite_context *ctx,
-                          struct id_mapping **ids)
+                          struct id_map **ids)
 {
        NTSTATUS status = composite_wait(ctx);
        struct sids2xids_state *state = talloc_get_type(ctx->private_data,
index 4c3feb735d02cb2421929f979eeef860d6f6006c..98198674b091347ab37e0881ad79e2b669a08126 100644 (file)
@@ -38,7 +38,7 @@ struct composite_context *wb_uid2sid_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct uid2sid_state *state;
        struct unixid *unixid;
-       struct id_mapping *ids;
+       struct id_map *ids;
 
        DEBUG(5, ("wb_uid2sid_send called\n"));
 
@@ -57,7 +57,7 @@ struct composite_context *wb_uid2sid_send(TALLOC_CTX *mem_ctx,
        unixid->id = uid;
        unixid->type = ID_TYPE_UID;
 
-       ids = talloc(result, struct id_mapping);
+       ids = talloc(result, struct id_map);
        if (composite_nomem(ids, result)) return result;
        ids->unixid = unixid;
        ids->sid = NULL;
@@ -73,13 +73,13 @@ static void uid2sid_recv_sid(struct composite_context *ctx)
 {
        struct uid2sid_state *state = talloc_get_type(ctx->async.private_data,
                                                      struct uid2sid_state);
-       struct id_mapping *ids = NULL;
+       struct id_map *ids = NULL;
 
        state->ctx->status = wb_xids2sids_recv(ctx, &ids);
        if (!composite_is_ok(state->ctx)) return;
 
-       if (!NT_STATUS_IS_OK(ids->status)) {
-               composite_error(state->ctx, ids->status);
+       if (ids->status != ID_MAPPED) {
+               composite_error(state->ctx, NT_STATUS_UNSUCCESSFUL);
                return;
        }
 
index 7cb57929cb10d20815d8eea8d5788d339be83bf7..9d95ac012cc89a3876529b73376053dffca40098 100644 (file)
 struct xids2sids_state {
        struct composite_context *ctx;
        struct wbsrv_service *service;
-       struct id_mapping *ids;
+       struct id_map *ids;
        int count;
 };
 
 struct composite_context *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
                                            struct wbsrv_service *service,
-                                           int count, struct id_mapping *ids)
+                                           int count, struct id_map *ids)
 {
        struct composite_context *result;
        struct xids2sids_state *state;
@@ -61,7 +61,7 @@ struct composite_context *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
 }
 
 NTSTATUS wb_xids2sids_recv(struct composite_context *ctx,
-                          struct id_mapping **ids)
+                          struct id_map **ids)
 {
        NTSTATUS status = composite_wait(ctx);
        struct xids2sids_state *state = talloc_get_type(ctx->private_data,