Exemplo n.º 1
0
static NTSTATUS nfs4acl_xattr_fget_nt_acl(struct vfs_handle_struct *handle,
				   struct files_struct *fsp,
				   uint32_t security_info,
				   TALLOC_CTX *mem_ctx,
				   struct security_descriptor **sd)
{
	struct SMB4ACL_T *smb4acl = NULL;
	TALLOC_CTX *frame = talloc_stackframe();
	DATA_BLOB blob;
	NTSTATUS status;

	status = nfs4acl_get_blob(handle, fsp, NULL, frame, &blob);
	if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
		TALLOC_FREE(frame);
		return nfs4acl_xattr_default_sd(
			handle, fsp->fsp_name, mem_ctx, sd);
	}
	if (!NT_STATUS_IS_OK(status)) {
		TALLOC_FREE(frame);
		return status;
	}

	status = nfs4acl_blob_to_smb4(handle, &blob, frame, &smb4acl);
	if (!NT_STATUS_IS_OK(status)) {
		TALLOC_FREE(frame);
		return status;
	}

	status = smb_fget_nt_acl_nfs4(fsp, NULL, security_info, mem_ctx,
				      sd, smb4acl);
	TALLOC_FREE(frame);
	return status;
}
Exemplo n.º 2
0
static NTSTATUS zfsacl_fget_nt_acl(struct vfs_handle_struct *handle,
				 struct files_struct *fsp,
				 uint32 security_info,
				 struct security_descriptor **ppdesc)
{
	SMB4ACL_T *pacl;
	NTSTATUS status;

	status = zfs_get_nt_acl_common(fsp->fsp_name->base_name, security_info,
				       &pacl);
	if (!NT_STATUS_IS_OK(status)) {
		return status;
	}

	return smb_fget_nt_acl_nfs4(fsp, security_info, ppdesc, pacl);
}
Exemplo n.º 3
0
static NTSTATUS aixjfs2_fget_nt_acl(vfs_handle_struct *handle,
	files_struct *fsp, uint32 security_info,
	struct security_descriptor **ppdesc)
{
	SMB4ACL_T *pacl = NULL;
	bool	result;
	bool	retryPosix = False;

	*ppdesc = NULL;
	result = aixjfs2_get_nfs4_acl(fsp->fsp_name->base_name, &pacl,
				      &retryPosix);
	if (retryPosix)
	{
		DEBUG(10, ("retrying with posix acl...\n"));
		return posix_fget_nt_acl(fsp, security_info, ppdesc);
	}
	if (result==False)
		return NT_STATUS_ACCESS_DENIED;

	return smb_fget_nt_acl_nfs4(fsp, security_info, ppdesc, pacl);
}
Exemplo n.º 4
0
static NTSTATUS gpfsacl_fget_nt_acl(vfs_handle_struct *handle,
	files_struct *fsp, uint32 security_info,
	SEC_DESC **ppdesc)
{
	SMB4ACL_T *pacl = NULL;
	int	result;

	*ppdesc = NULL;
	result = gpfs_get_nfs4_acl(fsp->fsp_name, &pacl);

	if (result == 0)
		return smb_fget_nt_acl_nfs4(fsp, security_info, ppdesc, pacl);

	if (result > 0) {
		DEBUG(10, ("retrying with posix acl...\n"));
		return posix_fget_nt_acl(fsp, security_info, ppdesc);
	}

	/* GPFS ACL was not read, something wrong happened, error code is set in errno */
	return map_nt_error_from_unix(errno);
}
Exemplo n.º 5
0
static NTSTATUS nfs4acl_xattr_fget_nt_acl(struct vfs_handle_struct *handle,
				   struct files_struct *fsp,
				   uint32_t security_info,
				   TALLOC_CTX *mem_ctx,
				   struct security_descriptor **ppdesc)
{
	struct SMB4ACL_T *pacl;
	NTSTATUS status;
	TALLOC_CTX *frame = talloc_stackframe();

	status = nfs4_fget_nfs4_acl(handle, frame, fsp, &pacl);
	if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
		pacl = nfs4acls_inheritacl(handle, fsp->fsp_name->base_name,
					   frame);
	}
	else if (!NT_STATUS_IS_OK(status)) {
		TALLOC_FREE(frame);
		return status;
	}

	status = smb_fget_nt_acl_nfs4(fsp, security_info, mem_ctx, ppdesc, pacl);
	TALLOC_FREE(frame);
	return status;
}