Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
ext2: Build symbolic links correctly (RHBZ#1770304).
We created symlinks in two steps, by creating the empty inode and then calling ext2fs_symlink to populate it. This created broken symlinks where the directory name contained a / character, eg: lrwxrwxrwx 1 root root 7 Nov 26 08:43 /bin -> usr/bin lrwxrwxrwx 1 root root 7 Nov 26 08:43 /lib -> usr/lib lrwxrwxrwx 1 root root 9 Nov 26 08:43 /lib64 -> usr/lib64 lrwxrwxrwx 1 root root 8 Nov 26 08:43 /sbin -> usr/sbin lrwxrwxrwx 1 root root 7 Nov 26 08:38 bin -> usr/bin This breaks with Linux >= 5.3.8, most likely because of extra validation now being done at the VFS layer: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/readdir.c?id=8a23eb804ca4f2be909e372cf5a9e7b30ae476cd It's unnecessary to create the empty inode since ext2fs_symlink can create the inode for us perfectly fine if we simply pass ino == 0, and it creates them correctly too. Thanks: Toolybird for identifying the problem and kernel patch.
- Loading branch information