From 4137f63c7aadc4dc527a35aa2488695f2130de4b Mon Sep 17 00:00:00 2001 From: uvman Date: Fri, 11 Nov 2005 23:55:14 +0000 Subject: [PATCH] Report the MFT record flags properly in ntfsinfo. --- ChangeLog | 5 ++++- ntfsprogs/ntfsinfo.c | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 152d226d..954162be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -77,7 +77,10 @@ xx/xx/2005 - 1.12.2-WIP ntfs_crate_symlink() for Interix symbolic links creation. (Yura) - Teach ntfs_create() to create Interix FIFOs and sockets. (Yura) - Fix the -u option in ntfsundelete. Instead of a confusing optional - parameter, there's a new option -i with a required parameter (Rich) + parameter, there's a new option -i with a required parameter. (Rich) + - Make ntfsinfo report the MFT record flags properly, this includes + the less encountered flags, and reporting the in_use flag instead of + inverting it to unused. (Yuval) 10/10/2005 - 1.12.1 - Minor fix to location of mount.ntfs-fuse and mkfs.ntfs. diff --git a/ntfsprogs/ntfsinfo.c b/ntfsprogs/ntfsinfo.c index bdb5e6b5..cf86293e 100644 --- a/ntfsprogs/ntfsinfo.c +++ b/ntfsprogs/ntfsinfo.c @@ -1875,15 +1875,25 @@ static void ntfs_dump_inode_general_info(ntfs_inode *inode) printf("MFT record Flags:\t\t "); if (inode_flags) { - if (!(MFT_RECORD_IN_USE & inode_flags)) { - printf("DELETED "); + if (MFT_RECORD_IN_USE & inode_flags) { + printf("IN_USE "); + inode_flags &= ~MFT_RECORD_IN_USE; } if (MFT_RECORD_IS_DIRECTORY & inode_flags) { printf("DIRECTORY "); + inode_flags &= ~MFT_RECORD_IS_DIRECTORY; } - if (~(MFT_RECORD_IN_USE | MFT_RECORD_IS_DIRECTORY) & inode_flags) { + /* The meaning of IS_4 is illusive but not its existence. */ + if (MFT_RECORD_IS_4 & inode_flags) { + printf("IS_4 "); + inode_flags &= ~MFT_RECORD_IS_4; + } + if (MFT_RECORD_IS_VIEW_INDEX & inode_flags) { + printf("VIEW_INDEX "); + inode_flags &= ~MFT_RECORD_IS_VIEW_INDEX; + } + if (inode_flags) printf("UNKNOWN:0x%04hx",inode_flags); - } } else { printf("none"); }