summaryrefslogtreecommitdiffstats
path: root/perl-install/run_program.pm
Commit message (Expand)AuthorAgeFilesLines
* adjust doc to realityThierry Vignaud2016-06-031-1/+1
* further simplify...Thierry Vignaud2016-06-031-4/+1
* simplify...Thierry Vignaud2016-06-031-4/+2
* with polkit, it's always an UID, never a loginThierry Vignaud2016-06-031-1/+1
* guess the right user after the switch to polkitThierry Vignaud2016-06-031-2/+2
* uid guess: fix the fallback (mga#18288)Thierry Vignaud2016-06-031-1/+1
* kill $Id:$ tagsThierry Vignaud2014-06-071-1/+1
* podify run_programThierry.Vignaud2014-05-271-1/+150
* (raw) do not crash when trying to guess homedir before running another proces...Thierry Vignaud2012-09-171-1/+2
* (raw) rename $user as $uid as it really what it isThierry Vignaud2012-09-171-5/+5
* (get_stdout_raw) introduce itThierry Vignaud2012-05-231-0/+8
* add infrastructure so that programs can alter the default timeout (10m)Thierry Vignaud2012-04-031-1/+8
* (raw) fix $HOME for all when runing as another user instead of root (mga#287)Thierry Vignaud2011-12-101-0/+3
* - use 'cannot' instead of 'can not'Ahmad Samir2011-04-021-4/+4
* Synthesized commit during git-svn import combining previous Mandriva history ...Mageia SVN-Git Migration2011-02-061-1/+1
* run_program: use home and logname of user we are dropping privileges to, not 501Pascal Terjan2010-02-111-1/+1
* (raw) introduce new 'as_user' parameter which tries harder to get user ID inThierry Vignaud2009-10-121-1/+20
* explainThierry Vignaud2009-10-121-0/+1
* (raw) perl_checker cleanupThierry Vignaud2009-10-121-1/+1
* - fix LOGNAME to be able to use a running firefox instance to fill a bug #31109Tiago Salem Herrmann2008-05-281-1/+1
* - add a fallback when setting $ENV{'LOGNAME'}Tiago Salem Herrmann2008-04-071-1/+1
* - firefox needs LOGNAME to work properly. #31109Tiago Salem Herrmann2008-04-071-0/+1
* - fix changing UID on forking (spotted by salem)Thierry Vignaud2008-03-131-1/+1
* (raw) run_program layer: enable to drop privileges through setuid()Thierry Vignaud2007-09-131-0/+5
* re-sync after the big svn lossPascal Rigaux2007-04-251-6/+7
* fix bad typoPascal Rigaux2005-12-181-1/+1
* fix handling absolute binary in chrootPascal Rigaux2005-12-141-2/+5
* don't use /root/tmp if /root doesn't exist (fixes using it in rescue)Pascal Rigaux2005-11-031-2/+1
* fix previous commit so that "prog1|prog2" like construction still workThierry Vignaud2005-10-071-1/+2
* fix buggy previous commit, cleanup and correctly indent. previous commit was:Pascal Rigaux2005-10-071-2/+10
* (raw) do not clober output files (stdout or stderr) when binary cannot be fou...Thierry Vignaud2005-10-071-0/+2
* force our tmpdir to /root/tmp when root and not isInstallPascal Rigaux2005-09-141-2/+2
* fix return code when chroot can't be doneOlivier Blin2005-05-241-1/+1
* (raw) ensure runned programs are logged in explanationsThierry Vignaud2005-03-101-1/+1
* *** empty log message ***Pascal Rigaux2005-01-111-1/+1
* do not log the encrypted passwordPascal Rigaux2005-01-111-1/+2
* better english (writing style rather than spoken one)Thierry Vignaud2004-12-131-4/+4
* since we don't use ramdisk but clp, some code is deadPascal Rigaux2004-11-181-4/+0
* do not use die when forked, use log::l + c::_exit insteadPascal Rigaux2004-10-261-6/+9
* don't check_prog when the prog is a complex command (containing a pipe)Pascal Rigaux2004-09-091-1/+1
* simplifyPascal Rigaux2004-09-091-1/+1
* rename $str into $real_namePascal Rigaux2004-09-091-4/+4
* remove redundant codePascal Rigaux2004-09-091-11/+8
* create ~/tmp when neededPascal Rigaux2004-04-261-2/+7
* don't print refs in log when output is redirectedPascal Rigaux2004-01-121-5/+5
* when called from commands.pm, install_any is not loadedPascal Rigaux2004-01-071-1/+4
* fix to enable drakconnect to be run in "install" mode while being a standaloneThierry Vignaud2003-12-291-1/+1
* introduce bg_command object that enable to fork a sub that give back dataThierry Vignaud2003-11-231-0/+23
* fix requires for c::_exit()Thierry Vignaud2003-10-271-0/+1
* better logging of killed runaway processesPascal Rigaux2003-09-151-1/+1
t to internet if already connected --force : used with (dis)connect : force (dis)connection. --status : returns 1 if connected 0 otherwise, then exit. --quiet : don't be interactive. To be used with (dis)connect."), 'printerdrake' => N_(" [--skiptest] [--cups] [--lprng] [--lpd] [--pdq]"), 'rpmdrake' => N_("[OPTION]... --no-confirmation don't ask first confirmation question in MandrakeUpdate mode --no-verify-rpm don't verify packages signatures --changelog-first display changelog before filelist in the description window --merge-all-rpmnew propose to merge all .rpmnew/.rpmsave files found"), 'scannerdrake' => N_("[--manual] [--device=dev] [--update-sane=sane_source_dir] [--update-usbtable] [--dynamic=dev]"), 'XFdrake' => N_(" [everything] XFdrake [--noauto] monitor XFdrake resolution"), ); $usages{$_} = $usages{rpmdrake} foreach qw(rpmdrake-remove MandrakeUpdate); $usages{Xdrakres} = $usages{XFdrake}; sub version() { print 'Drakxtools version 10 Copyright (C) 1999-2004 Mandrakesoft by <install@mandrakesoft.com> ', $::license, "\n"; } my ($i, @new_ARGV); foreach (@ARGV) { $i++; if (/^-(-help|h)$/) { version(); print N("\nUsage: %s [--auto] [--beginner] [--expert] [-h|--help] [--noauto] [--testing] [-v|--version] ", $progname), if_($usages{$progname}, $usages{$progname}), "\n"; # print N("\nUsage: "), $::usage, "\n" if $::usage; exit(0); } elsif (/^-(-version|v)$/) { version(); exit(0); } elsif (/^--embedded$/) { $::XID = splice @ARGV, $i, 1; $::isEmbedded = 1; } elsif (/^--expert$/) { $::expert = 1; } elsif (/^--noauto$/) { $::noauto = /-noauto/; } elsif (/^--auto$/) { $::auto = 1; } elsif (/^--testing$/) { $::testing = 1; } elsif (/^--beginner$/) { $::expert = 0; } else { push @new_ARGV, $_; } } @ARGV = @new_ARGV; ################################################################################ #- stuff will go to special /var/log/explanations file my $standalone_name; sub explanations { log::explanations("@_") } our @common_functs = qw(renamef linkf symlinkf output substInFile mkdir_p rm_rf cp_af touch setVarsInSh setExportedVarsInSh setExportedVarsInCsh update_gnomekderc); our @builtin_functs = qw(chmod chown unlink link symlink rename system); our @drakx_modules = qw(Xconfig::card Xconfig::default Xconfig::main Xconfig::monitor Xconfig::parse Xconfig::proprietary Xconfig::resolution_and_depth Xconfig::screen Xconfig::test Xconfig::various Xconfig::xfree any bootloader bootlook c class_discard commands crypto detect_devices devices diskdrake diskdrake::hd_gtk diskdrake::interactive diskdrake::removable diskdrake::removable_gtk diskdrake::smbnfs_gtk fs fsedit http keyboard lang log loopback lvm modules::parameters modules mouse my_gtk network network::adsl network::ethernet network::isdn_consts network::isdn network::modem network::netconnect network::network network::nfs network::smb network::tools partition_table partition_table_bsd partition_table::dos partition_table::empty partition_table::gpt partition_table::mac partition_table::raw partition_table::sun printer printerdrake proxy raid run_program scanner services steps swap timezone network::drakfirewall network::shorewall); $SIG{SEGV} = sub { my $progname = $0; $progname =~ s|.*/||; exec("drakbug --incident $progname") }; sub import() { ($standalone_name = $0) =~ s|.*/||; c::openlog($standalone_name . "[$$]"); explanations('### Program is starting ###'); eval "*common::$_ = *$_" foreach @common_functs; foreach my $f (@builtin_functs) { eval "*$_" . "::$f = *$f" foreach @drakx_modules; eval "*" . caller() . "::$f = *$f"; } } sub renamef { explanations "moved file $_[0] to $_[1]"; goto &MDK::Common::File::renamef; } sub linkf { explanations "hard linked file $_[0] to $_[1]"; goto &MDK::Common::File::linkf; } sub symlinkf { explanations "symlinked file $_[0] to $_[1]"; goto &MDK::Common::File::symlinkf; } sub output { explanations "created file $_[0]"; goto &MDK::Common::File::output; } sub substInFile(&@) { explanations "modified file $_[1]"; goto &MDK::Common::File::substInFile; } sub mkdir_p { explanations "created directory $_[0] (and parents if necessary)"; goto &MDK::Common::File::mkdir_p; } sub rm_rf { explanations "removed files/directories (recursively) @_"; goto &MDK::Common::File::rm_rf; } sub cp_af { my $retval = MDK::Common::File::cp_af(@_); my $dest = pop @_; explanations "copied recursively @_ to $dest"; return $retval; } sub touch { explanations "touched file @_"; goto &MDK::Common::File::touch; } sub setVarsInSh { explanations "modified file $_[0]"; goto &MDK::Common::System::setVarsInSh; } sub setExportedVarsInSh { explanations "modified file $_[0]"; goto &MDK::Common::System::setExportedVarsInSh; } sub setExportedVarsInCsh { explanations "modified file $_[0]"; goto &MDK::Common::System::setExportedVarsInCsh; } sub update_gnomekderc { explanations "modified file $_[0]"; goto &MDK::Common::System::update_gnomekderc; } sub chmod { my $retval = CORE::chmod(@_); my $mode = shift @_; explanations sprintf("changed mode of %s to %o", $_, $mode) foreach @_; return $retval; } sub chown { my $retval = CORE::chown(@_); my $uid = shift @_; my $gid = shift @_; explanations sprintf("changed owner of $_ to $uid.$gid") foreach @_; return $retval; } sub unlink { explanations "removed files/directories @_"; CORE::unlink(@_); } sub link { explanations "hard linked file $_[0] to $_[1]"; CORE::link($_[0], $_[1]); } sub symlink { explanations "symlinked file $_[0] to $_[1]"; CORE::symlink($_[0], $_[1]); } sub rename { explanations "renamed file $_[0] to $_[1]" if -r $_[0]; CORE::rename($_[0], $_[1]); } sub system { explanations "launched command: @_"; CORE::system(@_); } 1;