Giter Club home page Giter Club logo

lxqt-sudo's Introduction

lxqt-sudo

Overview

lxqt-sudo is a graphical front-end of commands sudo and su respectively. As such it enables regular users to launch applications with permissions of other users including root.

Installation

Compiling source code

Runtime dependencies are qtbase, sudo (su should be installed by default on all *ix operating systems) and liblxqt.
Installing at least one icon theme according to the XDG Icon Theme Specification like e. g. "Oxygen Icons" is recommended to have the GUI display icons.
Additional build dependencies are CMake and optionally Git to pull latest VCS checkouts.

Code configuration is handled by CMake. CMake variable CMAKE_INSTALL_PREFIX has to be set to /usr on most operating systems.

To build run make, to install make install which accepts variable DESTDIR as usual.

Binary packages

Official binary packages are provided by all major Linux distributions like Arch Linux, Debian (as of Debian stretch), Fedora and openSUSE. It's also available on FreeBSD. Just use your package manager to search for string lxqt-sudo.

Configuration

lxqt-sudo itself does not require any configuration.

In order to use it as front-end of sudo the corresponding permissions have to be set, though. Most of the time this is handled by binary visudo or editing configuration file /etc/sudoers manually which both is beyond this document's scope.

Usage

lxqt-sudo comes with a man page explaining the syntax very well so running man 1 lxqt-sudo should get you started.

By default sudo is used as backend, the choice can be enforced by command line options --su[do] or by using symbolic links lxsu and lxsudo which belong to regular installations of lxqt-sudo.

Translations

Translations can be done in LXQt-Weblate/powermanagement and LXQt-Weblate/config-powermanagement

Translation status

lxqt-sudo's People

Contributors

agaida avatar atalanttore avatar attuska avatar ayhanyalcinsoy avatar bertronika avatar chiitoo avatar dglent avatar fat-zer avatar fpiecka avatar luis-pereira avatar lxqtbot avatar mbouzada avatar micrococo avatar mkljczk avatar p-bo avatar pafri avatar palinek avatar pjotr123 avatar rbuj avatar roxfr avatar safaalfulaij avatar scootergrisen avatar shlyakpavel avatar smarquespt avatar stefonarch avatar tsujan avatar welaq avatar xlucn avatar yarons avatar zoli111 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lxqt-sudo's Issues

lxqt-sudo discards the command argument

lxqt-sudo discards the -geometry argument anywhere

Expected Behavior

lxqt-sudo xterm -hold -e echo '-geometry'
Should show a window with the text -geometry

lxqt-sudo xterm -geometry 100x1000
Should run xterm -geometry 100x1000

https://i.imgur.com/x3tRwpt

Current Behavior

lxqt-sudo xterm -hold -e echo '-geometry'
empty window

lxqt-sudo xterm -geometry 100x1000
run xterm without -geometry argument

  • Distribution & Version: Ubuntu 20.04
  • Kernel: Linux lubuntu 5.19.11-tkg-pds
  • Qt Version: 5.15.3
  • liblxqt Version: 1.1.0-1
  • Package version: 1.1.0-1

lxqt-sudo fails to run applications launched with xdg-su -c '[command] [argument]'

An application launched with xdg-su -c '[command] [argument]' will not start after approving its execution in the password dialog.

Expected Behavior

xdg-su -c '[command] [argument]' should translate to: lxqt-sudo [command] [argument]

Current Behavior

xdg-su -c '[command] [argument]' translates to: lxqt-sudo '[command] [argument]'

Result: the execution of the program fails because no executable with the name '[command] [argument]' exists.

Possible Solution

Remove the quotation marks around the command.

Steps to Reproduce
  1. In QTerminal run: xdg-su -c 'qterminal -e bash'
  2. The command shown in the password dialog is: 'qterminal -e bash' (should be: qterminal -e bash)
  3. Enter the superuser password and approve the execution
  4. The application fails to run (exec: qterminal -e bash: not found)
Context

Administrative YaST modules in openSUSE can be launched directly via their respective .desktop file, where the command
xdg-su -c '/sbin/yast2 [module]' is used.

Not being able to start an application this way has the consequence, that you cannot open any of these modules directly from the start menu or via an application launcher.

