Revert "source4: Use wbc_sids_to_xids"
authorVolker Lendecke <vl@samba.org>
Tue, 18 Feb 2014 08:50:37 +0000 (09:50 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 18 Feb 2014 09:29:24 +0000 (10:29 +0100)
This reverts commit de7122ddc356697777cce95d22b3fab7697b30db.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/auth/unix_token.c
source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/posix/pvfs_acl_nfs4.c
source4/rpc_server/unixinfo/dcesrv_unixinfo.c

index aee950d9166cb9e374c621004a4973c165ae6865..38109452a4bc8095ef527cfce02a774d5cc68909 100644 (file)
@@ -36,6 +36,7 @@ NTSTATUS security_token_to_unix_token(TALLOC_CTX *mem_ctx,
        uint32_t s, g;
        NTSTATUS status;
        struct id_map *ids;
+       struct composite_context *ctx;
 
        /* we can't do unix security without a user and group */
        if (token->num_sids < 2) {
@@ -55,7 +56,10 @@ NTSTATUS security_token_to_unix_token(TALLOC_CTX *mem_ctx,
                ids[s].status = ID_UNKNOWN;
        }
 
-       status = wbc_sids_to_xids(wbc_ctx->event_ctx, ids, token->num_sids);
+       ctx = wbc_sids_to_xids_send(wbc_ctx, ids, token->num_sids, ids);
+       NT_STATUS_HAVE_NO_MEMORY(ctx);
+
+       status = wbc_sids_to_xids_recv(ctx, &ids);
        NT_STATUS_NOT_OK_RETURN(status);
 
        g = token->num_sids;
index 2070fd105c49fc350bf3afdb27848a43e6fe9bef..730ad484ce8165026698ac84c37be745c389acc2 100644 (file)
@@ -287,6 +287,7 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
        uid_t new_uid = -1;
        gid_t new_gid = -1;
        struct id_map *ids;
+       struct composite_context *ctx;
 
        if (pvfs->acl_ops != NULL) {
                status = pvfs->acl_ops->acl_load(pvfs, name, fd, req, &sd);
@@ -317,8 +318,9 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
                }
                if (!dom_sid_equal(sd->owner_sid, new_sd->owner_sid)) {
                        ids->sid = new_sd->owner_sid;
-                       status = wbc_sids_to_xids(pvfs->wbc_ctx->event_ctx,
-                                                 ids, 1);
+                       ctx = wbc_sids_to_xids_send(pvfs->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->xid.type == ID_TYPE_BOTH ||
@@ -335,8 +337,9 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
                }
                if (!dom_sid_equal(sd->group_sid, new_sd->group_sid)) {
                        ids->sid = new_sd->group_sid;
-                       status = wbc_sids_to_xids(pvfs->wbc_ctx->event_ctx,
-                                                 ids, 1);
+                       ctx = wbc_sids_to_xids_send(pvfs->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->xid.type == ID_TYPE_BOTH ||
index bf4d9c27210a7ab69a0e7a6f51fbf8fa4d516a3b..bb88cbc051ed2d4cc796cc33da29f5b1f57c3e73 100644 (file)
@@ -124,6 +124,7 @@ static NTSTATUS pvfs_acl_save_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
        int i;
        TALLOC_CTX *tmp_ctx;
        struct id_map *ids;
+       struct composite_context *ctx;
 
        tmp_ctx = talloc_new(pvfs);
        NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
@@ -158,7 +159,12 @@ static NTSTATUS pvfs_acl_save_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
                ids[i].status = ID_UNKNOWN;
        }
 
-       status = wbc_sids_to_xids(pvfs->wbc_ctx->event_ctx, ids, acl.a_count);
+       ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx,ids, acl.a_count, ids);
+       if (ctx == NULL) {
+               talloc_free(tmp_ctx);
+               return NT_STATUS_NO_MEMORY;
+       }
+       status = wbc_sids_to_xids_recv(ctx, &ids);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(tmp_ctx);
                return status;
index 260d5abe920ee24e311a0479a8e23f3ebb6ef356..b5b8a89c8b91debc90c1f45f92736d25b40c61bc 100644 (file)
@@ -50,6 +50,7 @@ static NTSTATUS dcesrv_unixinfo_SidToUid(struct dcesrv_call_state *dce_call,
                                                dce_call->context->private_data,
                                                struct wbc_context);
        struct id_map *ids;
+       struct composite_context *ctx;
 
        DEBUG(5, ("dcesrv_unixinfo_SidToUid called\n"));
 
@@ -59,7 +60,10 @@ static NTSTATUS dcesrv_unixinfo_SidToUid(struct dcesrv_call_state *dce_call,
        ids->sid = &r->in.sid;
        ids->status = ID_UNKNOWN;
        ZERO_STRUCT(ids->xid);
-       status = wbc_sids_to_xids(wbc_ctx->event_ctx, ids, 1);
+       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->xid.type == ID_TYPE_BOTH ||
@@ -119,6 +123,7 @@ static NTSTATUS dcesrv_unixinfo_SidToGid(struct dcesrv_call_state *dce_call,
                                                dce_call->context->private_data,
                                                struct wbc_context);
        struct id_map *ids;
+       struct composite_context *ctx;
 
        DEBUG(5, ("dcesrv_unixinfo_SidToGid called\n"));
 
@@ -128,7 +133,10 @@ static NTSTATUS dcesrv_unixinfo_SidToGid(struct dcesrv_call_state *dce_call,
        ids->sid = &r->in.sid;
        ids->status = ID_UNKNOWN;
        ZERO_STRUCT(ids->xid);
-       status = wbc_sids_to_xids(wbc_ctx->event_ctx, ids, 1);
+       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->xid.type == ID_TYPE_BOTH ||