From 114bcfe837699083be2a5145b9f44092a649cae4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 18 Dec 2004 23:31:17 +0000 Subject: r4264: fix acl handling on systems without xattr support (This used to be commit 89845388ea82d9bfbdc6ca8da40f47437a270400) --- source4/ntvfs/posix/pvfs_xattr.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'source4') diff --git a/source4/ntvfs/posix/pvfs_xattr.c b/source4/ntvfs/posix/pvfs_xattr.c index 4487663e8d..baa6c15e31 100644 --- a/source4/ntvfs/posix/pvfs_xattr.c +++ b/source4/ntvfs/posix/pvfs_xattr.c @@ -35,12 +35,24 @@ static NTSTATUS pull_xattr_blob(struct pvfs_state *pvfs, size_t estimated_size, DATA_BLOB *blob) { + NTSTATUS status; + if (pvfs->ea_db) { return pull_xattr_blob_tdb(pvfs, mem_ctx, attr_name, fname, fd, estimated_size, blob); } - return pull_xattr_blob_system(pvfs, mem_ctx, attr_name, fname, - fd, estimated_size, blob); + + status = pull_xattr_blob_system(pvfs, mem_ctx, attr_name, fname, + fd, estimated_size, blob); + + /* if the filesystem doesn't support them, then tell pvfs not to try again */ + if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { + DEBUG(5,("pvfs_xattr: xattr not supported in filesystem\n")); + pvfs->flags &= ~PVFS_FLAG_XATTR_ENABLE; + status = NT_STATUS_NOT_FOUND; + } + + return status; } /* @@ -158,14 +170,6 @@ NTSTATUS pvfs_dosattrib_load(struct pvfs_state *pvfs, struct pvfs_filename *name &attrib, (ndr_pull_flags_fn_t)ndr_pull_xattr_DosAttrib); - /* if the filesystem doesn't support them, then tell pvfs not to try again */ - if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { - DEBUG(5,("pvfs_xattr: xattr not supported in filesystem\n")); - pvfs->flags &= ~PVFS_FLAG_XATTR_ENABLE; - talloc_free(mem_ctx); - return NT_STATUS_OK; - } - /* not having a DosAttrib is not an error */ if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) { talloc_free(mem_ctx); @@ -341,7 +345,7 @@ NTSTATUS pvfs_acl_load(struct pvfs_state *pvfs, struct pvfs_filename *name, int NTSTATUS status; ZERO_STRUCTP(acl); if (!(pvfs->flags & PVFS_FLAG_XATTR_ENABLE)) { - return NT_STATUS_OK; + return NT_STATUS_NOT_FOUND; } status = pvfs_xattr_ndr_load(pvfs, acl, name->full_name, fd, XATTR_NTACL_NAME, -- cgit