System Information
  • Distribution & Version: openSUSE Tumbleweed 20221017
  • Kernel: 6.0.1-1-default
  • Qt Version: 5.15.6
  • liblxqt Version: 1.1.0-2.2
  • Package version: 1.1.0-1.4

'lxqt-sudo --user' to run application under a user other than root

Expected Behavior

lxqt-sudo --user username

Run under a different username. Similar to sudo --user.

Current Behavior

lxqt-sudo does not support --user.

Context

In Whonix we are using hidepid=2. This breaks pkexec. Hence a wrapper was written to redirect calls from pkexec to lxqt-sudo. However, pkexec supports --user while lxqt-sudo does not.

FTBFS: Fallout from latest lxqt-build-tools merge

/build/lxqt-sudo-0.14.2~30-g7dc6e7b/passworddialog.cpp:50:60: error: ‘QString::QString(const char*)’ is private within this context
   50 |     ui->iconL->setPixmap(QIcon::fromTheme("dialog-password").pixmap(64, 64));
      |                                                            ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qwidget.h:45,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qdialog.h:44,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QDialog:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/passworddialog.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/passworddialog.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/passworddialog.cpp:51:51: error: ‘QString::QString(const char*)’ is private within this context
   51 |     setWindowIcon(QIcon::fromTheme("security-high"));
      |                                                   ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qwidget.h:45,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qdialog.h:44,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QDialog:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/passworddialog.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/passworddialog.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
make[3]: *** [CMakeFiles/lxqt-sudo.dir/build.make:190: CMakeFiles/lxqt-sudo.dir/passworddialog.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp: In lambda function:
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:119:32: error: ‘QString::QString(const char*)’ is private within this context
  119 |                     return b > a;
      |                                ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp: In function ‘std::string {anonymous}::env_workarounds()’:
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:121:45: error: ‘QString::QString(const char*)’ is private within this context
  121 |             if (i == ALLOWED_END || key != *i)
      |                                             ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp: In function ‘QString {anonymous}::quoteShellArg(const QString&, bool)’:
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:134:87: error: ‘QString::QString(const char*)’ is private within this context
  134 |         if (!userFriendly || arg.contains(QRegExp("(\\s|[][!\"#$&'()*,;<=>?\\^`{}|~])"))) {
      |                                                                                       ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:136:29: error: ‘QChar::QChar(char)’ is private within this context
  136 |             rv.prepend ('\'').append('\'');
      |                             ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:48,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qchar.h:589:5: note: declared private here
  589 |     QChar(char c) Q_DECL_NOTHROW;
      |     ^~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:136:42: error: ‘QChar::QChar(char)’ is private within this context
  136 |             rv.prepend ('\'').append('\'');
      |                                          ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:48,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qchar.h:589:5: note: declared private here
  589 |     QChar(char c) Q_DECL_NOTHROW;
      |     ^~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp: In member function ‘int Sudo::main()’:
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:166:21: error: ‘QString::QString(const char*)’ is private within this context
  166 |         if ("-h" == arg1 || "--help" == arg1)
      |                     ^~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:166:41: error: ‘QString::QString(const char*)’ is private within this context
  166 |         if ("-h" == arg1 || "--help" == arg1)
      |                                         ^~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:170:28: error: ‘QString::QString(const char*)’ is private within this context
  170 |         } else if ("-v" == arg1 || "--version" == arg1)
      |                            ^~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:170:51: error: ‘QString::QString(const char*)’ is private within this context
  170 |         } else if ("-v" == arg1 || "--version" == arg1)
      |                                                   ^~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:174:28: error: ‘QString::QString(const char*)’ is private within this context
  174 |         } else if ("-s" == arg1 || "--su" == arg1)
      |                            ^~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:174:46: error: ‘QString::QString(const char*)’ is private within this context
  174 |         } else if ("-s" == arg1 || "--su" == arg1)
      |                                              ^~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:178:28: error: ‘QString::QString(const char*)’ is private within this context
  178 |         } else if ("-d" == arg1 || "--sudo" == arg1)
      |                            ^~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~
/build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:178:48: error: ‘QString::QString(const char*)’ is private within this context
  178 |         } else if ("-d" == arg1 || "--sudo" == arg1)
      |                                                ^~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.h:31,
                 from /build/lxqt-sudo-0.14.2~30-g7dc6e7b/sudo.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:829:5: note: declared private here
  829 |     QString(const char *ch);
      |     ^~~~~~~

