erofs-utils: fsck: keep S{U,G}ID bits properly on extraction
As chown(2) explained, "
When the owner or group of an executable file are changed by an
unprivileged user the S_ISUID and S_ISGID mode bits are cleared.
POSIX does not specify whether this also should happen when root does
the chown(); the Linux behavior depends on the kernel version."
Fix it by chown() first.
Fixes: 412c8f908132 ("erofs-utils: fsck: add --extract=X support to extract to path X")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250124090628.2865088-1-hsiangkao@linux.alibaba.com