summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2009-04-23 16:37:11 +0200
committerKai Blin <kai@samba.org>2010-02-11 23:56:35 +0100
commitea055e8c7905ec5d229fd5b50ca9ec8f60073b53 (patch)
tree1fbb879a3bb2ff7b273c512dbec6e4b86b694521 /source4
parent86d70ae94425c34fcb7cc7791a6e54b1a47f21cc (diff)
downloadsamba-ea055e8c7905ec5d229fd5b50ca9ec8f60073b53.tar.gz
samba-ea055e8c7905ec5d229fd5b50ca9ec8f60073b53.tar.bz2
samba-ea055e8c7905ec5d229fd5b50ca9ec8f60073b53.zip
s4: Switch to S3-style id mapping data types.
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/wbclient/wbclient.c10
-rw-r--r--source4/libcli/wbclient/wbclient.h8
-rw-r--r--source4/librpc/idl/winbind.idl13
-rw-r--r--source4/ntvfs/posix/pvfs_acl.c18
-rw-r--r--source4/ntvfs/posix/pvfs_acl_nfs4.c16
-rw-r--r--source4/ntvfs/unixuid/vfs_unixuid.c10
-rw-r--r--source4/rpc_server/unixinfo/dcesrv_unixinfo.c24
-rw-r--r--source4/winbind/idmap.c28
-rw-r--r--source4/winbind/wb_gid2sid.c10
-rw-r--r--source4/winbind/wb_sid2gid.c10
-rw-r--r--source4/winbind/wb_sid2uid.c10
-rw-r--r--source4/winbind/wb_sids2xids.c6
-rw-r--r--source4/winbind/wb_uid2sid.c10
-rw-r--r--source4/winbind/wb_xids2sids.c6
14 files changed, 97 insertions, 82 deletions
diff --git a/source4/libcli/wbclient/wbclient.c b/source4/libcli/wbclient/wbclient.c
index da7d678da9..ed722788ad 100644
--- a/source4/libcli/wbclient/wbclient.c
+++ b/source4/libcli/wbclient/wbclient.c
@@ -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"));
diff --git a/source4/libcli/wbclient/wbclient.h b/source4/libcli/wbclient/wbclient.h
index 416dc78324..28b2df9b3d 100644
--- a/source4/libcli/wbclient/wbclient.h
+++ b/source4/libcli/wbclient/wbclient.h
@@ -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);
diff --git a/source4/librpc/idl/winbind.idl b/source4/librpc/idl/winbind.idl
index 5cefb38f75..73e725bb98 100644
--- a/source4/librpc/idl/winbind.idl
+++ b/source4/librpc/idl/winbind.idl
@@ -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[]
);
}
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index c100abe5e7..3336cd0462 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -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);
diff --git a/source4/ntvfs/posix/pvfs_acl_nfs4.c b/source4/ntvfs/posix/pvfs_acl_nfs4.c
index 02ed058af7..c6dbf79c57 100644
--- a/source4/ntvfs/posix/pvfs_acl_nfs4.c
+++ b/source4/ntvfs/posix/pvfs_acl_nfs4.c
@@ -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);
diff --git a/source4/ntvfs/unixuid/vfs_unixuid.c b/source4/ntvfs/unixuid/vfs_unixuid.c
index 85c70d7dd1..f6b73d7473 100644
--- a/source4/ntvfs/unixuid/vfs_unixuid.c
+++ b/source4/ntvfs/unixuid/vfs_unixuid.c
@@ -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);
diff --git a/source4/rpc_server/unixinfo/dcesrv_unixinfo.c b/source4/rpc_server/unixinfo/dcesrv_unixinfo.c
index 20c1a39c1c..0a1e9f645d 100644
--- a/source4/rpc_server/unixinfo/dcesrv_unixinfo.c
+++ b/source4/rpc_server/unixinfo/dcesrv_unixinfo.c
@@ -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);
diff --git a/source4/winbind/idmap.c b/source4/winbind/idmap.c
index b37de8810b..fc7b8d447d 100644
--- a/source4/winbind/idmap.c
+++ b/source4/winbind/idmap.c
@@ -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;
}
}
diff --git a/source4/winbind/wb_gid2sid.c b/source4/winbind/wb_gid2sid.c
index e569ceaca5..1cd34fce18 100644
--- a/source4/winbind/wb_gid2sid.c
+++ b/source4/winbind/wb_gid2sid.c
@@ -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;
}
diff --git a/source4/winbind/wb_sid2gid.c b/source4/winbind/wb_sid2gid.c
index eb4d6b0d21..9d9fabbbf8 100644
--- a/source4/winbind/wb_sid2gid.c
+++ b/source4/winbind/wb_sid2gid.c
@@ -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;
}
diff --git a/source4/winbind/wb_sid2uid.c b/source4/winbind/wb_sid2uid.c
index ee5b09c7fa..7431601038 100644
--- a/source4/winbind/wb_sid2uid.c
+++ b/source4/winbind/wb_sid2uid.c
@@ -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;
}
diff --git a/source4/winbind/wb_sids2xids.c b/source4/winbind/wb_sids2xids.c
index 51fa2212ee..617318ce52 100644
--- a/source4/winbind/wb_sids2xids.c
+++ b/source4/winbind/wb_sids2xids.c
@@ -27,13 +27,13 @@
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,
diff --git a/source4/winbind/wb_uid2sid.c b/source4/winbind/wb_uid2sid.c
index 4c3feb735d..98198674b0 100644
--- a/source4/winbind/wb_uid2sid.c
+++ b/source4/winbind/wb_uid2sid.c
@@ -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;
}
diff --git a/source4/winbind/wb_xids2sids.c b/source4/winbind/wb_xids2sids.c
index 7cb57929cb..9d95ac012c 100644
--- a/source4/winbind/wb_xids2sids.c
+++ b/source4/winbind/wb_xids2sids.c
@@ -27,13 +27,13 @@
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,