lxqt-sudo fails if sudo is not available

Expected Behavior

lxqt-sudo should use su if sudo is not available.

Current Behavior

fails if sudo is not present.

Possible Solution
  • Use su by default, because su is ubiquitous (sudo is not).
  • Or follow a waterfall logic: if sudo is present, use it, otherwise use su.
Steps to Reproduce (for bugs)

GUI
Tools -> Open as Root in PCManFM fails (silently).

CLI

$ lxqt-sudo ls /etc
lxqt-sudo: Stripping child environment except for: DISPLAY,LANG,LANGUAGE,LC_ADDRESS,LC_ALL,LC_COLLATE,LC_CTYPE,LC_IDENTIFICATION,LC_MEASUREMENT,LC_MESSAGES,LC_MONETARY,LC_NAME,LC_NUMERIC,LC_PAPER,LC_TELEPHONE,LC_TIME,PATH,QT_PLATFORM_PLUGIN,QT_QPA_PLATFORMTHEME,TERM,WAYLAND_DISPLAY,XAUTHLOCALHOSTNAME,XAUTHORITY
lxqt-sudo: Failed to exec 'sudo': No such file or directory

Works fine with -s (su backend):

$ lxqt-sudo -s ls /etc

adjtime                 hostname           man_db.conf      rc_maps.cfg
arch-release            hosts              mdadm.conf       request-key.conf
Context

Some distro do not install sudo by default. And some power users choose not to use it. LXQt should not force the choice of sudo over su.

lxqt-sudo -s works without sudo, but is useless in practice, because GUI programs call lxqt-sudo without the parameter to specify which backend to use.

Example from PCManFM code (settings.cpp):

suCommand_ = settings.value(QStringLiteral("SuCommand"), QStringLiteral("lxqt-sudo %s")).toString();

Should PCManFM be patched to implement the waterfall ? I don't think so. The root cause of the problem is lxqt-sudo, which, once fixed, will fix it for all GUI programs that use it.

System Information
  • Distribution & Version: Arch linux
  • Kernel: Linux 5.7.5-arch1-1
  • Qt Version: Qt version 5.15.0
  • liblxqt Version: liblxqt 0.15.1-1
  • lxqt-build-tools Version: lxqt-build-tools 0.7.0-1
  • Package version: lxqt-sudo 0.15.0-1

"lxsu bash" results in frozen shell prompt

Expected Behavior

Functional bash root prompt as usual. (As it was the case with gksudo / kdesudo bash.)

Current Behavior
lxsu bash
lxqt-sudo: Stripping child environment except for: DISPLAY, LANG, LANGUAGE, LC_ADDRESS, LC_ALL, LC_COLLATE, LC_CTYPE, LC_IDENTIFICATION, LC_MEASUREMENT, LC_MESSAGES, LC_MONETARY, LC_NAME, LC_NUMERIC, LC_PAPER, LC_TELEPHONE, LC_TIME, PATH, QT_PLATFORM_PLUGIN, QT_QPA_PLATFORMTHEME, WAYLAND_DISPLAY, XAUTHLOCALHOSTNAME, XAUTHORITY

Shell prompt frozen. Cannot type anything. ctrl + c does nothing either.

Possible Solution
Steps to Reproduce (for bugs)
  1. upgrade Debian stretch to Debian buster (in Qubes OS)
  2. sudo apt-get install --no-install-recommends lxqt-sudo
  3. lxsu bash
Context

I guess starting a bash root prompt is so common that it doesn't need further reasoning?

System Information
  • Distribution & Version: Debian buster (in Qubes)
  • Kernel: Linux version 4.14.74-1.pvops.qubes.x86_64 (user@build-fedora4) (gcc version 6.4.1 20170727 (Red Hat 6.4.1-1) (GCC)) #1 SMP Mon Oct 8 17:14:24 UTC 2018
  • Qt Version: libqt5designer5:amd64 5.11.3-4
  • liblxqt Version: 0.14.1
  • lxqt-build-tools Version: was build by Debian
  • Package version: 0.14.1-1

Preserve more env vars

Any program started with lxqt-sudo does not receive information about current HiDPI scaling settings.
So its interface is not scaled properly.

Expected Behavior

Interface scaling settings are applied to all applications.

Current Behavior

