summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@netscape.net>2017-03-24 20:06:01 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-04-03 19:12:51 +0200
commitf27b8d7a11f261d0b15ca1a7871a497936bd1ee9 (patch)
treefa3365cb333b70e77f60a82f548c524aa0c0ded4 /urpm
parent8f1579501439917de64f3427cf44e69ebdf3623f (diff)
downloadurpmi-f27b8d7a11f261d0b15ca1a7871a497936bd1ee9.tar
urpmi-f27b8d7a11f261d0b15ca1a7871a497936bd1ee9.tar.gz
urpmi-f27b8d7a11f261d0b15ca1a7871a497936bd1ee9.tar.bz2
urpmi-f27b8d7a11f261d0b15ca1a7871a497936bd1ee9.tar.xz
urpmi-f27b8d7a11f261d0b15ca1a7871a497936bd1ee9.zip
Make sure that urpmi.cfg is world-readable so that mgaapplet can read it (mga#9386)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/media.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 453e7ed8..9dac029f 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -551,6 +551,10 @@ sub write_urpmi_cfg {
};
remove_passwords_and_write_private_netrc($urpm, $config);
+ # urpmi.cfg must be world-readable, else mgaapplet won't be able to read it
+ # as it is executed from the user session. We enforce umask here in the case
+ # where the msec security level is set to 'secure' (which means umask 077).
+ umask 0022;
urpm::cfg::dump_config($urpm->{config}, $config)
or $urpm->{fatal}(6, N("unable to write config file [%s]", $urpm->{config}));