summaryrefslogtreecommitdiff
path: root/source4/rpc_server/unixinfo
diff options
context:
space:
mode:
Diffstat (limited to 'source4/rpc_server/unixinfo')
-rw-r--r--source4/rpc_server/unixinfo/dcesrv_unixinfo.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/source4/rpc_server/unixinfo/dcesrv_unixinfo.c b/source4/rpc_server/unixinfo/dcesrv_unixinfo.c
index 2ef34ce93a..b5b8a89c8b 100644
--- a/source4/rpc_server/unixinfo/dcesrv_unixinfo.c
+++ b/source4/rpc_server/unixinfo/dcesrv_unixinfo.c
@@ -59,16 +59,16 @@ static NTSTATUS dcesrv_unixinfo_SidToUid(struct dcesrv_call_state *dce_call,
ids->sid = &r->in.sid;
ids->status = ID_UNKNOWN;
- ids->unixid = NULL;
+ ZERO_STRUCT(ids->xid);
ctx = wbc_sids_to_xids_send(wbc_ctx, ids, 1, ids);
NT_STATUS_HAVE_NO_MEMORY(ctx);
status = wbc_sids_to_xids_recv(ctx, &ids);
NT_STATUS_NOT_OK_RETURN(status);
- if (ids->unixid->type == ID_TYPE_BOTH ||
- ids->unixid->type == ID_TYPE_UID) {
- *r->out.uid = ids->unixid->id;
+ if (ids->xid.type == ID_TYPE_BOTH ||
+ ids->xid.type == ID_TYPE_UID) {
+ *r->out.uid = ids->xid.id;
return NT_STATUS_OK;
} else {
return NT_STATUS_INVALID_SID;
@@ -100,11 +100,9 @@ static NTSTATUS dcesrv_unixinfo_UidToSid(struct dcesrv_call_state *dce_call,
ids->sid = NULL;
ids->status = ID_UNKNOWN;
- ids->unixid = talloc(ids, struct unixid);
- NT_STATUS_HAVE_NO_MEMORY(ids->unixid);
- ids->unixid->id = uid;
- ids->unixid->type = ID_TYPE_UID;
+ ids->xid.id = uid;
+ ids->xid.type = ID_TYPE_UID;
ctx = wbc_xids_to_sids_send(wbc_ctx, ids, 1, ids);
NT_STATUS_HAVE_NO_MEMORY(ctx);
@@ -134,16 +132,16 @@ static NTSTATUS dcesrv_unixinfo_SidToGid(struct dcesrv_call_state *dce_call,
ids->sid = &r->in.sid;
ids->status = ID_UNKNOWN;
- ids->unixid = NULL;
+ ZERO_STRUCT(ids->xid);
ctx = wbc_sids_to_xids_send(wbc_ctx, ids, 1, ids);
NT_STATUS_HAVE_NO_MEMORY(ctx);
status = wbc_sids_to_xids_recv(ctx, &ids);
NT_STATUS_NOT_OK_RETURN(status);
- if (ids->unixid->type == ID_TYPE_BOTH ||
- ids->unixid->type == ID_TYPE_GID) {
- *r->out.gid = ids->unixid->id;
+ if (ids->xid.type == ID_TYPE_BOTH ||
+ ids->xid.type == ID_TYPE_GID) {
+ *r->out.gid = ids->xid.id;
return NT_STATUS_OK;
} else {
return NT_STATUS_INVALID_SID;
@@ -175,11 +173,9 @@ static NTSTATUS dcesrv_unixinfo_GidToSid(struct dcesrv_call_state *dce_call,
ids->sid = NULL;
ids->status = ID_UNKNOWN;
- ids->unixid = talloc(ids, struct unixid);
- NT_STATUS_HAVE_NO_MEMORY(ids->unixid);
- ids->unixid->id = gid;
- ids->unixid->type = ID_TYPE_GID;
+ ids->xid.id = gid;
+ ids->xid.type = ID_TYPE_GID;
ctx = wbc_xids_to_sids_send(wbc_ctx, ids, 1, ids);
NT_STATUS_HAVE_NO_MEMORY(ctx);