Interface of any application run with lxqt-sudo is not scaled.

Possible Solution

Add "GDK_SCALE", "GDK_DPI_SCALE" and "QT_SCALE_FACTOR" to the list of preserved environment variables ALLOWED_VARS in sudo.cpp (lines 100 - 105). Maybe also add "GTK_OVERLAY_SCROLLING" and "GTK_CSD".

Steps to Reproduce (for bugs)
  1. Login as non-root user. Open lxqt-config-session.
  2. If global interface scale is set to 1, then set it to 1.5 or more and re-login as the same user
  3. Run any GUI app using lxqt-sudo. It's interface is not scaled.
  4. Run the same app without lxqt-sudo. See the difference in appearance, which should not exist.
Context

It is very inconvenient on 15" 1920x1080 screen to use Managing Software Sources, Synaptic package manager, PCManFM-qt as root, QTerminal as root, FeatherPad as root... Basically any GUI application that requires root privileges to function properly in some situation is barely usable with lxqt-sudo.

System Information
  • Distribution & Version: lubuntu 24.04
  • Kernel: 6.8.0-35-generic
  • Qt Version: 5.15.13
  • liblxqt Version:
  • lxqt-build-tools Version:
  • Package version: 1.4.0
  • Since: commit 07ec9ec when stripping environment was introduced. #22

SUDO_ASKPASS functionality

Expected Behavior

Functional SUDO_ASKPASS functionality.

Current Behavior

Broken SUDO_ASKPASS functionality.

Possible Solution
Steps to Reproduce (for bugs)

VISUAL=mousepad SUDO_ASKPASS=/usr/bin/lxqt-sudo sudoedit --askpass /etc/a

Context

What are you trying to accomplish?

Editing files in /etc folder with a graphical text editor. This requires write permissions in that folder. Some sort of root rights will be required. With X11, sudoedit was suitable for this task.

sudoedit copies the file to a temporary location, edits it as a normal user and then overwrites the original using sudo. This way is much more secure as it does not run the editor as root.

