Fix rootless file ownership

This commit is contained in:
Nils
2024-08-14 02:29:43 +00:00
parent 8558480ebc
commit 598df9fd2e

View File

@@ -163,7 +163,7 @@ pub fn main() !void {
const offset_arg = try std.fmt.allocPrintZ(allocator, "{}", .{runtime_content.len});
defer allocator.free(offset_arg);
const mksquashfs_args = [_:null]?[*:0]const u8{
var mksquashfs_args = [_:null]?[*:0]const u8{
"mksquashfs",
bundle_destination,
output_path,
@@ -172,8 +172,17 @@ pub fn main() !void {
"-offset",
offset_arg,
"-noappend",
"-force-uid",
"0",
"-force-gid",
"0",
};
// in rootfull, do not force uid/gid to 0,0
if (res.args.rootfull != 0) {
mksquashfs_args[mksquashfs_args.len - 4] = null;
}
mksquashfs_main(
mksquashfs_args.len,
&mksquashfs_args,