summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-05-13 13:42:01 +0000
committerColin Guthrie <colin@mageia.org>2013-05-13 13:42:01 +0000
commitf0f1a4c7c569a9a9419ff76934d6c205e05be30c (patch)
tree8720a861ff4331ddd6713f7706365754f454eda0
parenta312623315e4d214bfcfc7743d233775bec2afe5 (diff)
downloadmgaonline-f0f1a4c7c569a9a9419ff76934d6c205e05be30c.tar
mgaonline-f0f1a4c7c569a9a9419ff76934d6c205e05be30c.tar.gz
mgaonline-f0f1a4c7c569a9a9419ff76934d6c205e05be30c.tar.bz2
mgaonline-f0f1a4c7c569a9a9419ff76934d6c205e05be30c.tar.xz
mgaonline-f0f1a4c7c569a9a9419ff76934d6c205e05be30c.zip
Do not use urpm code to check the folder as this is run as unprivileged user (mga#6083)
-rw-r--r--NEWS1
-rwxr-xr-xmgaapplet9
2 files changed, 4 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 23f4604f..e65553ed 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
- ensure nonfree/tainted media is kept enabled on distro upgrade
+- do not use urpm code to check the folder as this is run as unprivileged user (mga#6083)
Version 2.80 - 4 May 2013, Colin Guthrie
diff --git a/mgaapplet b/mgaapplet
index 1a7a9ef6..b639759c 100755
--- a/mgaapplet
+++ b/mgaapplet
@@ -399,9 +399,8 @@ 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_dir({ fatal => sub { $ok = 0 } }, $temp_dir);
+ stat($temp_dir)[4]
+ my $ok = -d $temp_dir && ! -l $temp_dir && (stat($temp_dir)[4] == 0);
$ok or ask_warn(N("Error"), N("You must choose a directory owned by the super administrator!"));
});
$browse->set_current_folder($download_dir);
@@ -434,9 +433,7 @@ 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_dir({ fatal => sub { $ok = 0 } }, $temp_dir);
+ my $ok = -d $temp_dir && ! -l $temp_dir && (stat($temp_dir)[4] == 0);
$ok or goto &confirm_upgrade;
$download_dir = $temp_dir;
really_confirm_upgrade();