If lxqt-sudo supported being used as SUDO_ASKPASS tool, then any text editor could still be used to edit files in /etc with root rights even under Wayland. Even editors that do not support gvfs. (Example: gedit admin:///etc/ld.so.preload)

Running any editor as root is insecure. In native Wayland it is no longer possible to run editors with root rights. (Excluding xwayland.)

Native Wayland support

What are your plans regarding native Wayland support? Under Wayland it is no longer possible to run GUI applications with root rights.

Therefore I hope you are not planning on deprecating lxqt-sudo. It could still act as a secure SUDO_ASKPASS tool. Created

for that.

When running a terminal application via lxqt-sudo, all user input to the application is discarded

Expected Behavior

When running lxqt-sudo apt full-upgrade, I should be able to reply to apt when asked if I want to continue.

Current Behavior

When running lxqt-sudo apt full-upgrade, my input is ignored after apt launches - typing n and pressing Enter silently fails.

Possible Solution

Probably this is just the result of user input not being properly piped to the application (I checked the lxqt-sudo code and I didn't see anything that took user input and shuttled it to the launched app). Theoretically this should be easy to fix.

Steps to Reproduce (for bugs)
  1. Open a terminal on a Debian-based system with LXQt.
  2. Run lxqt-sudo apt full-upgrade
  3. Provide your password when prompted.
  4. When asked if you wish to continue, type n and press Enter. It will appear as if apt didn't get the message.
Context

I'm trying to write an updater application for Lubuntu that uses apt-get to retrieve info and do the installation work. To accomplish this, I have a script that does some two-way communication with the updater application (in order to allow handing conffile conflict problems). The script is then run as root via lxqt-sudo, and it communicates with the Qt-based frontend application. While output from the script (and from apt-get) reaches the application, attempts by the application to "talk back" to the script are being silently ignored since lxqt-sudo isn't forwarding the data.

System Information
  • Distribution & Version: Lubuntu 24.04 Noble Numbat Development
  • Kernel: 6.5.0-9-generic
  • Qt Version: 5.15.10
  • liblxqt Version: 1.4.0
  • lxqt-build-tools Version: 0.13.0
  • Package version: 1.4.0

doesnt launch when hostname changed

sudo hostname earth
lxqt-sudo yast2

No protocol specified
lxqt-sudo: Stripping child environment except for: DISPLAY, LANG, LANGUAGE, LC_ADDRESS, LC_ALL, LC_COLLATE, LC_CTYPE, LC_IDENTIFICATION, LC_MEASUREMENT, LC_MESSAGES, LC_MONETARY, LC_NAME, LC_NUMERIC, LC_PAPER, LC_TELEPHONE, LC_TIME, PATH, QT_PLATFORM_PLUGIN, QT_QPA_PLATFORMTHEME, WAYLAND_DISPLAY, XAUTHORITY

No protocol specified
No protocol specified
qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
error: XDG_RUNTIME_DIR not set in the environment.
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

We should not strip $XAUTHLOCALHOSTNAME.

Link to original bugreport.

Support for Doas

Expected Behavior

lxqt-sudo should run using doas without an issue when specified with a hypothetical doas backend flag.

Current Behavior

lxqt-sudo fails to run without sudo. Symlinking /usr/bin/doas to /usr/bin/sudo produces obvious errors.

Possible Solution

Adding a doas backend and appropriate flag to enable it on command.

Steps to Reproduce (for bugs)

  1. System without sudo. Doas symlinked to sudo.
  2. Open terminal.
  3. Run lxqt-sudo echo "Trial1"
  4. Errors (provided in attached illustration)
    Illustration Hyperlink

Context

Unable to use lxqt-sudo on a doas based system. Alternating with pkexec instead for the meantime.

System Information

  • Distribution & Version: Void GNU/Linux GLibC - Latest
  • Kernel: Linux 6.1.12_1
  • Qt Version: qt5-5.15.7+20221119_1
  • liblxqt Version: 1.2.0_1
  • lxqt-build-tools Version: 0.12.0_1
  • Package version: 1.2.0_1

'lxsu exo-open test.txt' does not open text editor while 'sudo --set-home exo-open test.txt' does

Expected Behavior
  • Same behavior as with sudo --set-home.
  • Editor opening.
Current Behavior
lxsu exo-open test.txt ; echo $?

0

Editor does not open.

Possible Solution
Steps to Reproduce (for bugs)
  1. upgrade Debian stretch to Debian buster (in Qubes OS pr real Debian buster)
  2. sudo apt-get install --no-install-recommends lxqt-sudo
  3. touch test.txt
  4. lxsu exo-open test.txt
Context

desktop shortcut using lxsu (to get root rights, to have a password prompt), followed by xdg-open (which is supposed to select the user's favorite chosen text editor rather than hardcoding any specific one [or inventing a custom mechanism for choosing one]).

System Information
  • Distribution & Version: Debian buster (in Qubes)
  • Kernel: Linux version 4.14.74-1.pvops.qubes.x86_64 (user@build-fedora4) (gcc version 6.4.1 20170727 (Red Hat 6.4.1-1) (GCC)) #1 SMP Mon Oct 8 17:14:24 UTC 2018
  • Qt Version: libqt5designer5:amd64 5.11.3-4
  • liblxqt Version: 0.14.1
  • lxqt-build-tools Version: was build by Debian
  • Package version: 0.14.1-1
exo-open comparison with non-root and sudo behavior
  • touch test.txt
  • works: exo-open test.txt
  • works: sudo --set-home exo-open test.txt
  • fails: lxsu exo-open test.txt
  • fails in Qubes Debian buster as well as real Debian buster
env comparison with non-root and sudo behavior

Perhaps environment has something to do with it? I guess not. Just in case attaching the different output.

sudo --set-home env
COLORTERM=truecolor
XAUTHORITY=/home/user/.Xauthority
LANG=en_US.utf8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
TERM=xterm-256color
DISPLAY=:0.0
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAIL=/var/mail/root
LOGNAME=root
USER=root
HOME=/root
SHELL=/bin/bash
SUDO_COMMAND=/usr/bin/env
SUDO_USER=user
SUDO_UID=1000
SUDO_GID=1000
lxsu env

SHELL=/bin/bash
PWD=/home/user
XAUTHORITY=/home/user/.Xauthority
HOME=/root
LANG=en_US.UTF-8
DISPLAY=:0.0
SHLVL=0
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
MAIL=/var/mail/root

References

Also reported against exo-open:
https://bugzilla.xfce.org/show_bug.cgi?id=15282

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.