Re: [RESEND] libext2fs: Provide functions to safely access name_len and file_type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 28, 2013 at 10:45:35AM -0000, Jan Kara wrote:
> 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@xxxxxxx>

Applied, thanks.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux