]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_protofile: fix mode formatting error
authorDarrick J. Wong <djwong@kernel.org>
Mon, 3 Feb 2025 22:40:39 +0000 (14:40 -0800)
committerAndrey Albershteyn <aalbersh@kernel.org>
Wed, 5 Feb 2025 17:20:02 +0000 (18:20 +0100)
The protofile parser expects the mode to be specified with three octal
digits.  Unfortunately, the generator doesn't get that right if the mode
doesn't have any of bits 8-11 (aka no owner access privileges) set.

Fixes: 6aace700b7b82d ("mkfs: add a utility to generate protofiles")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
mkfs/xfs_protofile.in

index 9aee4336888523b53b4a9a9c88e1700722024604..356d3d80b3252178fa81048b56f93655b1bca2ca 100644 (file)
@@ -45,7 +45,7 @@ def stat_to_str(statbuf):
 
        perms = stat.S_IMODE(statbuf.st_mode)
 
-       return '%s%s%s%o %d %d' % (type, suid, sgid, perms, statbuf.st_uid, \
+       return '%s%s%s%03o %d %d' % (type, suid, sgid, perms, statbuf.st_uid, \
                        statbuf.st_gid)
 
 def stat_to_extra(statbuf, fullpath):