summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r--source4/ntvfs/posix/pvfs_search.c6
-rw-r--r--source4/ntvfs/posix/pvfs_unlink.c2
-rw-r--r--source4/ntvfs/posix/pvfs_util.c6
-rw-r--r--source4/ntvfs/posix/vfs_posix.h1
4 files changed, 11 insertions, 4 deletions
diff --git a/source4/ntvfs/posix/pvfs_search.c b/source4/ntvfs/posix/pvfs_search.c
index 1464609e98..ff9ad20b43 100644
--- a/source4/ntvfs/posix/pvfs_search.c
+++ b/source4/ntvfs/posix/pvfs_search.c
@@ -54,7 +54,7 @@ static NTSTATUS fill_search_info(struct pvfs_state *pvfs,
return status;
}
- if (!pvfs_match_attrib(pvfs, name, search->search_attrib)) {
+ if (!pvfs_match_attrib(pvfs, name, search->search_attrib, search->must_attrib)) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
@@ -296,7 +296,8 @@ static NTSTATUS pvfs_search_first_old(struct ntvfs_module_context *ntvfs,
search->handle = id;
search->dir = dir;
search->current_index = 0;
- search->search_attrib = search_attrib;
+ search->search_attrib = search_attrib & 0xFF;
+ search->must_attrib = (search_attrib>>8) & 0xFF;
talloc_set_destructor(search, pvfs_search_destructor);
@@ -425,6 +426,7 @@ NTSTATUS pvfs_search_first(struct ntvfs_module_context *ntvfs,
search->dir = dir;
search->current_index = 0;
search->search_attrib = search_attrib;
+ search->must_attrib = 0;
talloc_set_destructor(search, pvfs_search_destructor);
diff --git a/source4/ntvfs/posix/pvfs_unlink.c b/source4/ntvfs/posix/pvfs_unlink.c
index 10a27a5de7..12ab583082 100644
--- a/source4/ntvfs/posix/pvfs_unlink.c
+++ b/source4/ntvfs/posix/pvfs_unlink.c
@@ -42,7 +42,7 @@ static NTSTATUS pvfs_unlink_one(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx,
}
/* make sure its matches the given attributes */
- if (!pvfs_match_attrib(pvfs, name, attrib)) {
+ if (!pvfs_match_attrib(pvfs, name, attrib, 0)) {
talloc_free(name);
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
diff --git a/source4/ntvfs/posix/pvfs_util.c b/source4/ntvfs/posix/pvfs_util.c
index 3c65453798..ae1dc6236d 100644
--- a/source4/ntvfs/posix/pvfs_util.c
+++ b/source4/ntvfs/posix/pvfs_util.c
@@ -49,11 +49,15 @@ NTSTATUS pvfs_map_errno(struct pvfs_state *pvfs, int unix_errno)
this is used by calls like unlink and search which take an attribute
and only include special files if they match the given attribute
*/
-BOOL pvfs_match_attrib(struct pvfs_state *pvfs, struct pvfs_filename *name, uint32_t attrib)
+BOOL pvfs_match_attrib(struct pvfs_state *pvfs, struct pvfs_filename *name,
+ uint32_t attrib, uint32_t must_attrib)
{
if ((name->dos.attrib & ~attrib) &
(FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_SYSTEM)) {
return False;
}
+ if (must_attrib & ~name->dos.attrib) {
+ return False;
+ }
return True;
}
diff --git a/source4/ntvfs/posix/vfs_posix.h b/source4/ntvfs/posix/vfs_posix.h
index d4c0b19974..656ac85380 100644
--- a/source4/ntvfs/posix/vfs_posix.h
+++ b/source4/ntvfs/posix/vfs_posix.h
@@ -90,6 +90,7 @@ struct pvfs_search_state {
uint16_t handle;
uint_t current_index;
uint16_t search_attrib;
+ uint16_t must_attrib;
struct pvfs_dir *dir;
};