From 5d43e167d5769b3956a07d7cc47548161101537f Mon Sep 17 00:00:00 2001 From: "(none)!yura" <(none)!yura> Date: Thu, 8 Jul 2004 20:19:52 +0000 Subject: [PATCH] Fixed bug that cause ntfs_attr_p{read,write} fail on resident encrypted attribute (Logical change 1.448) --- libntfs/attrib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libntfs/attrib.c b/libntfs/attrib.c index 81502626..1a39689f 100644 --- a/libntfs/attrib.c +++ b/libntfs/attrib.c @@ -713,10 +713,10 @@ s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count, void *b) if (NAttrCompressed(na) && NAttrNonResident(na)) return ntfs_compressed_attr_pread(na, pos, count, b); /* - * Encrypted attributes are not supported. We return access denied, - * which is what Windows NT4 does, too. + * Encrypted non-resident attributes are not supported. We return + * access denied, which is what Windows NT4 does, too. */ - if (NAttrEncrypted(na)) { + if (NAttrEncrypted(na) && NAttrNonResident(na)) { errno = EACCES; return -1; } @@ -878,10 +878,10 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, void *b) } vol = na->ni->vol; /* - * Encrypted attributes are not supported. We return access denied, - * which is what Windows NT4 does, too. + * Encrypted non-resident attributes are not supported. We return + * access denied, which is what Windows NT4 does, too. */ - if (NAttrEncrypted(na)) { + if (NAttrEncrypted(na) && NAttrNonResident(na)) { errno = EACCES; return -1; }