summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2019-06-22 09:28:38 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2019-06-22 09:35:33 +0100
commit8895ce59fe9f5705ce13e734400befa315f78043 (patch)
treebfbf1ac12bfa8f69494357913af36d3d5b21697c /urpm
parent52b1c74f640ce311ca7a8cea81a7fe201a13aa58 (diff)
downloadurpmi-8895ce59fe9f5705ce13e734400befa315f78043.tar
urpmi-8895ce59fe9f5705ce13e734400befa315f78043.tar.gz
urpmi-8895ce59fe9f5705ce13e734400befa315f78043.tar.bz2
urpmi-8895ce59fe9f5705ce13e734400befa315f78043.tar.xz
urpmi-8895ce59fe9f5705ce13e734400befa315f78043.zip
Ensure downloaded files are world-readable (mga#24636)
mgaapplet and urpm* commands run as a normal user need to be able to read the downloaded synthesis and info files.
Diffstat (limited to 'urpm')
-rw-r--r--urpm/download.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 65fdbe3b..0f9eda85 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -943,10 +943,17 @@ sub sync_rel {
my @result_files = map { $all_options->{dir} . '/' . basename($_) } @$rel_files;
unlink @result_files if $all_options->{preclean};
+ #- The files must be world-readable, else mgaapplet and urpm* commands run as
+ #- a normal user won't be able to read them. We enforce umask here in the case
+ #- where the msec security level is set to 'secure' (which means umask 077)
+ #- or where we are run from a gdm-x-session (mga#24636)
+ my $old_umask = umask 0022;
+
(my $cwd) = getcwd() =~ /(.*)/;
eval { _sync_webfetch_raw($urpm, $medium, $rel_files, \@files, $all_options) };
my $err = $@;
chdir $cwd;
+ umask $old_umask;
if (!$err) {
$urpm->{log}(N("retrieved %s", $files_text));
\@result_files;