diff options
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r-- | source4/ntvfs/posix/pvfs_fileinfo.c | 11 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_open.c | 7 |
2 files changed, 7 insertions, 11 deletions
diff --git a/source4/ntvfs/posix/pvfs_fileinfo.c b/source4/ntvfs/posix/pvfs_fileinfo.c index 4fa2c1601b..2e2acb2c82 100644 --- a/source4/ntvfs/posix/pvfs_fileinfo.c +++ b/source4/ntvfs/posix/pvfs_fileinfo.c @@ -57,12 +57,6 @@ static uint32_t dos_mode_from_stat(struct pvfs_state *pvfs, struct stat *st) if (S_ISDIR(st->st_mode)) result = FILE_ATTRIBUTE_DIRECTORY | (result & FILE_ATTRIBUTE_READONLY); -#if defined (HAVE_STAT_ST_BLOCKS) && defined (HAVE_STAT_ST_BLKSIZE) - if (st->st_size > st->st_blocks * (off_t)st->st_blksize) { - result |= FILE_ATTRIBUTE_SPARSE; - } -#endif - if (!(result & (FILE_ATTRIBUTE_READONLY| FILE_ATTRIBUTE_ARCHIVE| @@ -82,6 +76,11 @@ static uint32_t dos_mode_from_stat(struct pvfs_state *pvfs, struct stat *st) */ NTSTATUS pvfs_fill_dos_info(struct pvfs_state *pvfs, struct pvfs_filename *name) { + /* make directories appear as size 0 */ + if (S_ISDIR(name->st.st_mode)) { + name->st.st_size = 0; + } + /* for now just use the simple samba mapping */ unix_to_nt_time(&name->dos.create_time, name->st.st_ctime); unix_to_nt_time(&name->dos.access_time, name->st.st_atime); diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index 4844521c45..5e162ad147 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -180,8 +180,8 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs, io->generic.out.write_time = name->dos.write_time; io->generic.out.change_time = name->dos.change_time; io->generic.out.attrib = name->dos.attrib; - io->generic.out.alloc_size = 0; - io->generic.out.size = 0; + io->generic.out.alloc_size = name->dos.alloc_size; + io->generic.out.size = name->st.st_size; io->generic.out.file_type = FILE_TYPE_DISK; io->generic.out.ipc_state = 0; io->generic.out.is_directory = 1; @@ -457,9 +457,6 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs, switch (io->generic.in.open_disposition) { case NTCREATEX_DISP_SUPERSEDE: - if (!name->exists) { - return NT_STATUS_OBJECT_NAME_NOT_FOUND; - } flags = O_TRUNC; break; |