summaryrefslogtreecommitdiffstats
path: root/src/ntfs_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-02-28 08:57:36 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2008-02-28 08:57:36 +0100
commit30e5494daac64f4d916f7efed60123f07733dc18 (patch)
treeb139eabca2c1c9debf6656c1e3359ea4f6fe0e35 /src/ntfs_dir.c
parentc111650f878ce4090a33f2a0c26760746971bea1 (diff)
Hide NTFS system files but not files beginning by '$'
Diffstat (limited to 'src/ntfs_dir.c')
-rw-r--r--src/ntfs_dir.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ntfs_dir.c b/src/ntfs_dir.c
index 54205b3..64b015e 100644
--- a/src/ntfs_dir.c
+++ b/src/ntfs_dir.c
@@ -79,6 +79,9 @@
#define NTFS_DT_DIR 4
#define NTFS_DT_REG 8
#define NTFS_TIME_OFFSET ((s64)(369 * 365 + 89) * 24 * 3600 * 10000000)
+#ifndef FILE_first_user
+#define FILE_first_user 16
+#endif
/*
* This is the "ntfs_filldir" function type, used by ntfs_readdir() to let
@@ -197,8 +200,8 @@ static int ntfs_td_list_entry( struct ntfs_dir_struct *ls, const ntfschar *name
#endif
result = 0; /* These are successful */
- if (filename[0] == '$') /* system */
- goto free;
+ if (MREF(mref) < FILE_first_user) /* Hide system file */
+ goto free;
/* Keep FILE_NAME_WIN32 and FILE_NAME_POSIX */
if ((name_type & FILE_NAME_WIN32_AND_DOS) == FILE_NAME_DOS)
goto free;