summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-06 09:34:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:33 -0500
commitb5acd1963a43b91036351506a415081601fd1ba6 (patch)
tree90c780f32e064e57655c67aa24f836f6c8b03272 /source4/ntvfs
parenta9158e0d47636e25ce374391cd9b02df3d27b390 (diff)
downloadsamba-b5acd1963a43b91036351506a415081601fd1ba6.tar.gz
samba-b5acd1963a43b91036351506a415081601fd1ba6.tar.bz2
samba-b5acd1963a43b91036351506a415081601fd1ba6.zip
r3575: fixed attribute normalisation in xattr code. RAW-SEARCH now passes again.
(This used to be commit 66bdc6e78c2c7ce4e215919959f0d0623ef06723)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/posix/pvfs_util.c16
-rw-r--r--source4/ntvfs/posix/pvfs_xattr.c4
2 files changed, 19 insertions, 1 deletions
diff --git a/source4/ntvfs/posix/pvfs_util.c b/source4/ntvfs/posix/pvfs_util.c
index 50a78c2965..92d696970a 100644
--- a/source4/ntvfs/posix/pvfs_util.c
+++ b/source4/ntvfs/posix/pvfs_util.c
@@ -63,3 +63,19 @@ NTSTATUS pvfs_match_attrib(struct pvfs_state *pvfs, struct pvfs_filename *name,
}
return NT_STATUS_OK;
}
+
+
+/*
+ normalise a file attribute
+*/
+uint32_t pvfs_attrib_normalise(uint32_t attrib)
+{
+ if (attrib == 0) {
+ attrib = FILE_ATTRIBUTE_NORMAL;
+ }
+ if (attrib != FILE_ATTRIBUTE_NORMAL) {
+ attrib &= ~FILE_ATTRIBUTE_NORMAL;
+ }
+ return attrib;
+}
+
diff --git a/source4/ntvfs/posix/pvfs_xattr.c b/source4/ntvfs/posix/pvfs_xattr.c
index e086a019ba..f4063b48b5 100644
--- a/source4/ntvfs/posix/pvfs_xattr.c
+++ b/source4/ntvfs/posix/pvfs_xattr.c
@@ -184,7 +184,7 @@ NTSTATUS pvfs_dosattrib_load(struct pvfs_state *pvfs, struct pvfs_filename *name
switch (attrib.version) {
case 1:
info1 = &attrib.info.info1;
- name->dos.attrib = info1->attrib;
+ name->dos.attrib = pvfs_attrib_normalise(info1->attrib);
name->dos.ea_size = info1->ea_size;
if (name->st.st_size == info1->size) {
name->dos.alloc_size = info1->alloc_size;
@@ -224,6 +224,8 @@ NTSTATUS pvfs_dosattrib_save(struct pvfs_state *pvfs, struct pvfs_filename *name
attrib.version = 1;
info1 = &attrib.info.info1;
+ name->dos.attrib = pvfs_attrib_normalise(name->dos.attrib);
+
info1->attrib = name->dos.attrib;
info1->ea_size = name->dos.ea_size;
info1->size = name->st.st_size;