e2fsprogs/e2fsck
Jan Kara 70f4632b62 libext2fs: provide functions to safely access name_len and file_type
Accessing name_len (and file_type) in ext4_dir_entry structure is
somewhat problematic because on big endian architecture we need to now
whether we are really dealing with ext4_dir_entry (which has u16
name_len which needs byte swapping) or ext4_dir_entry_2 (which has u8
name_len which must not be byte swapped).

Currently the code is somewhat surprising and name_len is always
treated as u16 and byte swapped (flag EXT2_DIRBLOCK_V2_STRUCT isn't
ever used) and then masking of name_len is used to access real
name_len or file_type. Doing things this way in applications using
libext2fs is unexpected to say the least (more natural is to type
struct ext4_dir_entry * to struct ext4_dir_entry_2 * but that gives
wrong results on big endian architectures. So provide helper functions
that give endian-safe access to these fields. Also convert users in
e2fsprogs to use these functions.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-06-08 17:03:05 -04:00
..
CHANGES Many files: 1997-04-26 13:21:57 +00:00
Makefile.in Merge branch 'maint' into next 2012-10-11 07:38:01 -04:00
Makefile.pq Many files: 1997-11-14 05:23:04 +00:00
argv_parse.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
argv_parse.h Remove trailing whitespace for the entire source tree 2008-08-27 23:07:54 -04:00
badblocks.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
dict.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
dict.h Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -04:00
dirinfo.c e2fsck: speed up runs when using tdb for large atypical filesystems 2011-11-29 11:24:52 -05:00
dx_dirinfo.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
e2fsck.8.in Fix spelling typo's in man pages for tune2fs and mke2fs 2012-07-14 19:58:06 -04:00
e2fsck.c e2fsck: add logging capability 2012-03-18 15:40:47 -04:00
e2fsck.conf.5.in e2fsck: add e2fsck.conf options for extra reporting 2012-07-29 17:44:11 -04:00
e2fsck.h e2fsck: refactor crc32_be code 2012-08-02 20:47:46 -04:00
ea_refcount.c e2fsck: simplify binary search in ea_refcount.c 2011-09-30 16:38:26 -04:00
ehandler.c e2fsck: fix potential segv when handling a read error in a superblock 2012-08-06 18:46:42 -04:00
emptydir.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
extend.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
flushb.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
iscan.c Don't assume that the presence of mntent.h means that setmntent() exists 2012-04-05 15:31:09 -07:00
jfs_user.h Merge branch 'maint' into next 2012-09-09 22:52:26 -04:00
journal.c e2fsck: fix gcc -Wall nits 2013-05-20 09:17:02 -04:00
logfile.c e2fsck: do not crash on long log file names 2013-01-08 20:36:48 -05:00
message.c libext2fs: provide functions to safely access name_len and file_type 2013-06-08 17:03:05 -04:00
mtrace.awk Many files: 1997-04-26 13:21:57 +00:00
mtrace.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
mtrace.h ChangeLog, super.c: 2001-01-12 21:05:57 +00:00
pass1.c libext2fs: provide functions to safely access name_len and file_type 2013-06-08 17:03:05 -04:00
pass1b.c Merge branch 'maint' into next 2013-05-19 21:45:16 -04:00
pass2.c libext2fs: provide functions to safely access name_len and file_type 2013-06-08 17:03:05 -04:00
pass3.c libext2fs: provide functions to safely access name_len and file_type 2013-06-08 17:03:05 -04:00
pass4.c e2fsck: only consult inode_dir_map if needed in pass4 2012-10-11 07:36:09 -04:00
pass5.c e2fsck: fix gcc -Wall nits 2013-05-20 09:17:02 -04:00
problem.c Merge branch 'maint' 2013-06-08 17:02:54 -04:00
problem.h Merge branch 'maint' 2013-06-08 17:02:54 -04:00
problemP.h e2fsck: add ability to limit the # of problems of a particular type 2012-03-14 17:44:54 -04:00
prof_err.et Fix more spelling errors found by translators and add pluralization 2011-10-09 17:54:23 -04:00
profile.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
profile.h mke2fs: Allow specifying reserved_ratio via mke2fs.conf 2011-05-14 23:34:48 -04:00
profile_helpers.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
profile_helpers.h Simplify profile core functionality 2006-01-02 22:04:41 -05:00
quota.c e2fsck: Fix check for hidden quota files 2012-04-24 14:36:42 -04:00
recovery.c e2fsck: fix journal block tag checksum verification 2013-06-08 17:03:04 -04:00
region.c build: quiet some "gcc -Wall" compiler warnings 2012-12-29 17:39:45 -05:00
rehash.c libext2fs: provide functions to safely access name_len and file_type 2013-06-08 17:03:05 -04:00
revoke.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
scantest.c Don't assume that the presence of mntent.h means that setmntent() exists 2012-04-05 15:31:09 -07:00
sigcatcher.c Merge branch 'maint' into next 2013-05-19 21:45:16 -04:00
super.c Merge branch 'maint' into next 2013-05-19 21:45:16 -04:00
unix.c Merge branch 'maint' into next 2013-01-08 21:14:25 -05:00
util.c Merge branch 'maint' into next 2013-01-08 21:14:25 -05:00