mirror of
https://github.com/xcat2/xcat-dep.git
synced 2026-10-17 17:20:31 +00:00
63784cfbee
ipxe-xcat/mockbuild.pl runs as root and calls make_path on $work_dir/srpm and $work_dir/rpm, then gives each one to mock as --resultdir. The native openEuler overlay sets chrootuid to the catalog's build_uid and chrootgid to the native build gid, so mock reloads to that uid and opens state.log, build.log and root.log in those directories. A root-made directory with the default umask is root root 0755 and mock cannot write them. grub2-xcat, ipmitool-xcat, syslinux-xcat and goconserver create their result directories the same way. What keeps those directories writable is the step wrapper, not the builder: native_owner_command gives the step the native build gid and umask 0002, so every directory the builder creates below it is group writable. No test measured that, so removing either one is silent. Move native_owner_command into MockBuildUtils so a test can call it in process, and assert the wrapper carries setpriv --regid 1000, --clear-groups and umask 0002, that setpriv precedes the umask and the umask precedes the builder, and that the overlay is still bound over the target config so chrootuid stays as the catalog declared it. This commit is the move and the test only. Five of the six assertions fail here, because the gid and the umask arrive in the next commit. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>