summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-09-07 17:45:16 +0000
committerThierry Vignaud <tv@mageia.org>2012-09-07 17:45:16 +0000
commit155c93bb935807b0a77a4fcfa989c989b7980ae6 (patch)
tree4c3e1cc2f3ee2fc29e2abc120be404cc8d1daf5d
parenta902aac0cb2800d8865205883af7254f3203d9d7 (diff)
downloadmgaonline-155c93bb935807b0a77a4fcfa989c989b7980ae6.tar
mgaonline-155c93bb935807b0a77a4fcfa989c989b7980ae6.tar.gz
mgaonline-155c93bb935807b0a77a4fcfa989c989b7980ae6.tar.bz2
mgaonline-155c93bb935807b0a77a4fcfa989c989b7980ae6.tar.xz
mgaonline-155c93bb935807b0a77a4fcfa989c989b7980ae6.zip
(confirm_upgrade) check that choosen download directory is owned by root (mga#6083)
-rw-r--r--NEWS1
-rwxr-xr-xmgaapplet8
2 files changed, 9 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 237c6d0f..ef0b5923 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+- check that choosen download directory is owned by root (mga#6083)
- drop support for Enterprise & PowerPack media (mga#6292)
- drop support for extended maintenance
diff --git a/mgaapplet b/mgaapplet
index ca57ffb5..959f9edb 100755
--- a/mgaapplet
+++ b/mgaapplet
@@ -395,6 +395,10 @@ sub confirm_upgrade() {
Gtk2::FileChooserButton->new(N("Browse"), 'select-folder'),
'current-folder-changed' => sub {
$temp_dir = $_[0]->get_current_folder;
+ my $ok = 1;
+ require urpm;
+ urpm::check_cache_dir({ fatal => sub { $ok = 0 } }, $temp_dir);
+ $ok or ask_warn(N("Error"), N("You must choose a directory owned by the super administrator!"));
});
$browse->set_current_folder($download_dir);
@@ -426,6 +430,10 @@ sub confirm_upgrade() {
setVar('DO_NOT_ASK_FOR_DISTRO_UPGRADE', bool2text($warn_me));
$local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE} = bool2text($warn_me);
if ($res) {
+ require urpm;
+ my $ok = 1;
+ urpm::check_cache_dir({ fatal => sub { $ok = 0 } }, $temp_dir);
+ $ok or goto &confirm_upgrade;
$download_dir = $temp_dir;
really_confirm_upgrade();
} else {