From: Theodore Ts'o Date: Sun, 25 May 2025 21:38:49 +0000 (-0400) Subject: libext2fs: fix ext2fs_link() for EXT2FS_LINK_APPEND and non-regular files X-Git-Tag: v1.47.3-rc1~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aef4ee829aa6318ce812ae8fad7425c21dd4220c;p=thirdparty%2Fe2fsprogs.git libext2fs: fix ext2fs_link() for EXT2FS_LINK_APPEND and non-regular files Fix the incorrect flag being passed to ext2fs_process_dir_block(). This bug was masked because EXT2_FT_REG_FILE has the same code point as DIRENT_FLAG_INCLUDE_EMPTY which was the flag that was needed and mke2fs -d was only use ext2fs_lik() for regular files. Fixes: 53aa6c54224f ("libext2fs: add the EXT2FS_LINK_APPEND flag ...) Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/link.c b/lib/ext2fs/link.c index 0d9b1837..a617d0af 100644 --- a/lib/ext2fs/link.c +++ b/lib/ext2fs/link.c @@ -647,7 +647,7 @@ retry: return retval; ctx.dir = dir; - ctx.flags = flags; + ctx.flags = DIRENT_FLAG_INCLUDE_EMPTY; ctx.func = link_proc; ctx.priv_data = &ls; ctx.errcode = 0;