From 0b8213ae1cd0129b7a50cf7ba3605512a990520f Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Fri, 14 Feb 2014 18:04:22 +1300 Subject: Remove all uses of the NT_STATUS_NOT_OK_RETURN_AND_FREE macro from the codebase. Following the current coding guidelines, it is considered bad practice to return from within a macro and change control flow as they look like normal function calls. Change-Id: I421e169275fe323e2b019c6cc5d386289aec07f7 Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider --- source4/ntvfs/posix/pvfs_acl.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c index b8632d2b46a..ad1787c8034 100644 --- a/source4/ntvfs/posix/pvfs_acl.c +++ b/source4/ntvfs/posix/pvfs_acl.c @@ -936,7 +936,10 @@ NTSTATUS pvfs_acl_inherited_sd(struct pvfs_state *pvfs, talloc_free(tmp_ctx); return NT_STATUS_OK; } - NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx); + if (!NT_STATUS_IS_OK(status)) { + TALLOC_FREE(tmp_ctx); + return status; + } switch (acl->version) { case 1: @@ -979,7 +982,10 @@ NTSTATUS pvfs_acl_inherited_sd(struct pvfs_state *pvfs, ids[1].status = ID_UNKNOWN; status = wbc_xids_to_sids(pvfs->ntvfs->ctx->event_ctx, ids, 2); - NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx); + if (!NT_STATUS_IS_OK(status)) { + TALLOC_FREE(tmp_ctx); + return status; + } sd->owner_sid = talloc_steal(sd, ids[0].sid); sd->group_sid = talloc_steal(sd, ids[1].sid); @@ -988,7 +994,10 @@ NTSTATUS pvfs_acl_inherited_sd(struct pvfs_state *pvfs, /* fill in the aces from the parent */ status = pvfs_acl_inherit_aces(pvfs, parent_sd, sd, container); - NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx); + if (!NT_STATUS_IS_OK(status)) { + TALLOC_FREE(tmp_ctx); + return status; + } /* if there is nothing to inherit then we fallback to the default acl */ -- cgit