[PATCH] Add tests for our NFSv4 ACL code

Alexander Werth werth at linux.vnet.ibm.com
Tue Apr 16 04:11:14 MDT 2013


On Sun, 2013-04-14 at 22:00 +1000, Andrew Bartlett wrote:
> I've been asked to look into some bugs in our NFSv4 ACL code, and before
> I started, I wanted to have some tests to try and ensure I didn't make
> any unfortunate regressions while fixing things. 

I think the following section in nfs4acl_xattr_get_nt_acl() is a bit cumbersome:

if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
	if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
		status = SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info,
						 mem_ctx, ppdesc);
	}
	TALLOC_FREE(frame);
	return status;
}
if (!NT_STATUS_IS_OK(status)) {
	TALLOC_FREE(frame);
	return status;
}

The one you wrote for nfs4acl_xattr_fget_nt_acl() looks better:

if (!NT_STATUS_IS_OK(status)) {
	if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
	status = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info,
					  mem_ctx, ppdesc);
	}
	TALLOC_FREE(frame);
	return status;
}

Regards, 
Alexander



More information about the samba-technical mailing list