]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
mkfs: substitute slashes with spaces in protofiles
authorDarrick J. Wong <djwong@kernel.org>
Thu, 2 Feb 2023 01:02:53 +0000 (17:02 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 15 Mar 2023 00:47:29 +0000 (17:47 -0700)
commit53802ab36214739dd0b33e8b669526d424443774
tree3dd9ed047aec5b7255d69fdbabcb1137bd27904d
parentcdde3c229ed1ea96faaf9d50204d727b73263bf2
mkfs: substitute slashes with spaces in protofiles

A user requested the ability to specify directory entry names in a
protofile that have spaces in them.  The protofile format itself does
not allow spaces (yay 1973-era protofiles!) but it does allow slashes.
Slashes aren't allowed in directory entry names, so we'll permit this
one gross hack.  After this, the protofile:

/
0 0
d--775 1000 1000
: Descending path /code/t/fstests
 get/isk.sh   ---775 1000 1000 /code/t/fstests/getdisk.sh
$

Will produce "get isk.h" in the root directory when used thusly:

# mkfs.xfs -p slashes_are_spaces=1,/tmp/protofile -f /dev/sda

Requested-by: Daan De Meyer <daan.j.demeyer@gmail.com>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
man/man8/mkfs.xfs.8.in
mkfs/proto.c
mkfs/proto.h
mkfs/xfs_mkfs.c