summaryrefslogtreecommitdiffstats
path: root/source4/ntvfs/posix/pvfs_fileinfo.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-25 07:03:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:40 -0500
commit7fa912e708331e729d5e4ffad28646d294d4745a (patch)
treec4f6296d3ab542667c657feccaaea394d74ba2f5 /source4/ntvfs/posix/pvfs_fileinfo.c
parent925cb13fcd5f0c35ab4d2b5da5ab290066ed57de (diff)
downloadsamba-7fa912e708331e729d5e4ffad28646d294d4745a.tar.gz
samba-7fa912e708331e729d5e4ffad28646d294d4745a.tar.xz
samba-7fa912e708331e729d5e4ffad28646d294d4745a.zip
r3200: - improved the accuracy of openx emulation. We now nearly pass the openx portion of RAW-OPEN
- fixed directory size reporting to make it consistent. we now pass the ntcreatex portion of RAW-OPEN (This used to be commit 6282e5811b8d4f1c17152d86875ac60d1323779d)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_fileinfo.c')
-rw-r--r--source4/ntvfs/posix/pvfs_fileinfo.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source4/ntvfs/posix/pvfs_fileinfo.c b/source4/ntvfs/posix/pvfs_fileinfo.c
index 4fa2c1601ba..2e2acb2c828 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);