From: Cornelius Hoffmann Date: Fri, 26 May 2023 07:31:50 +0000 (+0200) Subject: Fix wrong uid:gid on the basename symlink X-Git-Tag: v15~142^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1aa2baaa9042e90e714eb4d127a648e7f15b93c9;p=thirdparty%2Fmkosi.git Fix wrong uid:gid on the basename symlink Before this would have the uid:gid of root in the uidmap space The link is now created in the staging area first to make the change atomic, so that the wrong uid:gid pair is never seen in the output directory --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index a0157a26c..f8d2a4072 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1730,6 +1730,7 @@ def build_image(uid: int, gid: int, args: MkosiArgs, config: MkosiConfig) -> Non if not state.config.output_dir.joinpath(state.config.output).exists(): state.config.output_dir.joinpath(state.config.output).symlink_to(state.config.output_with_compression) + os.chown(state.config.output_dir.joinpath(state.config.output), uid, gid, follow_symlinks=False) print_output_size(config.output_dir / config.output)