Compare commits

..

111 Commits

Author SHA1 Message Date
Aaron Rainbolt
0cb178423e
Update build deps 2025-07-31 16:33:36 -05:00
Aaron Rainbolt
fd268f6b00
Bump Standards-Version 2025-07-31 16:32:49 -05:00
Aaron Rainbolt
fbe3ac6a44
Update copyright file 2025-07-31 16:32:22 -05:00
Aaron Rainbolt
b423a369d7
Bump version for new upstream release 2025-07-31 16:31:23 -05:00
321e0b5077 Update Standards-Version to 4.7.1, no changes needed. 2025-02-21 17:04:13 -06:00
768eb12128 No-change rebuild for lxqt-build-tools C++17 -> C++20. 2025-02-21 16:53:07 -06:00
f7a1bf9ad9 Upload to Plucky 2024-11-15 15:34:45 -06:00
52c1d9a920 Make Lintian happy 2024-11-05 18:21:44 -06:00
03cbed1a58 New upstream version. 2024-11-05 18:15:40 -06:00
146074a151 Update the patch to pass through env vars. 2024-11-05 18:14:07 -06:00
Aaron Rainbolt
4205318af5 Release to Oracular 2024-08-15 16:43:22 -05:00
Aaron Rainbolt
45476314b6 PPA build 2024-06-27 16:26:33 -05:00
Aaron Rainbolt
6a15c4a9ef Adjust deps 2024-06-27 16:26:17 -05:00
Aaron Rainbolt
6810234f8f Bump Standards-Version 2024-06-27 16:22:44 -05:00
Aaron Rainbolt
66ccff86ad Drop enable-bidirectional-communication.patch 2024-06-27 16:22:01 -05:00
Aaron Rainbolt
73d3ada062 Update copyright file 2024-06-27 16:20:21 -05:00
Aaron Rainbolt
f0eb459607 Bump version for new upstream release 2024-06-27 16:19:40 -05:00
6f34f5cdc2 Add bidirectional communication patch 2024-01-11 13:57:16 -06:00
06b152504d Upload to Noble. 2023-11-12 19:13:54 -06:00
88a7bd0ea1 Update copyright years. 2023-11-12 19:12:07 -06:00
c58cc73098 Bump build dependencies. 2023-11-12 19:11:47 -06:00
5cff75e023 New upstream release. 2023-11-12 19:11:22 -06:00
46d06f9171 Add a -E option, exposing all environment variables (LP: #2039093). 2023-11-12 19:10:24 -06:00
d81b1c7857 Upload to Mantic. 2023-08-11 09:52:05 -05:00
b9fa753636 Install new lxqtdoas binary. 2023-08-11 09:44:59 -05:00
57bbb02b3c Bump build dependencies. 2023-08-10 16:43:37 -05:00
40fe6cb0c8 New upstream release. 2023-08-10 16:39:47 -05:00
Aaron Rainbolt
96907a596d Updated copyright file. 2023-02-16 23:00:21 -06:00
Aaron Rainbolt
16f77640b3 Removed override_dh_missing. 2023-02-16 20:23:24 -06:00
Aaron Rainbolt
225f120d7e Bumped Standards-Version. 2023-02-16 20:22:52 -06:00
Aaron Rainbolt
11a2e40441 Revert a sync from Debian.
This reverts commit 3f6e60c63fabf715e01e329904279a9cd195cdac.
2023-02-16 20:20:50 -06:00
Aaron Rainbolt
3f6e60c63f Sync with archive. 2023-02-16 20:20:01 -06:00
7e03c7755d Upload to Lunar. 2022-11-18 18:51:55 -06:00
81d4be6dda Bump build dependencies in debian/control. 2022-11-18 18:50:04 -06:00
ef154be157 Lubuntuify the package slightly, to make debhelper happy. 2022-11-18 18:48:02 -06:00
a211ad2c95 Fix the watch file, for real this time. 2022-11-18 18:45:45 -06:00
cd3c316c1c New upstream release. 2022-11-18 18:45:25 -06:00
eca80634b1 Sync with Debian version 1.1.0-1. 2022-11-18 18:43:18 -06:00
5ecba12dfb Release to Kinetic. 2022-06-02 09:24:03 -05:00
7e2f713858 Drop old Breaks/Replaces, we're past the LTS. 2022-06-02 09:21:38 -05:00
a53e375380 Bump build dependencies. 2022-06-02 09:21:04 -05:00
2440fab256 New upstream release. 2022-06-02 09:20:31 -05:00
apt-ghetto
db0bfc7b5f New upstream release for lxqt-sudo
Summary:
Packaged new upstream release 0.17.0 for lxqt-sudo
Updated changelog, control and copyright

Test Plan: Built successfully on https://launchpad.net/~apt-ghetto/+archive/ubuntu/ludev

Reviewers: kc2bez

Reviewed By: kc2bez

Differential Revision: https://phab.lubuntu.me/D129
2021-08-16 19:32:28 -04:00
Raman Sarda
a9b4deae18 New upstream version. 2021-02-22 01:30:54 +05:30
6199a14cec Upload to Groovy. 2020-06-04 14:15:24 -05:00
cadac1d254 Migrate to debhelper-compat. 2020-04-30 23:45:39 -05:00
a561b8b69f Update LXQt build dependencies. 2020-04-30 23:45:15 -05:00
2f124928ac Update upstream signing key. 2020-04-30 23:44:49 -05:00
d210e14b35 Update Standards-version to 4.5.0, no changes needed. 2020-04-30 23:44:18 -05:00
df5777a1c8 New upstream release. 2020-04-30 23:44:02 -05:00
Simon Quigley
1e450dc49c Upload to Disco. 2019-03-09 13:20:40 -06:00
Simon Quigley
4906644a6b Run wrap-and-sort. 2019-03-09 13:20:24 -06:00
Simon Quigley
efc8f5d8a0 New upstream release. 2019-03-09 13:20:02 -06:00
Simon Quigley
2698ce38df Upload to Disco. 2019-01-26 00:55:06 -06:00
Simon Quigley
10e35b483e Remove erraneous file. 2019-01-26 00:54:48 -06:00
Simon Quigley
9c8f8a4af3 Add a new lxqt-sudo-l10n package. 2019-01-26 00:53:07 -06:00
Simon Quigley
a03d1eddb4 Remove reverse-applicable patches. 2019-01-26 00:51:48 -06:00
Simon Quigley
6fc480825e Bump build dependencies. 2019-01-26 00:50:46 -06:00
Simon Quigley
1a2c40c626 Bump debhelper compat to 12, no changes needed. 2019-01-26 00:50:27 -06:00
Simon Quigley
07f9ca0c47 Bump Standards-version to 4.3.0, no changes needed. 2019-01-26 00:50:27 -06:00
Simon Quigley
d5d36c8bef New upstream release. 2019-01-26 00:50:19 -06:00
apt-ghetto
068d5bf369 Strip environment in lxqt-sudo to leave only required environment variables to get into the elevated child process.
Summary: Strip environment variables in lxqt-sudo

Test Plan:
1. Test first with lxqt-sudo from repo: lxqt-sudo env 2> env.txt
2. Install this version
3. Run lxqt-sudo env 2> env2.txt
4. Compare env.txt with env2.txt: diff -y env.txt env2.txt
5. Both files should differ in most environment variables, such as HOME

Reviewers: tsimonq2, wxl

Reviewed By: tsimonq2

Differential Revision: https://phab.lubuntu.me/D44
2018-11-16 16:36:30 -06:00
Simon Quigley
103dd3e937 Upload to Cosmic. 2018-08-20 23:47:52 -05:00
Simon Quigley
1969674069 Fix the layout and line break so text isn't cut off. 2018-08-20 23:47:36 -05:00
Simon Quigley
c366e9f077 Wraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaap. 2018-08-20 23:43:12 -05:00
Simon Quigley
a042a621c8 Bump Standards-version to 4.2.0, no changes needed. 2018-08-20 23:42:22 -05:00
Simon Quigley
3b3bc6aca7 Change Uploaders to Ubuntu uploaders. 2018-08-20 23:41:29 -05:00
Simon Quigley
daba24c205 Upload to Cosmic. 2018-05-22 23:52:45 -05:00
Simon Quigley
91abf69ae0 Update copyright. 2018-05-22 23:02:58 -05:00
Simon Quigley
5fa8c611c0 Update build dependencies. 2018-05-22 22:05:44 -05:00
Simon Quigley
6d8591d0b3 Update Vcs-* and Maintainer to Lubuntu values. 2018-05-22 21:57:00 -05:00
Simon Quigley
6e1893ae42 Remove pristine-tar files. 2018-05-22 21:45:38 -05:00
Simon Quigley
b23b3f7db3 New upstream release. 2018-05-22 21:44:41 -05:00
Alf Gaida
c20a4fbedc Some updates in debian $foo
* Bumped compat to 11
* Bumped debhelper to >= 11~
* Bumped Standards to 4.1.4, no changes needed
* Changed VCS fields for salsa
* Changed Homepage, Source and watch to lxqt
* Bumped years in copyright
* Removed trailing whitespaces from changelog
2018-04-28 16:40:40 +02:00
Alf Gaida
c06992871a Cleanup debian/*
* Bumped Standards to 4.1.2
* Removed branch from VCS fields
* Removed debian/gbp.conf
2017-12-14 23:17:27 +01:00
Alf Gaida
a597a6f13f Transition to unstable 2017-12-05 01:27:19 +01:00
Alf Gaida
ccba626391 Merge branch 'debian/experimental' into debian/sid 2017-12-05 01:25:04 +01:00
Alf Gaida
aaff8c8e50 Cherry-picking upstream version 0.12.0. 2017-12-05 01:24:31 +01:00
Alf Gaida
e6fcba4535 Cherry-picking upstream release 0.12.0.
* Bumped Standards to 4.1.1 - no changes needed
* Bumped liblxqt dependency to >= 0.12.0
2017-10-24 21:33:54 +02:00
Alf Gaida
9060714af9 Improve Recommends and Bump Standards
* Bumped Standards to 4.0.0 - no changes needed
* Added lxqt-qtplugin to Recommends. (Closes: #866345)
2017-07-02 16:17:27 +02:00
Alf Gaida
a1ae3ca293 Cherry-picking upstream release 0.11.1.
* Removed some build dependencies:
  - cmake
  - libqt5xdg-dev
  - libqt5xdgiconloader-dev
  - libx11-dev
  - pkg-config
  - qttools5-dev
  - qttools5-dev-tools
* Bumped build dependency liblxqt0-dev (>= 0.11.1)
* Bumped years in d/copyright
* Fixed d/gbp.conf
2017-01-02 16:54:24 +01:00
Alf Gaida
722ef6deb6 Cherry-picking upstream release 0.11.0
* Synced debian foo with experimental
* Bumped Standards to 3.9.8, no changes needed
* Bumped compat to 10
* Removed --parallel from rules, standard in compat 10
* Bumped minimum version debhelper (>= 10)
* Bumped minimum version liblxqt-dev (>= 0.11.0)
* Bumped minimum version libqtxdg-dev (>= 2.0.0)
* Added build dependency libqt5svg5-dev
* Added build dependency libqt5xdgiconloader-dev
* Added Recommends lxqt-sudo-l10n
* Added README.md to docs
* Fixed VCS fields, using https and plain /git/
* Fixed copyrights Format field to https
* Bumped years in copyrights
* Added translation control to rules
* Set CMAKE_BUILD_TYPE=RelWithDebInfo
* Exported LC_ALL=C.UTF-8, make builds reproducible
2016-10-18 19:54:44 +02:00
Alf Gaida
9875de54b3 Remove dbg package in favor of dbgsym. 2015-12-27 00:00:15 +01:00
ChangZhuo Chen (陳昌倬)
da751f8080 Update changelog 2015-11-15 20:59:43 +08:00
ChangZhuo Chen (陳昌倬)
3400250300 Update Vcs-* fields 2015-11-15 20:58:02 +08:00
ChangZhuo Chen (陳昌倬)
bb2db0ce42 Update gbp.conf 2015-11-15 20:57:47 +08:00
Alf Gaida
0b13958d61 Cherry-picking upstream version 0.10.0.
Set new minimum version for liblxqt.
2015-11-04 23:37:58 +01:00
Alf Gaida
c8542b734a Cherry-picking upstream version 0.9.0+20151029.
set new minimum versions for liblxqt and libqxtg
2015-10-31 11:27:17 +01:00
Alf Gaida
61e287883b Cherry-picking upstream version 0.9.0+20151024. 2015-10-24 14:33:50 +02:00
Alf Gaida
c25900cfc6 Added minimum version for liblxqt0-dev (>= 0.9.0+20150911) 2015-10-07 17:33:34 +02:00
ChangZhuo Chen (陳昌倬)
79abf23032 Add gbp.conf 2015-09-23 20:10:28 +08:00
Alf Gaida
2191e2bfb2 Cherry-picking upstream version 0.9.0+20150908.
Switched to experimental because of LXQt namespace change
2015-09-23 00:06:24 +02:00
Alf Gaida
de2a9821ec merged chanelogs 2015-09-13 17:31:57 +02:00
Alf Gaida
214cd33fd2 Changed mail address of czchen 2015-09-13 13:00:10 +02:00
Alf Gaida
ce8841deb6 Removed stash debris 2015-09-04 01:37:19 +02:00
Alf Gaida
dd07fa57f5 Cherry-picking upstream version 0.9.0+21050831. 2015-09-04 01:31:13 +02:00
Alf Gaida
797df775ea Fixed some debian $foo
Fixed .gitignore
Added upstream signing key and use it in watch file
Added docs
Fixed control with cme fix dpkg-control
2015-09-04 00:29:51 +02:00
Alf Gaida
b4b68735b3 Added some minimum versions for Qt, QtXdg, LXQt 2015-08-28 18:21:06 +02:00
Alf Gaida
731c95ffba added override_dh_auto_install - we should install some binaries 2015-08-28 18:08:13 +02:00
ChangZhuo Chen (陳昌倬)
fce6184dbb Update description 2015-08-22 10:49:30 +08:00
ChangZhuo Chen (陳昌倬)
7793712c56 Fix control, copyright, rules, watch 2015-08-22 10:46:53 +08:00
ChangZhuo Chen (陳昌倬)
77b56f109a Update changelog 2015-08-22 10:39:09 +08:00
ChangZhuo Chen (陳昌倬)
f73998763c Avoid unnecessary dependencies 2015-08-22 10:38:56 +08:00
ChangZhuo Chen (陳昌倬)
e517870567 Merge tag 'upstream/0.9.0+20150822' into debian
Upstream version 0.9.0+20150822

* tag 'upstream/0.9.0+20150822':
  Imported Upstream version 0.9.0+20150822
2015-08-22 10:36:30 +08:00
ChangZhuo Chen (陳昌倬)
478a21fb05 Imported Upstream version 0.9.0+20150822 2015-08-22 10:36:29 +08:00
ChangZhuo Chen (陳昌倬)
8664f1e280 Update changelog 2015-08-22 10:33:01 +08:00
ChangZhuo Chen (陳昌倬)
78d84a4549 Change source format to 3.0 (quilt) 2015-08-22 10:32:38 +08:00
Andrew Lee (李健秋)
3c73ba12a6 Sorting build-depends. 2015-08-21 23:32:15 +08:00
Andrew Lee (李健秋)
3cb531a8d2 Added myself as Uploader. 2015-08-21 23:31:50 +08:00
Alf Gaida
25a49f9a8d Added .gitignore 2015-08-14 01:21:10 +08:00
Alf Gaida
d0b76e2a01 initial commit 2015-08-14 01:21:07 +08:00
26 changed files with 547 additions and 716 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
build

View File

@ -1,84 +0,0 @@
cmake_minimum_required(VERSION 2.8.11)
project(lxqt-sudo)
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(FATAL "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. C++11 support is required")
endif()
find_package(Qt5Widgets REQUIRED QUIET)
find_package(lxqt REQUIRED QUIET)
include(${LXQT_USE_FILE})
include(LXQtTranslate)
include_directories (
${CMAKE_CURRENT_BINARY_DIR}
${LXQT_INCLUDE_DIRS}
)
add_definitions("-DLXQTSUDO_INSTALL_DIR=\"${CMAKE_INSTALL_PREFIX}/bin\""
"-DLXQTSUDO_SUDO=\"sudo\""
"-DLXQTSUDO=\"lxqt-sudo\""
"-DLXQT_VERSION=\"${LXQT_VERSION}\""
)
set ( HDRS
passworddialog.h
)
set ( SRCS
passworddialog.cpp
main.cpp
)
set ( MOCS
passworddialog.h
)
set( UIS
passworddialog.ui
)
qt5_wrap_cpp(MOC_OBJECTS ${MOCS})
qt5_wrap_ui(UI_HEADERS ${UIS})
# Translations **********************************
lxqt_translate_ts(QM_FILES
UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS}
SOURCES
${HDRS}
${SRCS}
${UIS}
INSTALL_DIR
"${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}"
)
lxqt_app_translation_loader(SRCS ${PROJECT_NAME})
#************************************************
add_executable(lxqt-sudo
${SRCS}
${UI_HEADERS}
${MOC_OBJECTS}
${DESKTOP_FILES}
${QM_FILES}
)
target_link_libraries(lxqt-sudo
Qt5::Widgets
${LXQT_LIBRARIES}
)
install(TARGETS lxqt-sudo RUNTIME DESTINATION bin)
install(FILES ${DESKTOP_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
install(FILES man/lxqt-sudo.1 DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1")

6
debian/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/*.debhelper
/*.log
/*.substvars
/files
/lxqt-sudo/

278
debian/changelog vendored Normal file
View File

@ -0,0 +1,278 @@
lxqt-sudo (2.2.0-0ubuntu1) questing; urgency=medium
* New upstream release.
- Update build dependencies.
* Update copyright file.
* Update Standards-Version to 4.7.2, no changes needed.
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Thu, 31 Jul 2025 16:30:59 -0500
lxqt-sudo (2.1.0-0ubuntu3) plucky; urgency=medium
* Update Standards-Version to 4.7.1, no changes needed.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 21 Feb 2025 16:53:25 -0600
lxqt-sudo (2.1.0-0ubuntu2) plucky; urgency=medium
* No-change rebuild for lxqt-build-tools C++17 -> C++20.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 03 Jan 2025 03:59:31 -0600
lxqt-sudo (2.1.0-0ubuntu1) plucky; urgency=medium
* New upstream version.
- Bump build dependencies.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 15 Nov 2024 15:33:17 -0600
lxqt-sudo (2.0.0-0ubuntu2) plucky; urgency=medium
* Update the patch to pass through env vars.
-- Simon Quigley <tsimonq2@ubuntu.com> Wed, 16 Oct 2024 17:09:37 -0500
lxqt-sudo (2.0.0-0ubuntu1) oracular; urgency=medium
* New upstream release.
* Update copyright file.
* Drop enable-bidirectional-communication.patch, applied upstream.
* Bump Standards-Version to 4.7.0, no changes necessary.
* Adjust dependencies.
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Thu, 15 Aug 2024 16:43:15 -0500
lxqt-sudo (1.4.0-0ubuntu2) noble; urgency=medium
* Patch in bidirectional communication support (see
https://github.com/lxqt/lxqt-sudo/pull/210)
* Updated copyright file.
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Thu, 11 Jan 2024 19:26:41 +0000
lxqt-sudo (1.4.0-0ubuntu1) noble; urgency=medium
* New upstream release.
* Bump build dependencies.
* Update copyright years.
-- Simon Quigley <tsimonq2@ubuntu.com> Sun, 12 Nov 2023 19:13:47 -0600
lxqt-sudo (1.3.0-0ubuntu1.1) mantic; urgency=medium
* Add a -E option, exposing all environment variables (LP: #2039093).
-- Simon Quigley <tsimonq2@ubuntu.com> Wed, 11 Oct 2023 12:02:21 -0500
lxqt-sudo (1.3.0-0ubuntu1) mantic; urgency=medium
* New upstream release.
* Bump build dependencies.
* Install new lxqtdoas binary.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 11 Aug 2023 09:51:31 -0500
lxqt-sudo (1.2.0-1ubuntu1) lunar; urgency=medium
* Reverted a sync from Debian.
* Bumped Standards-Version to 4.6.2, no changes necessary.
* Removed obsolete 'override_dh_missing' section from debian/rules.
* Updated copyright file.
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Thu, 16 Feb 2023 20:20:33 -0600
lxqt-sudo (1.2.0-0ubuntu1) lunar; urgency=medium
* New upstream release.
* Fix the watch file, for real this time.
* Lubuntuify the package slightly, to make debhelper happy.
* Bump build dependencies in debian/control.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 18 Nov 2022 18:51:41 -0600
lxqt-sudo (1.1.0-1) experimental; urgency=medium
* New upstream release.
* Removed trailing whitespace from changelog.
* Ran wrap-and-sort.
* Upstreamed packaging changes from Ubuntu, modifying the following files:
- control
- copyright
- rules
- upstream/*
-- Aaron Rainbolt <arraybolt3@gmail.com> Wed, 13 Jul 2022 19:57:33 -0500
lxqt-sudo (0.16.0-1) unstable; urgency=medium
[ Alf Gaida ]
* Switched to gbp
* Bumped Standards-Version to 4.4.0, no changes needed
[ Andrew Lee (李健秋) ]
* New upstream release. (Closes: #978214)
-- Andrew Lee (李健秋) <ajqlee@debian.org> Wed, 06 Jan 2021 18:17:56 +0800
lxqt-sudo (0.14.1-2) unstable; urgency=medium
* Set HOME right, don't strip TERM (Closes: #928941)
-- Alf Gaida <agaida@siduction.org> Mon, 13 May 2019 19:56:39 +0200
lxqt-sudo (0.14.1-1) unstable; urgency=medium
* Cherry-picking new upstream version 0.14.1.
* Bumped minimum version liblxqt0-dev (>= 0.14.1~)
* Extended package description a bit
-- Alf Gaida <agaida@siduction.org> Sun, 24 Feb 2019 22:25:49 +0100
lxqt-sudo (0.14.0-1) unstable; urgency=medium
* Cherry-picking new upstream version 0.14.0.
* Bumped Standards to 4.3.0, no changes needed
* Dropped d/compat, use debhelper-compat = 12, no changes needed
* Fixed years in d/copyright
* Bumped minimum version liblxqt0-dev (>= 0.14.0~)
* Removed obsolete PULL_TRANSLATIONS= OFF from dh_auto_configure
* Added l10n-package, moved from lxqt-l10n
* Added d/upstream/metadata
-- Alf Gaida <agaida@siduction.org> Sun, 27 Jan 2019 19:32:15 +0100
lxqt-sudo (0.13.0-1) unstable; urgency=medium
* Cherry-picking new upstream version 0.13.0.
* Bumped build dependency liblxqt0-dev to >= 0.13.0~
* Bumped year in copyright
-- Alf Gaida <agaida@siduction.org> Fri, 25 May 2018 00:02:41 +0200
lxqt-sudo (0.12.0-4) unstable; urgency=medium
* Bumped compat to 11
* Bumped debhelper to >= 11~
* Bumped Standards to 4.1.4, no changes needed
* Changed VCS fields for salsa
* Changed Homepage, Source and watch to lxqt
* Bumped years in copyright
* Removed trailing whitespaces from changelog
-- Alf Gaida <agaida@siduction.org> Sat, 28 Apr 2018 16:40:26 +0200
lxqt-sudo (0.12.0-3) unstable; urgency=medium
* Bumped Standards to 4.1.2
* Removed branch from VCS fields
* Removed debian/gbp.conf
-- Alf Gaida <agaida@siduction.org> Thu, 14 Dec 2017 23:17:19 +0100
lxqt-sudo (0.12.0-2) unstable; urgency=medium
* Transition to unstable
-- Alf Gaida <agaida@siduction.org> Tue, 05 Dec 2017 01:26:56 +0100
lxqt-sudo (0.12.0-1) experimental; urgency=medium
* Cherry-picking upstream release 0.12.0.
* Bumped Standards to 4.1.1 - no changes needed
* Bumped liblxqt dependency to >= 0.12.0
-- Alf Gaida <agaida@siduction.org> Tue, 24 Oct 2017 21:33:45 +0200
lxqt-sudo (0.11.1-2) unstable; urgency=medium
* Bumped Standards to 4.0.0 - no changes needed
* Added lxqt-qtplugin to Recommends. (Closes: #866345)
-- Alf Gaida <agaida@siduction.org> Sun, 02 Jul 2017 16:17:20 +0200
lxqt-sudo (0.11.1-1) unstable; urgency=medium
* Cherry-picking upstream release 0.11.1.
* Removed some build dependencies:
- cmake
- libqt5xdg-dev
- libqt5xdgiconloader-dev
- libx11-dev
- pkg-config
- qttools5-dev
- qttools5-dev-tools
* Bumped build dependency liblxqt0-dev (>= 0.11.1)
* Bumped years in d/copyright
* Fixed d/gbp.conf
-- Alf Gaida <agaida@siduction.org> Mon, 02 Jan 2017 16:54:12 +0100
lxqt-sudo (0.11.0-2) unstable; urgency=medium
* Cherry-picking upstream release 0.11.0
* Synced debian foo with experimental
* Bumped Standards to 3.9.8, no changes needed
* Bumped compat to 10
* Removed --parallel from rules, standard in compat 10
* Bumped minimum version debhelper (>= 10)
* Bumped minimum version liblxqt-dev (>= 0.11.0)
* Bumped minimum version libqtxdg-dev (>= 2.0.0)
* Added build dependency libqt5svg5-dev
* Added build dependency libqt5xdgiconloader-dev
* Added Recommends lxqt-sudo-l10n
* Added README.md to docs
* Fixed VCS fields, using https and plain /git/
* Fixed copyrights Format field to https
* Bumped years in copyrights
* Added translation control to rules
* Set CMAKE_BUILD_TYPE=RelWithDebInfo
* Exported LC_ALL=C.UTF-8, make builds reproducible
-- Alf Gaida <agaida@siduction.org> Tue, 18 Oct 2016 19:54:08 +0200
lxqt-sudo (0.10.0-3) unstable; urgency=medium
* Remove dbg package in favor of dbgsym.
-- Alf Gaida <agaida@siduction.org> Sun, 27 Dec 2015 00:00:04 +0100
lxqt-sudo (0.10.0-2) unstable; urgency=medium
* Merge to unstable.
-- ChangZhuo Chen (陳昌倬) <czchen@debian.org> Sun, 15 Nov 2015 20:58:46 +0800
lxqt-sudo (0.10.0-1) experimental; urgency=medium
* Cherry-picking upstream version 0.10.0.
* Set minimum version for liblxqt.
-- Alf Gaida <agaida@siduction.org> Tue, 03 Nov 2015 02:29:04 +0100
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 <agaida@siduction.org> Sat, 31 Oct 2015 11:26:51 +0100
lxqt-sudo (0.9.0+20150908-2) experimental; urgency=medium
* Added minimum version for liblxqt0-dev (>= 0.9.0+20150911)
-- Alf Gaida <agaida@siduction.org> Wed, 07 Oct 2015 17:33:24 +0200
lxqt-sudo (0.9.0+20150908-1) experimental; urgency=medium
[ Alf Gaida ]
* Cherry-picked upstream version 0.9.0+20150908.
* Fixed .gitignore
* Added upstream signing key and use it in watch file
* Added docs
* Fixed control with cme fix dpkg-control
* Switched to experimental because of LXQt namespace change
[ ChangZhuo Chen (陳昌倬) ]
* Initial release (Closes:#795801)
-- Alf Gaida <agaida@siduction.org> Wed, 23 Sep 2015 00:06:05 +0200

43
debian/control vendored Normal file
View File

@ -0,0 +1,43 @@
Source: lxqt-sudo
Maintainer: Lubuntu Developers <lubuntu-devel@lists.ubuntu.com>
Original-Maintainer: LXQt Packaging Team <pkg-lxqt-devel@lists.alioth.debian.org>
Uploaders: Alf Gaida <agaida@siduction.org>,
ChangZhuo Chen (陳昌倬) <czchen@debian.org>,
Andrew Lee (李健秋) <ajqlee@debian.org>,
Simon Quigley <tsimonq2@debian.org>,
Aaron Rainbolt <arraybolt3@gmail.com>
Section: x11
Priority: optional
Build-Depends: debhelper-compat (= 13),
libkf6windowsystem-dev,
liblxqt2-dev (>= 2.2.0),
libx11-dev,
qt6-svg-dev (>= 6.6.0)
Standards-Version: 4.7.2
Vcs-Browser: https://git.lubuntu.me/Lubuntu/lxqt-sudo-packaging
Vcs-Git: https://git.lubuntu.me/Lubuntu/lxqt-sudo-packaging.git
Debian-Vcs-Browser: https://salsa.debian.org/cgit/pkg-team/lxqt-sudo
Debian-Vcs-Git: https://salsa.debian.org/lxqt-team/lxqt-sudo.git
Homepage: https://github.com/lxqt/lxqt-sudo
Rules-Requires-Root: no
Package: lxqt-sudo
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Recommends: lxqt-qtplugin, lxqt-sudo-l10n
Description: Graphical Qt frontend for plain sudo
lxqt-sudo is a graphical Qt frontend for plain sudo(8) (for requesting
optional password in GUI fashion). When invoked it simply spawns child sudo
process with requested command (and arguments). If sudo requests user's
password, the GUI password dialog is shown and (after submit) the password is
provided to sudo.
Package: lxqt-sudo-l10n
Architecture: all
Multi-Arch: foreign
Section: localization
Depends: qt6-translations-l10n, ${misc:Depends}
Description: Language package for lxqt-sudo
The l10n files for lxqt-sudo.
.
This package contains the l10n files needed by lxqt-sudo.

31
debian/copyright vendored Normal file
View File

@ -0,0 +1,31 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: lxqt-sudo
Source: https://github.com/lxqt/lxqt-sudo
Files: *
Copyright: 2015-2025 LXQt team
2015-2018 Palo Kisa <palo.kisa@gmail.com>
License: LGPL-2.1+
Files: debian/*
Copyright: 2021-2025 Lubuntu Developers <lubuntu-devel@lists.ubuntu.com>
2015-2019 Alf Gaida <agaida@siduction.org>
2015 Andrew Lee (李健秋) <ajqlee@debian.org>
2015 ChangZhuo Chen (陳昌倬) <czchen@debian.org>
2025 Aaron Rainbolt <arraybolt3@ubuntu.com>
License: LGPL-2.1+
License: LGPL-2.1+
This program or library is free software; you can redistribute it
and/or modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
.
On Debian systems, the complete text of the GNU Lesser General
Public License version 2.1 can be found in
"/usr/share/common-licenses/LGPL-2.1".

2
debian/docs vendored Normal file
View File

@ -0,0 +1,2 @@
AUTHORS
README.md

6
debian/gbp.conf vendored Normal file
View File

@ -0,0 +1,6 @@
[DEFAULT]
debian-branch = debian/sid
upstream-branch = upstream/latest
pristine-tar = True
compression = xz

1
debian/lxqt-sudo-l10n.install vendored Normal file
View File

@ -0,0 +1 @@
usr/share/lxqt/translations/lxqt-sudo

8
debian/lxqt-sudo.install vendored Normal file
View File

@ -0,0 +1,8 @@
usr/bin/lxdoas
usr/bin/lxqt-sudo
usr/bin/lxsu
usr/bin/lxsudo
usr/share/man/man1/lxdoas.1
usr/share/man/man1/lxqt-sudo.1
usr/share/man/man1/lxsu.1
usr/share/man/man1/lxsudo.1

View File

@ -0,0 +1,82 @@
Description: Add a -E option, exposing all environment variables
Some system tools (such as ubuntu-release-upgrader) read XDG* (etc.), so allow the user to opt-in to preserving those.
Author: Simon Quigley <tsimonq2@lubuntu.me>
Origin: upstream
Forwarded: https://github.com/lxqt/lxqt-sudo/pull/204
Last-Update: 2023-10-11
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/sudo.cpp
+++ b/sudo.cpp
@@ -84,6 +84,7 @@ namespace
" -s|--su Use %3(1) as backend.\n"
" -d|--sudo Use %2(8) as backend.\n"
" -a|--doas Use %4(1) as backend.\n"
+ " -E|--keep-env Preserve all existing environment variables.\n"
" command Command to run.\n"
" arguments Optional arguments for command.\n\n").arg(app_master).arg(sudo_prog).arg(su_prog).arg(doas_prog);
if (!err.isEmpty())
@@ -114,8 +115,13 @@ namespace
};
assert_helper h;
- inline std::string env_workarounds()
+ inline std::string env_workarounds(bool preserveEnv)
{
+ if (preserveEnv) {
+ std::cerr << LXQTSUDO << ": Preserving all environment variables.\n";
+ return "";
+ }
+
std::cerr << LXQTSUDO << ": Stripping child environment except for: ";
std::ostringstream left_env_params;
std::copy(ALLOWED_VARS, ALLOWED_END - 1, std::ostream_iterator<const char *>{left_env_params, ","});
@@ -196,6 +202,10 @@ int Sudo::main()
{
mBackend = BACK_DOAS;
mArgs.removeAt(0);
+ } else if (QStringLiteral("-E") == arg1 || QStringLiteral("--keep-env") == arg1)
+ {
+ mPreserveEnv = true;
+ mArgs.removeAt(0);
}
}
//any other arguments we simply forward to su/sudo
@@ -287,11 +297,13 @@ void Sudo::child()
switch (mBackend)
{
case BACK_SUDO:
- preserve_env_param = "--preserve-env=";
-
- preserve_env_param += env_workarounds();
-
- *(param_arg++) = preserve_env_param.c_str(); //preserve environment
+ if(!mPreserveEnv) {
+ preserve_env_param = "--preserve-env=";
+ preserve_env_param += env_workarounds(mPreserveEnv);
+ } else {
+ preserve_env_param = "--preserve-env";
+ }
+ *(param_arg++) = preserve_env_param.c_str();
*(param_arg++) = "/bin/sh";
break;
case BACK_DOAS:
@@ -299,7 +311,7 @@ void Sudo::child()
[[fallthrough]];
case BACK_SU:
case BACK_NONE:
- env_workarounds();
+ env_workarounds(mPreserveEnv);
break;
}
--- a/sudo.h
+++ b/sudo.h
@@ -81,6 +81,7 @@ private:
int mChildPid;
int mPwdFd;
int mRet;
+ bool mPreserveEnv = false;
};
#endif //SUDO_H

1
debian/patches/series vendored Normal file
View File

@ -0,0 +1 @@
bypass-envvar-allowlist.patch

13
debian/rules vendored Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/make -f
# export DH_VERBOSE=1
export LC_ALL=C.UTF-8
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh ${@} --buildsystem cmake
override_dh_auto_configure:
dh_auto_configure -- \
-DUPDATE_TRANSLATIONS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo

12
debian/salsa-ci.yml vendored Normal file
View File

@ -0,0 +1,12 @@
# For more information on what jobs are run see:
# https://salsa.debian.org/salsa-ci-team/pipeline
#
# To enable the jobs, go to your repository (at salsa.debian.org)
# and click over Settings > CI/CD > Expand (in General pipelines).
# In "Custom CI config path" write debian/salsa-ci.yml and click
# in "Save Changes". The CI tests will run after the next commit.
---
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

1
debian/source/options vendored Normal file
View File

@ -0,0 +1 @@
tar-ignore=.gitignore

5
debian/upstream/metadata vendored Normal file
View File

@ -0,0 +1,5 @@
Name: lxqt-sudo
Bug-Database: https://github.com/lxqt/lxqt-sudo/issues
Bug-Submit: https://github.com/lxqt/lxqt-sudo/issues/new
Changelog: https://github.com/lxqt/lxqt-sudo/blob/master/CHANGELOG
Repository: https://github.com/lxqt/lxqt-sudo

52
debian/upstream/signing-key.asc vendored Normal file
View File

@ -0,0 +1,52 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
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
sw==
=gSIv
-----END PGP PUBLIC KEY BLOCK-----

5
debian/watch vendored Normal file
View File

@ -0,0 +1,5 @@
version=4
opts="searchmode=plain, \
pgpsigurlmangle=s/$/.asc/, \
uversionmangle=s/(\d+\.\d+\.\d+).*/$1/" \
https://api.github.com/repos/lxqt/@PACKAGE@/releases https:\/\/github.com\/lxqt\/@PACKAGE@\/releases\/download\/@ANY_VERSION@\/@PACKAGE@-@ANY_VERSION@.tar.xz

193
main.cpp
View File

@ -1,193 +0,0 @@
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXQt - a lightweight, Qt based, desktop toolset
* http://lxqt.org
*
* Copyright: 2015 LXQt team
* Authors:
* Palo Kisa <palo.kisa@gmail.com>
*
* This program or library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* END_COMMON_COPYRIGHT_HEADER */
#include <LXQt/Application>
#include "passworddialog.h"
#include <QFileInfo>
#include <QDir>
#include <QProcess>
#include <QTimer>
#include <QMessageBox>
#include <QSocketNotifier>
#include <signal.h>
#include <sstream>
#include <QDebug>
const QString app_master{QStringLiteral(LXQTSUDO)};
const QString app_version{QStringLiteral(LXQT_VERSION)};
const QString install_dir{QStringLiteral(LXQTSUDO_INSTALL_DIR)};
const QString sudo_prog{QStringLiteral(LXQTSUDO_SUDO)};
const QString sudo_pwd_prompt{QStringLiteral("Password:\n")};
void termSignalHandler(int signal)
{
if (QApplication::instance())
QApplication::instance()->quit();
}
void usage(QString const & err = QString())
{
if (!err.isEmpty())
QTextStream(stderr) << err << '\n';
QTextStream(stdout)
<< QObject::tr("Usage: %1 command [arguments...]\n\n"
"GUI frontend for %2\n\n"
"Arguments:\n"
" command Command to run.\n"
" arguments Optional arguments for command.\n\n").arg(app_master).arg(sudo_prog);
if (!err.isEmpty())
QMessageBox(QMessageBox::Critical, app_master, err, QMessageBox::Ok).exec();
}
void version()
{
QTextStream(stdout)
<< QObject::tr("%1 version %2\n").arg(app_master).arg(app_version);
}
int master(int argc, char **argv)
{
//master
LxQt::Application app(argc, argv);
app.setQuitOnLastWindowClosed(false);
if (1 >= argc)
{
usage(QObject::tr("%1: no command to run provided!").arg(app_master));
return 1;
} else
{
//simple help check
std::string arg1(argv[1]);
if ("-h" == arg1 || "--help" == arg1)
{
usage();
return 0;
} else if ("-v" == arg1 || "--version" == arg1)
{
version();
return 0;
}
//any other arguments we simply forward to sudo
}
QStringList args = app.arguments();
//check for provided command is done before
args.removeAt(0);
PasswordDialog dlg(args);
dlg.setModal(true);
app.setActiveWindow(&dlg);
QScopedPointer<QProcess> sudo{new QProcess};
QObject::connect(&dlg, &QDialog::finished, [&sudo, &dlg] (int result)
{
if (QDialog::Accepted == result)
{
sudo->write(QByteArray{}.append(dlg.password().append('\n')));
} else
{
sudo->terminate();
if (!sudo->waitForFinished(1000))
sudo->kill();
}
});
//start background process -> sudo
sudo->setProcessChannelMode(QProcess::ForwardedOutputChannel);
sudo->setReadChannel(QProcess::StandardError);
QString last_line;
int ret;
QObject::connect(sudo.data(), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished)
, [&app, &ret, &last_line, &dlg] (int exitCode, QProcess::ExitStatus exitStatus)
{
ret = QProcess::NormalExit == exitStatus ? exitCode : 255;
if (0 != ret && last_line.startsWith(QStringLiteral("%1:").arg(sudo_prog)))
QMessageBox(QMessageBox::Critical, dlg.windowTitle()
, QObject::tr("Child '%1' process failed!\n%2").arg(sudo_prog).arg(last_line), QMessageBox::Ok).exec();
app.quit();
});
QObject::connect(sudo.data(), &QProcess::readyReadStandardError, [&sudo, &dlg, &last_line]
{
QByteArray err = sudo->readAllStandardError();
if (sudo_pwd_prompt == err.constData())
{
dlg.show();
return;
}
QTextStream{stderr, QIODevice::WriteOnly} << err;
int nl_pos = err.lastIndexOf('\n');
if (-1 == nl_pos)
last_line += err;
else
{
if (err.endsWith('\n'))
err.remove(err.size() - 1, 1);
nl_pos = err.lastIndexOf('\n');
if (-1 != nl_pos)
err.remove(0, nl_pos + 1);
last_line = err;
}
});
//forward all stdin to child
QTextStream std_in{stdin, QIODevice::ReadOnly};
QSocketNotifier stdin_watcher{0/*stdin*/, QSocketNotifier::Read};
QObject::connect(&stdin_watcher, &QSocketNotifier::activated, [&std_in, &sudo]
{
QString line{std_in.readLine()};
if (!std_in.atEnd())
line += QLatin1Char('\n');
sudo->write(line.toStdString().c_str());
if (std_in.atEnd())
sudo->closeWriteChannel();
});
sudo->start(sudo_prog, QStringList() << QStringLiteral("-S")
<< QStringLiteral("-p") << sudo_pwd_prompt
<< args);
app.exec();
sudo->waitForFinished(-1);
return ret;
}
int main(int argc, char **argv)
{
// Quit gracefully
::signal(SIGALRM, termSignalHandler);
::signal(SIGTERM, termSignalHandler);
::signal(SIGINT, termSignalHandler);
::signal(SIGQUIT, termSignalHandler);
::signal(SIGHUP, termSignalHandler);
::signal(SIGSTOP, termSignalHandler);
::signal(SIGTSTP, termSignalHandler);
return master(argc, argv);
}

