summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2018-01-14 01:05:20 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2018-01-14 22:41:33 +0000
commit2a7978ae5c95dbd240b8527585f72d629c8d9ac4 (patch)
treee74888290f116ee020545d9fd36c4f78963e9f82 /lib
parenteaecbddb48f27a6933761128ceba5e368492b3ea (diff)
downloaddrakiso-2a7978ae5c95dbd240b8527585f72d629c8d9ac4.tar
drakiso-2a7978ae5c95dbd240b8527585f72d629c8d9ac4.tar.gz
drakiso-2a7978ae5c95dbd240b8527585f72d629c8d9ac4.tar.bz2
drakiso-2a7978ae5c95dbd240b8527585f72d629c8d9ac4.tar.xz
drakiso-2a7978ae5c95dbd240b8527585f72d629c8d9ac4.zip
draklive: ensure files copied to root filesystem are owned by root.
Diffstat (limited to 'lib')
-rw-r--r--lib/MGA/DrakISO/BuildRoot.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/MGA/DrakISO/BuildRoot.pm b/lib/MGA/DrakISO/BuildRoot.pm
index 903a65e..177d5af 100644
--- a/lib/MGA/DrakISO/BuildRoot.pm
+++ b/lib/MGA/DrakISO/BuildRoot.pm
@@ -697,7 +697,7 @@ sub copy_to_root {
# TODO: support source files in remote repositories
- run_as_root('cp', '-af', @files, $root . $dest)
+ run_as_root('cp', '-af', '--no-preserve=ownership', @files, $root . $dest)
or die "ERROR: failed to copy file to $dest in Live system root\n";
return if !defined $mode;
@@ -711,10 +711,8 @@ sub output_to_root {
my $temp_file = tmpnam();
output($temp_file, map { "$_\n" } @text);
- chmod($mode, $temp_file) if $mode;
-
- run_as_root('mv', $temp_file, $root . $file)
- or die "ERROR: failed to write $file in Live system root\n";
+ copy_to_root($root, $file, $mode, $temp_file);
+ unlink($temp_file);
}
sub rm_in_root {