diff options
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index 0bb4dfe03..d48eca789 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -10,7 +10,7 @@ use run_program; use Exporter; our @ISA = qw(Exporter); -our @EXPORT = qw($SECTORSIZE N P N_ check_for_xserver files_exist formatTime MB formatXiB makedev mandrake_release mandrake_release_info removeXiBSuffix require_root_capability setVirtual set_alternative set_l10n_sort set_permissions translate unmakedev); +our @EXPORT = qw($SECTORSIZE N P N_ check_for_xserver files_exist formatTime MB formatXiB get_parent_uid makedev mandrake_release mandrake_release_info removeXiBSuffix require_root_capability setVirtual set_alternative set_l10n_sort set_permissions translate unmakedev); # perl_checker: RE-EXPORT-ALL push @EXPORT, @MDK::Common::EXPORT; @@ -302,6 +302,10 @@ sub mandrake_release { $f && chomp_(cat_("$o_dir$f")); } +sub get_parent_uid() { + cat_('/proc/' . getppid() . '/status') =~ /Uid:\s*(\d+)/ ? $1 : undef; +} + sub wrap_command_for_root { my ($name, @args) = @_; ([ 'consolehelper', $name ], @args); |