View File

@ -1,17 +0,0 @@
.TH lxqt-sudo 1 "" "" "LXQt\ Module"
.SH NAME
\fBlxqt-sudo\fR \- execute a command as privileged user
.SH SYNOPSIS
\fBlxqt-sudo\fR \fIcommand\fR [\fIarguments\fR]
.SH DESCRIPTION
\fBlxqt-sudo\fR is a graphical QT frontend for plain \fBsudo(8)\fR (for requesting optional password in GUI fashion).
.br
When invoked it simply spawns child \fIsudo\fR process with requested \fIcommand\fR (and \fIarguments\fR). If \fIsudo\fR requests user's password,
the GUI password dialog is shown and (after submit) the password is provided to \fIsudo\fR.
.SH "REPORTING BUGS"
Report bugs to https://github.com/lxde/lxqt/issues
.SH "SEE ALSO"
\fBsudo(8)\fR
.SH AUTHOR
This manual page was created by \fBPalo Kisa\fR \fI<palo.kisa@gmail.com>\fR
for \fBLXQt\fR project.

View File

@ -1,62 +0,0 @@
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXQt - a lightweight, Qt based, desktop toolset
* http://lxqt.org
*
* Copyright: 2015 LXQt team
* Authors:
* Palo Kisa <palo.kisa@gmail.com>
*
* This program or library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* END_COMMON_COPYRIGHT_HEADER */
#include "passworddialog.h"
#include "ui_passworddialog.h"
PasswordDialog::PasswordDialog(QStringList argv
, QWidget * parent/* = 0*/
, Qt::WindowFlags f/* = 0*/)
: QDialog(parent, f)
, ui(new Ui::PasswordDialog)
{
ui->setupUi(this);
ui->commandL->setText(argv.join(QStringLiteral(" ")));
QString cmd;
if (0 < argv.size())
cmd = argv[0];
ui->descriptionL->setText(tr("<b>%1</b> needs administrative privileges.\nPlease enter your password.").arg(cmd));
ui->iconL->setPixmap(QIcon::fromTheme("dialog-password").pixmap(64, 64));
setWindowIcon(QIcon::fromTheme("security-high"));
}
PasswordDialog::~PasswordDialog()
{
}
void PasswordDialog::showEvent(QShowEvent * event)
{
ui->errorL->setText(tr("Attempt #%1").arg(++mAttempt));
return QDialog::showEvent(event);
}
QString PasswordDialog::password() const
{
return ui->passwordLE->text();
}

