diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2019-06-22 09:28:38 +0100 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2019-06-22 09:35:33 +0100 |
commit | 8895ce59fe9f5705ce13e734400befa315f78043 (patch) | |
tree | bfbf1ac12bfa8f69494357913af36d3d5b21697c | |
parent | 52b1c74f640ce311ca7a8cea81a7fe201a13aa58 (diff) | |
download | urpmi-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.
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | urpm/download.pm | 7 |
2 files changed, 9 insertions, 0 deletions
@@ -1,3 +1,5 @@ +- ensure downloaded files are world-readable (mga#24636) + Version 8.117 - 21 June 2019 - ensure urpmi config and cache files are world-readable (mga#24636) 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; |