unpack_strategy/dmg: fix UID handling
This commit is contained in:
parent
e1289c1e16
commit
467666c8b3
@ -157,15 +157,10 @@ module UnpackStrategy
|
|||||||
|
|
||||||
bomfile_path = T.must(bomfile.path)
|
bomfile_path = T.must(bomfile.path)
|
||||||
|
|
||||||
# Ditto will try to write as the UID, not the EUID and the Tempfile has 0700 permissions.
|
|
||||||
if Process.euid != Process.uid
|
|
||||||
FileUtils.chown(nil, Process.gid, bomfile_path)
|
|
||||||
FileUtils.chmod "g+rw", bomfile_path
|
|
||||||
end
|
|
||||||
|
|
||||||
system_command!("ditto",
|
system_command!("ditto",
|
||||||
args: ["--bom", bomfile_path, "--", path, unpack_dir],
|
args: ["--bom", bomfile_path, "--", path, unpack_dir],
|
||||||
verbose:)
|
verbose:,
|
||||||
|
reset_uid: true)
|
||||||
|
|
||||||
FileUtils.chmod "u+w", Pathname.glob(unpack_dir/"**/*", File::FNM_DOTMATCH).reject(&:symlink?)
|
FileUtils.chmod "u+w", Pathname.glob(unpack_dir/"**/*", File::FNM_DOTMATCH).reject(&:symlink?)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user