View File

@ -1,59 +0,0 @@
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXQt - a lightweight, Qt based, desktop toolset
* http://lxqt.org
*
* Copyright: 2015 LXQt team
* Authors:
* Palo Kisa <palo.kisa@gmail.com>
*
* This program or library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* END_COMMON_COPYRIGHT_HEADER */
#ifndef PASSWORDDIALOG_H
#define PASSWORDDIALOG_H
#include <QDialog>
namespace Ui {
class PasswordDialog;
}
class Communication;
class QProcess;
class PasswordDialog : public QDialog
{
Q_OBJECT
public:
PasswordDialog(QStringList argv
, QWidget * parent = 0
, Qt::WindowFlags f = 0);
~PasswordDialog();
virtual void showEvent(QShowEvent * event) override;
QString password() const;
private:
QScopedPointer<Ui::PasswordDialog> ui;
int mAttempt = 0;
};
#endif // PASSWORDDIALOG_H

View File

@ -1,151 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PasswordDialog</class>
<widget class="QDialog" name="PasswordDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>200</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>LXQt sudo</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" rowspan="2" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QLabel" name="iconL">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1" alignment="Qt::AlignVCenter">
<widget class="QLabel" name="descriptionL">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="errorL">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="commandL">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="descCommandL">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Command:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="descPasswordL">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="passwordLE">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>PasswordDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>PasswordDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>PasswordDialog</name>
<message>
<location filename="../passworddialog.ui" line="20"/>
<location filename="../build/ui_passworddialog.h" line="129"/>
<source>LXQt sudo</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../passworddialog.ui" line="77"/>
<location filename="../build/ui_passworddialog.h" line="134"/>
<source>Command:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../passworddialog.ui" line="84"/>
<location filename="../build/ui_passworddialog.h" line="135"/>
<source>Password:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../passworddialog.cpp" line="43"/>
<source>&lt;b&gt;%1&lt;/b&gt; needs administrative privileges.
Please enter your password.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../passworddialog.cpp" line="54"/>
<source>Attempt #%1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../main.cpp" line="57"/>
<source>Usage: %1 command [arguments...]
GUI frontend for %2
Arguments:
command Command to run.
arguments Optional arguments for command.
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main.cpp" line="69"/>
<source>%1 version %2
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main.cpp" line="80"/>
<source>%1: no command to run provided!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main.cpp" line="131"/>
<source>Child &apos;%1&apos; process failed!
%2</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -1,80 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>PasswordDialog</name>
<message>
<location filename="../passworddialog.ui" line="20"/>
<location filename="../build/ui_passworddialog.h" line="129"/>
<source>LXQt sudo</source>
<translation>LXQt sudo</translation>
</message>
<message>
<location filename="../passworddialog.ui" line="77"/>
<location filename="../build/ui_passworddialog.h" line="134"/>
<source>Command:</source>
<translation>Príkaz:</translation>
</message>
<message>
<location filename="../passworddialog.ui" line="84"/>
<location filename="../build/ui_passworddialog.h" line="135"/>
<source>Password:</source>
<translation>Heslo:</translation>
</message>
<message>
<location filename="../passworddialog.cpp" line="43"/>
<source>&lt;b&gt;%1&lt;/b&gt; needs administrative privileges.
Please enter your password.</source>
<translation>&lt;b&gt;%1&lt;/b&gt; vyžaduje práva administrátora.
Prosím, zadajte svoje heslo.</translation>
</message>
<message>
<location filename="../passworddialog.cpp" line="54"/>
<source>Attempt #%1</source>
<translation>Pokus č. %1</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../main.cpp" line="57"/>
<source>Usage: %1 command [arguments...]
GUI frontend for %2
Arguments:
command Command to run.
arguments Optional arguments for command.
</source>
<translation>Použitie: %1 command [arguments...]
GUI frontend pre %2
Parametre:
command Príkaz na spustenie.
arguments Parametre príkazu.
</translation>
</message>
<message>
<location filename="../main.cpp" line="69"/>
<source>%1 version %2
</source>
<translation>%1 verzia %2
</translation>
</message>
<message>
<location filename="../main.cpp" line="80"/>
<source>%1: no command to run provided!</source>
<translation>%1: žiaden príkaz na spustenie!</translation>
</message>
<message>
<location filename="../main.cpp" line="131"/>
<source>Child &apos;%1&apos; process failed!
%2</source>
<translation>Dcérsky &apos;%1&apos; process zlyhal!
%2</translation>
</message>
</context>
</TS>