]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: fix ext2fs_link() for EXT2FS_LINK_APPEND and non-regular files
authorTheodore Ts'o <tytso@mit.edu>
Sun, 25 May 2025 21:38:49 +0000 (17:38 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 25 May 2025 21:38:49 +0000 (17:38 -0400)
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 <tytso@mit.edu>
lib/ext2fs/link.c

index 0d9b183791b900b7f1541923c958fc2be5554c8d..a617d0afbb404db1e8e0243347676dd0586551e4 100644 (file)
@@ -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;