diff options
author | Andreas Dilger <adilger@dilger.ca> | 2017-10-15 22:27:40 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-10-15 22:27:40 -0400 |
commit | 8dca24c3cb23d69a484b28a0bc2f64a89508c1eb (patch) | |
tree | 2b8c9b5d401f428cc7679146db0955389edaf9d3 | |
parent | 21f685b6c1914bef2cf1e54ec5f73c7dce10a9f1 (diff) | |
download | e2fsprogs-8dca24c3cb23d69a484b28a0bc2f64a89508c1eb.tar.gz |
debugfs: print "Xst" bits of file mode via stat
Currently, debugfs does not print the Xst high-order mode bits
in the "stat" output. While "ls -l" shows these bits are set:
# ls -il /mnt/tmp/O/0/d2/406306
1588 0 -rwSrwSrw- 1 root root 0 Dec 31 1969 /mnt/tmp/O/0/d2/406306
debugfs currently only prints the low nine "ugo" mode bits:
# debugfs -c -R "stat O/0/d2/406306" /dev/vgmyth/lvmythost4
Inode: 1588 Type: regular Mode: 0666 Flags: 0x80000
Fix debugfs so that the high-order mode bits are also printed,
if available, otherwise only print the standard low mode bits.
# debugfs -c -R "stat O/0/d2/406306" /dev/vgmyth/lvmythost4
Inode: 1588 Type: regular Mode: 06666 Flags: 0x80000
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | debugfs/debugfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 0a4b536bc..4a533b53b 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -830,8 +830,8 @@ void internal_dump_inode(FILE *out, const char *prefix, else if (LINUX_S_ISSOCK(inode->i_mode)) i_type = "socket"; else i_type = "bad type"; fprintf(out, "%sInode: %u Type: %s ", prefix, inode_num, i_type); - fprintf(out, "%sMode: %04o Flags: 0x%x\n", - prefix, inode->i_mode & 0777, inode->i_flags); + fprintf(out, "%sMode: 0%03o Flags: 0x%x\n", + prefix, inode->i_mode & 07777, inode->i_flags); if (is_large_inode && large_inode->i_extra_isize >= 24) { fprintf(out, "%sGeneration: %u Version: 0x%08x:%08x\n", prefix, inode->i_generation, large_inode->i_version_hi, |