]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
mkfs: check dirent names when reading protofile
authorDarrick J. Wong <djwong@kernel.org>
Wed, 1 Mar 2023 16:05:34 +0000 (08:05 -0800)
committerCarlos Maiolino <cem@kernel.org>
Fri, 3 Mar 2023 11:35:57 +0000 (12:35 +0100)
commitc3fce4f9ba69db41185bfb42654e6546029f7071
treea17adad31970aa6c8d0f57c91b43c8c831aa010a
parentd6642ab8cc934d9de12de631f5b0b3098022eb02
mkfs: check dirent names when reading protofile

The protofile parser in mkfs does not check directory entry names when
populating the filesystem.  The libxfs directory code doesn't check them
either, since they depend on the Linux VFS to sanitize incoming names.
If someone puts a slash in the first (name) column in the protofile,
this results in a successful format and xfs_repair -n immediately
complains.

Screen the names that are being read from the protofile.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
mkfs/proto.c