diff options
-rw-r--r-- | lib/AdminPanel/Privileges.pm | 4 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/init.pm | 2 | ||||
-rwxr-xr-x | modules/rpmdragora/edit-urpm-sources.pl | 10 | ||||
-rwxr-xr-x | modules/rpmdragora/gurpmi.addmedia | 2 | ||||
-rwxr-xr-x | scripts/apanel.pl | 2 |
5 files changed, 11 insertions, 9 deletions
diff --git a/lib/AdminPanel/Privileges.pm b/lib/AdminPanel/Privileges.pm index d46217d..50033c7 100644 --- a/lib/AdminPanel/Privileges.pm +++ b/lib/AdminPanel/Privileges.pm @@ -25,7 +25,7 @@ require Exporter; use base qw(Exporter); use English qw(-no_match_vars); -our @EXPORT = qw(require_root_capability +our @EXPORT = qw(is_root_capability_required ask_for_authentication); my $wrappers = { "sudo" => "/usr/bin/sudo", @@ -35,7 +35,7 @@ my $wrappers = { "sudo" => "/usr/bin/sudo", my $wrapper = 0; -sub require_root_capability { +sub is_root_capability_required { return $EUID != 0; } diff --git a/lib/AdminPanel/Rpmdragora/init.pm b/lib/AdminPanel/Rpmdragora/init.pm index 9349894..00d07c4 100644 --- a/lib/AdminPanel/Rpmdragora/init.pm +++ b/lib/AdminPanel/Rpmdragora/init.pm @@ -149,7 +149,7 @@ if ($MODE eq 'remove') { $default_list_mode = 'all_updates'; } -$MODE eq 'update' || $rpmdragora_options{'run-as-root'} and AdminPanel::Privileges::require_root_capability(); +$MODE eq 'update' || $rpmdragora_options{'run-as-root'} and AdminPanel::Privileges::is_root_capability_required(); $::noborderWhenEmbedded = 1; require AdminPanel::rpmdragora; diff --git a/modules/rpmdragora/edit-urpm-sources.pl b/modules/rpmdragora/edit-urpm-sources.pl index 5f6bb65..30ec4f7 100755 --- a/modules/rpmdragora/edit-urpm-sources.pl +++ b/modules/rpmdragora/edit-urpm-sources.pl @@ -22,19 +22,21 @@ # # $Id: edit-urpm-sources.pl 244763 2008-09-04 16:12:52Z tv $ -use strict; + use AdminPanel::Rpmdragora::init; use AdminPanel::rpmdragora; -use common qw(N); use AdminPanel::Rpmdragora::edit_urpm_sources; use AdminPanel::Privileges; +use AdminPanel::Shared::Locales; + +my $loc = AdminPanel::Shared::Locales->new(domain_name => 'rpmdrake'); -if (AdminPanel::Privileges::require_root_capability()) { +if (AdminPanel::Privileges::is_root_capability_required()) { require AdminPanel::Shared::GUI; my $sh_gui = AdminPanel::Shared::GUI->new(); $sh_gui->warningMsgBox({ title => "gurpmi.addmedia", - text => N("root privileges required"), + text => $loc->N("root privileges required"), }); exit (-1); } diff --git a/modules/rpmdragora/gurpmi.addmedia b/modules/rpmdragora/gurpmi.addmedia index e79dd95..3aafbf2 100755 --- a/modules/rpmdragora/gurpmi.addmedia +++ b/modules/rpmdragora/gurpmi.addmedia @@ -56,7 +56,7 @@ use MDK::Common::Func; use common qw(N); # -if (AdminPanel::Privileges::require_root_capability()) { +if (AdminPanel::Privileges::is_root_capability_required()) { require AdminPanel::Shared::GUI; my $sh_gui = AdminPanel::Shared::GUI->new(); $sh_gui->warningMsgBox({ diff --git a/scripts/apanel.pl b/scripts/apanel.pl index ca8834c..813c170 100755 --- a/scripts/apanel.pl +++ b/scripts/apanel.pl @@ -39,7 +39,7 @@ if($cmdline->find("--dev") > 0) } else { - ask_for_authentication($settings->{priv_method}) if(require_root_capability()); + ask_for_authentication($settings->{priv_method}) if(is_root_capability_required()); } my $mainWin = new AdminPanel::MainDisplay(); while (1) { |