Adding upstream version 0.9.0+20151029.

upstream/0.9.0+20151029
Alf Gaida 9 years ago
parent 588579f00e
commit cb95c92327

@ -79,6 +79,13 @@ namespace
QTextStream(stdout) QTextStream(stdout)
<< QObject::tr("%1 version %2\n").arg(app_master).arg(app_version); << QObject::tr("%1 version %2\n").arg(app_master).arg(app_version);
} }
inline void env_workarounds()
{
//cleanup environment
//pcmanfm-qt will not start if the DBUS_SESSION_BUS_ADDRESS is preserved
unsetenv("DBUS_SESSION_BUS_ADDRESS");
}
} }
Sudo::Sudo() Sudo::Sudo()
@ -163,7 +170,7 @@ int Sudo::main()
void Sudo::child() void Sudo::child()
{ {
int params_cnt = 2 //1. su/sudo & last nullptr int params_cnt = 2 //1. su/sudo & last nullptr
+ (BACK_SU == mBackend ? 1 : 0) //-c for su + 1 //-c for su | -E for sudo
+ mArgs.size(); + mArgs.size();
std::unique_ptr<char const *[]> params{new char const *[params_cnt]}; std::unique_ptr<char const *[]> params{new char const *[params_cnt]};
const char ** param_arg = params.get() + 1; const char ** param_arg = params.get() + 1;
@ -172,9 +179,12 @@ void Sudo::child()
if (BACK_SU == mBackend) if (BACK_SU == mBackend)
{ {
program = su_prog.toStdString(); program = su_prog.toStdString();
*(param_arg++) = "-c"; *(param_arg++) = "-c"; //run command
} else } else
{
program = sudo_prog.toStdString(); program = sudo_prog.toStdString();
*(param_arg++) = "-E"; //preserve environment
}
params[0] = program.c_str(); params[0] = program.c_str();
@ -186,6 +196,8 @@ void Sudo::child()
*param_arg = nullptr; *param_arg = nullptr;
env_workarounds();
setsid(); //session leader setsid(); //session leader
execvp(params[0], const_cast<char **>(params.get())); execvp(params[0], const_cast<char **>(params.get()));

@ -1,23 +1,20 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0"> <TS version="2.1">
<context> <context>
<name>PasswordDialog</name> <name>PasswordDialog</name>
<message> <message>
<location filename="../passworddialog.ui" line="20"/> <location filename="../passworddialog.ui" line="20"/>
<location filename="../build/ui_passworddialog.h" line="129"/>
<source>LXQt sudo</source> <source>LXQt sudo</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../passworddialog.ui" line="77"/> <location filename="../passworddialog.ui" line="77"/>
<location filename="../build/ui_passworddialog.h" line="134"/>
<source>Command:</source> <source>Command:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../passworddialog.ui" line="84"/> <location filename="../passworddialog.ui" line="84"/>
<location filename="../build/ui_passworddialog.h" line="135"/>
<source>Password:</source> <source>Password:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -36,12 +33,17 @@ Please enter your password.</source>
<context> <context>
<name>QObject</name> <name>QObject</name>
<message> <message>
<location filename="../main.cpp" line="57"/> <location filename="../sudo.cpp" line="63"/>
<source>Usage: %1 command [arguments...] <source>Usage: %1 option [command [arguments...]]
GUI frontend for %2 GUI frontend for %2/%3
Arguments: Arguments:
option:
-h|--help Print this help.
-v|--version Print version information.
-s|--su Use %3(1) as backend.
-d|--sudo Use %2(8) as backend.
command Command to run. command Command to run.
arguments Optional arguments for command. arguments Optional arguments for command.
@ -49,18 +51,52 @@ Arguments:
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../main.cpp" line="69"/> <location filename="../sudo.cpp" line="80"/>
<source>%1 version %2 <source>%1 version %2
</source> </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>Sudo</name>
<message> <message>
<location filename="../main.cpp" line="80"/> <location filename="../sudo.cpp" line="128"/>
<source>%1: no command to run provided!</source> <source>%1: no command to run provided!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../main.cpp" line="131"/> <location filename="../sudo.cpp" line="135"/>
<source>%1: no backend chosen!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sudo.cpp" line="140"/>
<source>%1: warning - got multiple arguments for %2 backend, squashing into one: %3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sudo.cpp" line="155"/>
<source>Failed to fork: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sudo.cpp" line="193"/>
<source>%1: Failed to exec &apos;%2&apos;: %3
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sudo.cpp" line="222"/>
<source>Failed to set non-block: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sudo.cpp" line="230"/>
<source>Failed to fdopen: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sudo.cpp" line="263"/>
<source>Child &apos;%1&apos; process failed! <source>Child &apos;%1&apos; process failed!
%2</source> %2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

@ -5,19 +5,16 @@
<name>PasswordDialog</name> <name>PasswordDialog</name>
<message> <message>
<location filename="../passworddialog.ui" line="20"/> <location filename="../passworddialog.ui" line="20"/>
<location filename="../build/ui_passworddialog.h" line="129"/>
<source>LXQt sudo</source> <source>LXQt sudo</source>
<translation>LXQt sudo</translation> <translation>LXQt sudo</translation>
</message> </message>
<message> <message>
<location filename="../passworddialog.ui" line="77"/> <location filename="../passworddialog.ui" line="77"/>
<location filename="../build/ui_passworddialog.h" line="134"/>
<source>Command:</source> <source>Command:</source>
<translation>Befehl:</translation> <translation>Befehl:</translation>
</message> </message>
<message> <message>
<location filename="../passworddialog.ui" line="84"/> <location filename="../passworddialog.ui" line="84"/>
<location filename="../build/ui_passworddialog.h" line="135"/>
<source>Password:</source> <source>Password:</source>
<translation>Kennwort:</translation> <translation>Kennwort:</translation>
</message> </message>
@ -37,43 +34,88 @@ Bitte Kennwort eingeben.</translation>
<context> <context>
<name>QObject</name> <name>QObject</name>
<message> <message>
<location filename="../main.cpp" line="57"/> <location filename="../sudo.cpp" line="63"/>
<source>Usage: %1 command [arguments...] <source>Usage: %1 option [command [arguments...]]
GUI frontend for %2 GUI frontend for %2/%3
Arguments: Arguments:
option:
-h|--help Print this help.
-v|--version Print version information.
-s|--su Use %3(1) as backend.
-d|--sudo Use %2(8) as backend.
command Command to run. command Command to run.
arguments Optional arguments for command. arguments Optional arguments for command.
</source> </source>
<translation>Verwendung: %1 command [arguments...] <translation>Verwendung: %1 Option [Befehl [Argumente...]]
graphische Benutzeroberfläche für %2 Graphische Benutzeroberfläche für %2/%3
Argumente: Argumente:
command auszuführender Befehl Option:
arguments Argumente zum auszuführenden Befehl -h|--help Gibt diese Hilfe aus.
-v|--version Ausgabe der Versionsinformation.
-s|--su Verwendet %3(1) als Backend.
-d|--sudo Verwendet %2(8) als Backend.
Befehl Auszuführender Befehl.
Argumente Argumente zum auszuführenden Befehl.
</translation> </translation>
</message> </message>
<message> <message>
<location filename="../main.cpp" line="69"/> <location filename="../sudo.cpp" line="80"/>
<source>%1 version %2 <source>%1 version %2
</source> </source>
<translation>%1 Version %2 <translation>%1 Version %2
</translation> </translation>
</message> </message>
</context>
<context>
<name>Sudo</name>
<message> <message>
<location filename="../main.cpp" line="80"/> <location filename="../sudo.cpp" line="128"/>
<source>%1: no command to run provided!</source> <source>%1: no command to run provided!</source>
<translation>%1: kein auszuführender Befehl angegeben!</translation> <translation>%1: kein auszuführender Befehl angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../main.cpp" line="131"/> <location filename="../sudo.cpp" line="135"/>
<source>%1: no backend chosen!</source>
<translation>%1: kein Backend gewählt!</translation>
</message>
<message>
<location filename="../sudo.cpp" line="140"/>
<source>%1: warning - got multiple arguments for %2 backend, squashing into one: %3</source>
<translation>%1: Warnung - mehrere Argumente für Backend %2 erhalten. %3 wird verwendet</translation>
</message>
<message>
<location filename="../sudo.cpp" line="155"/>
<source>Failed to fork: %1</source>
<translation>Abspalten des Prozesses fehlgeschlagen: %1</translation>
</message>
<message>
<location filename="../sudo.cpp" line="193"/>
<source>%1: Failed to exec &apos;%2&apos;: %3
</source>
<translation>%1: Ausführen von &apos;%2&apos; fehlgeschlagen:
%3</translation>
</message>
<message>
<location filename="../sudo.cpp" line="222"/>
<source>Failed to set non-block: %1</source>
<translation>Das Setzen von der Option O_NONBLOCK schlug fehl: %1</translation>
</message>
<message>
<location filename="../sudo.cpp" line="230"/>
<source>Failed to fdopen: %1</source>
<translation>Das Öffnen schlug fehl: %1</translation>
</message>
<message>
<location filename="../sudo.cpp" line="263"/>
<source>Child &apos;%1&apos; process failed! <source>Child &apos;%1&apos; process failed!
%2</source> %2</source>
<translation>nachgeordneter Prozess &apos;%1&apos; ist fehlgeschlagen! <translation>Nachgeordneter Prozess &apos;%1&apos; ist fehlgeschlagen!
%2</translation> %2</translation>
</message> </message>
</context> </context>

@ -5,19 +5,16 @@
<name>PasswordDialog</name> <name>PasswordDialog</name>
<message> <message>
<location filename="../passworddialog.ui" line="20"/> <location filename="../passworddialog.ui" line="20"/>
<location filename="../build/ui_passworddialog.h" line="129"/>
<source>LXQt sudo</source> <source>LXQt sudo</source>
<translation>LXQt sudo</translation> <translation>LXQt sudo</translation>
</message> </message>
<message> <message>
<location filename="../passworddialog.ui" line="77"/> <location filename="../passworddialog.ui" line="77"/>
<location filename="../build/ui_passworddialog.h" line="134"/>
<source>Command:</source> <source>Command:</source>
<translation>Príkaz:</translation> <translation>Príkaz:</translation>
</message> </message>
<message> <message>
<location filename="../passworddialog.ui" line="84"/> <location filename="../passworddialog.ui" line="84"/>
<location filename="../build/ui_passworddialog.h" line="135"/>
<source>Password:</source> <source>Password:</source>
<translation>Heslo:</translation> <translation>Heslo:</translation>
</message> </message>
@ -37,40 +34,84 @@ Prosím, zadajte svoje heslo.</translation>
<context> <context>
<name>QObject</name> <name>QObject</name>
<message> <message>
<location filename="../main.cpp" line="57"/> <location filename="../sudo.cpp" line="63"/>
<source>Usage: %1 command [arguments...] <source>Usage: %1 option [command [arguments...]]
GUI frontend for %2 GUI frontend for %2/%3
Arguments: Arguments:
option:
-h|--help Print this help.
-v|--version Print version information.
-s|--su Use %3(1) as backend.
-d|--sudo Use %2(8) as backend.
command Command to run. command Command to run.
arguments Optional arguments for command. arguments Optional arguments for command.
</source> </source>
<translation>Použitie: %1 command [arguments...] <translation>Použitie: %1 option [command [arguments...]]
GUI frontend pre %2 GUI frontend pre %2/%3
Parametre: Parametre:
option:
-h|--help Zobraziť pomoc.
-v|--version Zobraziť verziu.
-s|--su Použiť %3(1) ako backend.
-d|--sudo Použíť %2(8) ako backend.
command Príkaz na spustenie. command Príkaz na spustenie.
arguments Parametre príkazu. arguments Parametre príkazu.
</translation> </translation>
</message> </message>
<message> <message>
<location filename="../main.cpp" line="69"/> <location filename="../sudo.cpp" line="80"/>
<source>%1 version %2 <source>%1 version %2
</source> </source>
<translation>%1 verzia %2 <translation>%1 verzia %2
</translation> </translation>
</message> </message>
</context>
<context>
<name>Sudo</name>
<message> <message>
<location filename="../main.cpp" line="80"/> <location filename="../sudo.cpp" line="128"/>
<source>%1: no command to run provided!</source> <source>%1: no command to run provided!</source>
<translation>%1: žiaden príkaz na spustenie!</translation> <translation>%1: žiaden príkaz na spustenie!</translation>
</message> </message>
<message> <message>
<location filename="../main.cpp" line="131"/> <location filename="../sudo.cpp" line="135"/>
<source>%1: no backend chosen!</source>
<translation>%1: nevybratý backend!</translation>
</message>
<message>
<location filename="../sudo.cpp" line="140"/>
<source>%1: warning - got multiple arguments for %2 backend, squashing into one: %3</source>
<translation>%1: upozornenie - zadaných viacero parametrov pre %2 backend, zlúčené do jedného: %3</translation>
</message>
<message>
<location filename="../sudo.cpp" line="155"/>
<source>Failed to fork: %1</source>
<translation>Zlyhal fork: %1</translation>
</message>
<message>
<location filename="../sudo.cpp" line="193"/>
<source>%1: Failed to exec &apos;%2&apos;: %3
</source>
<translation>%1: Zlyhal exec &apos;%2&apos;: %3</translation>
</message>
<message>
<location filename="../sudo.cpp" line="222"/>
<source>Failed to set non-block: %1</source>
<translation>Zlyhalo nastavenie non-block: %1</translation>
</message>
<message>
<location filename="../sudo.cpp" line="230"/>
<source>Failed to fdopen: %1</source>
<translation>Zlyhal fdopen: %1</translation>
</message>
<message>
<location filename="../sudo.cpp" line="263"/>
<source>Child &apos;%1&apos; process failed! <source>Child &apos;%1&apos; process failed!
%2</source> %2</source>
<translation>Dcérsky &apos;%1&apos; process zlyhal! <translation>Dcérsky &apos;%1&apos; process zlyhal!

Loading…
Cancel
Save