diff --git a/debian/changelog b/debian/changelog index 378b0b2..3b4dc64 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -lxqt-sudo (0.9.0+20151024-1) experimental; urgency=medium +lxqt-sudo (0.9.0+20151029-1) experimental; urgency=medium * Cherry-picked upstream version 0.9.0+20151024. + * set new minimum versions for liblxqt and libqxtg - -- Alf Gaida Sat, 24 Oct 2015 14:05:24 +0200 + -- Alf Gaida Sat, 31 Oct 2015 11:26:51 +0100 lxqt-sudo (0.9.0+20150908-2) experimental; urgency=medium diff --git a/debian/control b/debian/control index 3050902..42b4bfe 100644 --- a/debian/control +++ b/debian/control @@ -8,9 +8,9 @@ Priority: optional Build-Depends: debhelper (>= 9), cmake (>= 3.0.2), libkf5windowsystem-dev, - liblxqt0-dev (>= 0.9.0+20150911), + liblxqt0-dev (>= 0.9.0+20151026), libqt5x11extras5-dev, - libqt5xdg-dev, + libqt5xdg-dev (>= 1.3.0), libx11-dev, pkg-config, qttools5-dev, diff --git a/sudo.cpp b/sudo.cpp index 19de45e..374dea4 100644 --- a/sudo.cpp +++ b/sudo.cpp @@ -79,6 +79,13 @@ namespace QTextStream(stdout) << 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() @@ -163,7 +170,7 @@ int Sudo::main() void Sudo::child() { 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(); std::unique_ptr params{new char const *[params_cnt]}; const char ** param_arg = params.get() + 1; @@ -172,9 +179,12 @@ void Sudo::child() if (BACK_SU == mBackend) { program = su_prog.toStdString(); - *(param_arg++) = "-c"; + *(param_arg++) = "-c"; //run command } else + { program = sudo_prog.toStdString(); + *(param_arg++) = "-E"; //preserve environment + } params[0] = program.c_str(); @@ -186,6 +196,8 @@ void Sudo::child() *param_arg = nullptr; + env_workarounds(); + setsid(); //session leader execvp(params[0], const_cast(params.get())); diff --git a/translations/lxqt-sudo.ts b/translations/lxqt-sudo.ts index 466ddce..820df8b 100644 --- a/translations/lxqt-sudo.ts +++ b/translations/lxqt-sudo.ts @@ -1,23 +1,20 @@ - + PasswordDialog - LXQt sudo - Command: - Password: @@ -36,31 +33,70 @@ Please enter your password. QObject - - Usage: %1 command [arguments...] + + Usage: %1 option [command [arguments...]] -GUI frontend for %2 +GUI frontend for %2/%3 Arguments: - command Command to run. - arguments Optional arguments for command. + 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. + arguments Optional arguments for command. - + %1 version %2 + + + Sudo - + %1: no command to run provided! - + + %1: no backend chosen! + + + + + %1: warning - got multiple arguments for %2 backend, squashing into one: %3 + + + + + Failed to fork: %1 + + + + + %1: Failed to exec '%2': %3 + + + + + + Failed to set non-block: %1 + + + + + Failed to fdopen: %1 + + + + Child '%1' process failed! %2 diff --git a/translations/lxqt-sudo_de.ts b/translations/lxqt-sudo_de.ts index 580ce15..6a7ebb9 100644 --- a/translations/lxqt-sudo_de.ts +++ b/translations/lxqt-sudo_de.ts @@ -5,19 +5,16 @@ PasswordDialog - LXQt sudo LXQt sudo - Command: Befehl: - Password: Kennwort: @@ -37,43 +34,88 @@ Bitte Kennwort eingeben. QObject - - Usage: %1 command [arguments...] + + Usage: %1 option [command [arguments...]] -GUI frontend for %2 +GUI frontend for %2/%3 Arguments: - command Command to run. - arguments Optional arguments for command. + 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. + arguments Optional arguments for command. - Verwendung: %1 command [arguments...] + Verwendung: %1 Option [Befehl [Argumente...]] -graphische Benutzeroberfläche für %2 +Graphische Benutzeroberfläche für %2/%3 Argumente: - command auszuführender Befehl - arguments Argumente zum auszuführenden Befehl + Option: + -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. - + %1 version %2 %1 Version %2 + + + Sudo - + %1: no command to run provided! %1: kein auszuführender Befehl angegeben! - + + %1: no backend chosen! + %1: kein Backend gewählt! + + + + %1: warning - got multiple arguments for %2 backend, squashing into one: %3 + %1: Warnung - mehrere Argumente für Backend %2 erhalten. %3 wird verwendet + + + + Failed to fork: %1 + Abspalten des Prozesses fehlgeschlagen: %1 + + + + %1: Failed to exec '%2': %3 + + %1: Ausführen von '%2' fehlgeschlagen: +%3 + + + + Failed to set non-block: %1 + Das Setzen von der Option O_NONBLOCK schlug fehl: %1 + + + + Failed to fdopen: %1 + Das Öffnen schlug fehl: %1 + + + Child '%1' process failed! %2 - nachgeordneter Prozess '%1' ist fehlgeschlagen! + Nachgeordneter Prozess '%1' ist fehlgeschlagen! %2 diff --git a/translations/lxqt-sudo_sk.ts b/translations/lxqt-sudo_sk.ts index 6d29ef4..3e1cb20 100644 --- a/translations/lxqt-sudo_sk.ts +++ b/translations/lxqt-sudo_sk.ts @@ -5,19 +5,16 @@ PasswordDialog - LXQt sudo LXQt sudo - Command: Príkaz: - Password: Heslo: @@ -37,40 +34,84 @@ Prosím, zadajte svoje heslo. QObject - - Usage: %1 command [arguments...] + + Usage: %1 option [command [arguments...]] -GUI frontend for %2 +GUI frontend for %2/%3 Arguments: - command Command to run. - arguments Optional arguments for command. + 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. + arguments Optional arguments for command. - Použitie: %1 command [arguments...] + Použitie: %1 option [command [arguments...]] -GUI frontend pre %2 +GUI frontend pre %2/%3 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. arguments Parametre príkazu. - + %1 version %2 %1 verzia %2 + + + Sudo - + %1: no command to run provided! %1: žiaden príkaz na spustenie! - + + %1: no backend chosen! + %1: nevybratý backend! + + + + %1: warning - got multiple arguments for %2 backend, squashing into one: %3 + %1: upozornenie - zadaných viacero parametrov pre %2 backend, zlúčené do jedného: %3 + + + + Failed to fork: %1 + Zlyhal fork: %1 + + + + %1: Failed to exec '%2': %3 + + %1: Zlyhal exec '%2': %3 + + + + Failed to set non-block: %1 + Zlyhalo nastavenie non-block: %1 + + + + Failed to fdopen: %1 + Zlyhal fdopen: %1 + + + Child '%1' process failed! %2 Dcérsky '%1' process zlyhal!