]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
mkfs: substitute slashes with spaces in protofiles
authorDarrick J. Wong <djwong@kernel.org>
Wed, 1 Mar 2023 16:05:45 +0000 (08:05 -0800)
committerCarlos Maiolino <cem@kernel.org>
Fri, 3 Mar 2023 11:35:57 +0000 (12:35 +0100)
commite0aeb058100b15e4505d4bf79af3d19ed1f38655
treef428cd7732895c6c69384958785092cd9f9416ea
parentfb22e1b1bd5222ae8f7a5d81634311976915df8b
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>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
man/man8/mkfs.xfs.8.in
mkfs/proto.c
mkfs/proto.h
mkfs/xfs_mkfs.c