GithubHelp home page GithubHelp logo

qt-sudo's Introduction

QT-SUDO

This is a clone of LXQt sudo tool (without LXQt libs). It is the ONLY privilege escalation tool supported by Baiacu, Octopi, OctoPkg, OctoPkgin, OctoXBPS and QTGZManager applications.

It needs doas or sudo tool to work.

Steps to build:

$ git clone https://github.com/aarnt/qt-sudo
$ cd qt-sudo 
$ qmake6
$ make
# make install

qt-sudo's People

Contributors

aarnt avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

qt-sudo's Issues

Fails to build with Qt6

Building on Arch Stable / Manjaro Unstable with:

  qmake6 \
    PREFIX=/usr \
    QMAKE_CFLAGS="${CFLAGS}" \
    QMAKE_CXXFLAGS="${CXXFLAGS}" \
    QMAKE_LFLAGS="${LDFLAGS}"
  make
Info: creating stash file /build/qt-sudo/src/qt-sudo/.qmake.stash
/usr/lib/qt6/uic passworddialog.ui -o ui_passworddialog.h
g++ -c -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -flto=auto -g -Wall -Wextra -mno-direct-extern-access -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_FROM_BYTEARRAY -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/include/qt6 -I/usr/include/qt6/QtWidgets -I/usr/include/qt6/QtGui -I/usr/include/qt6/QtCore -I. -I. -I/usr/lib/qt6/mkspecs/linux-g++ -o main.o main.cpp
g++ -c -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -flto=auto -g -Wall -Wextra -mno-direct-extern-access -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_FROM_BYTEARRAY -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/include/qt6 -I/usr/include/qt6/QtWidgets -I/usr/include/qt6/QtGui -I/usr/include/qt6/QtCore -I. -I. -I/usr/lib/qt6/mkspecs/linux-g++ -o sudo.o sudo.cpp
/usr/lib/qt6/bin/lrelease translations/lxqt-sudo_vi.ts -qm .qm/lxqt-sudo_vi.qm
make: /usr/lib/qt6/bin/lrelease: No such file or directory
make: *** [Makefile:455: .qm/lxqt-sudo_vi.qm] Error 127
make: *** Waiting for unfinished jobs....
main.cpp: In function ‘int main(int, char**)’:
main.cpp:48:24: warning: ‘Qt::AA_UseHighDpiPixmaps’ is deprecated: High-DPI pixmaps are always enabled. This attribute no longer has any effect. [-Wdeprecated-declarations]
   48 |   app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
      |                        ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qobjectdefs.h:12,
                 from /usr/include/qt6/QtCore/qobject.h:10,
                 from /usr/include/qt6/QtCore/QObject:1,
                 from sudo.h:31,
                 from main.cpp:38:
/usr/include/qt6/QtCore/qnamespace.h:438:9: note: declared here
  438 |         AA_UseHighDpiPixmaps Q_DECL_ENUMERATOR_DEPRECATED_X(
      |         ^~~~~~~~~~~~~~~~~~~~
sudo.cpp: In member function ‘int Sudo::main()’:
sudo.cpp:229:24: warning: ‘static void QApplication::setActiveWindow(QWidget*)’ is deprecated: Use QWidget::activateWindow() instead. [-Wdeprecated-declarations]
  229 |   qApp->setActiveWindow(mDlg.data());
In file included from /usr/include/qt6/QtWidgets/QApplication:1,
                 from sudo.cpp:35:
/usr/include/qt6/QtWidgets/qapplication.h:84:17: note: declared here
   84 |     static void setActiveWindow(QWidget* act);
      |                 ^~~~~~~~~~~~~~~

C.UTF-8 message

Running octopi using my de_DE.UTF-8 locale I get the message:

Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.

Patching qt-sudo with

diff -upr a/sudo.cpp b/sudo.cpp
--- a/sudo.cpp	2024-05-23 17:53:04.967119754 +0200
+++ b/sudo.cpp	2024-05-23 17:54:35.334177682 +0200
@@ -336,7 +336,7 @@ void Sudo::child()
 
   *param_arg = nullptr;
 
-  setenv("LC_ALL", "C", 1);
+  setenv("LC_ALL", "C.UTF-8", 1);
 
   setsid(); //session leader
   execvp(params[0], const_cast(params.get()));

solves the issue. There are more "C" locales in octopi itself (octopihelper.cpp and unixcommand.cpp), but this change in qt-sudo seems to fix it all.

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.