...
 
Commits (82)
build
debian/*.log
debian/*.substvars
debian/files
debian/.debhelper/
debian/debhelper-build-stamp
debian/lxqt-policykit/
debian/lxqt-policykit-l10n/
debian/tmp/
obj-x86_64-linux-gnu/
Upstream Authors:
LXQt team: http://lxqt.org
LXQt team: https://lxqt.org
Razor team: http://razor-qt.org
Copyright:
Copyright (c) 2010-2012 Razor team
Copyright (c) 2012-2014 LXQt team
Copyright (c) 2012-2017 LXQt team
License: GPL-2 and LGPL-2.1+
License: LGPL-2.1+
The full text of the licenses can be found in the 'COPYING' file.
lxqt-policykit-0.14.1 / 2019-02-25
==================================
* Bumped version to 0.14.1
* Only translations was changed.
lxqt-policykit-0.14.0 / 2019-01-25
==================================
* Bumped version to 0.14.0
* Don't use automatic string conversions
* Improved cmake scripting
- Set cmake_minimum_required to 3.1.0
- Use POLKIT_AGENT_LDFLAGS instead of use POLKIT_AGENT_LIBRARIES
- Removed locale compile definitons
- Installed man page
* Moved translations from lxqt-l10n back to lxqt-policykit
- Removed obsolete translation fuctionality
- Added translation promo in README.md
* Translation updates
* Deleted superfluous *cs_CZ.desktop files
lxqt-policykit-0.13.0 / 2018-05-21
==================================
* CMake: Prevent in-source builds
* fix razor-qt -> lxqt and http -> https
* Fixed some LXDE mentions
* Drop Qt foreach
lxqt-policykit-0.12.0 / 2017-10-21
==================================
* Release 0.12.0: Update changelog
* Set patch version
* Don't export github templates
* Updated Lithuanian translation
* Drops Qt5Core_VERSION_STRING
* Added QCommandLineParser and basic cli interface to lxqt-policykit-agent
* Added default CMAKE_BUILD_TYPE and LXQT_POLKITAGENT_PATCH_VERSION
* Fixes a FTBFS in superbuild mode
* Added merged autostart to CMakeLists.txt
* Updated *_da.desktop files and removed *_da_DK.desktop files
* Update desktop entries and Replace fr_FR by fr
* Update Greek translation (el) Remove country variant from language code
* CMake: Adds Runtime and Devel install COMPONENTs
* Coding style changes
* Updates the build system to use the Targets infrastructure
* Drops hardcoded /etc/xdg paths
* Updated german translation, replaced Qt4 by Qt in all xsession/translations
* Updates translations infrastructure
* Update the required minimum cmake version
* remove dead template lines switch OnlyShowIn from Razor -> LXQt stringchanges LxQt -> LXQt
* Support lxqt-session and add necessary xdg autostart desktop entry files.
* Fix typo and correct some sentences
* Fixed some more typos
* Bump year
lxqt-policykit-0.11.1 / 2017-01-01
==================================
* Release 0.11.1: Update changelog
* Make CMakeLists.txt more uniform.
* Remove cpack (#25)
lxqt-policykit-0.11.0 / 2016-09-24
==================================
* Release 0.11.0: Add changelog
* agentGui: Use default icon
* agentGui: Choose current user in identities combo
* agentGui: Handle setting the prompt correctly
* agent: Handle multiple identities correctly
* Update README.md
* Fixed typo prefered -> preferred
* Add README.md
* build: Use external translations
* ts-files removal (#21)
* Bump year in AUTHORS
* Italian translation update
* Updated Russian translation Removed ru_RU file
* update: lxqt-policykit-agent_hu.ts
lxqt-policykit-0.10.0 / 2015-10-31
==================================
* Update translations
* Fix license file
* GPL2 not used - removed in AUTHORS Fixed link to Github LXQt issues Fix wording in manpage - 'can be used by others' was nuts for a file under LGPL root license
* Add Greek (el) translation
* Rename LxQt to LXQt everywhere
* Added german translation.
* Added missing tr() call.
* Handles CMake policy CMP0063
* Use the LXQtCompilerSettings CMake module
* Adds Runtime install COMPONENT
* Use GNUInstallDirs
* Removes unneede entries from include_directories()
* Uses CMAKE_AUTOUIC
* Updates the build system to use the Targets infrastructure
* Remove trailing whitespaces
* Fix naming and links
* Hungarian translation
* - Add a choice option for install binary. Some distributions use libexec instead os default usr/bin installs. It defauls to bin
lxqt-policykit-0.9.0 / 2015-01-19
=================================
* File name was ok but language name wasn´t. My mistake.
* Makes filename match translation language
* Portuguese update
* - Unify naming for a unique lxqt. No more suffixes
* CMakeLists.txt maintenance.
* Uses the new translations cmake modules
* Add Russian translation
* CMakeLists.txt cleanups
lxqt-policykit-0.8.0 / 2014-06-28
=================================
* Use portable Polkit headers
* Deal with a bug in polkit-qt1 cmake file
* Choose Qt5 version of PolkitQt when build with Qt5.
* Add initial Qt5 support.
* Use new LXQt header files.
lxqt-policykit-0.7.0 / 2014-05-01
=================================
* Update AUTHORS and COPYING files
* Add CPack rules for creating tarball
* Removed CMAKE_SOURCE_DIR usage from CMakeLists.txt
* Fix renaming bugs, replacing lxqt-qt with lxde-qt
* Finish the crazy razor=>lxqt renaming tasks.
* Rename binary to lxqt-policykit-agent and migrate to the latest liblxqt.
* Add COPYING and AUTHORS
* Fix authentization->authentication misspelling
* Trtanslations
* Translation support for policykit agent
* preliminary manpages primary for razorqt and usefully in venenux
* Add build option to make policykit optional, even if installed.
* RazorApplication class implemented; all modules ported to this class
* Relicense
* initial but finally working policykit integration (agent)
* initial revision of the policykit integration (non-functional)
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
# CMP0000: Call the cmake_minimum_required() command at the beginning of the top-level
# CMakeLists.txt file even before calling the project() command.
# The cmake_minimum_required(VERSION) command implicitly invokes the cmake_policy(VERSION)
# command to specify that the current project code is written for the given range of CMake
# versions.
project(lxqt-policykit-agent)
include(GNUInstallDirs)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
find_package(PkgConfig)
pkg_check_modules(POLKIT_AGENT REQUIRED polkit-agent-1)
message(STATUS "polkit agent: ${POLKIT_AGENT_INCLUDE_DIRS} ${POLKIT_AGENT_LIBRARIES}")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_AUTOMOC ON)
set(POLKIT_AGENT_BINARY_DIR "${CMAKE_INSTALL_BINDIR}" CACHE FILEPATH "Directory for install polkit agent")
# Minumum Versions
set(LXQT_MINIMUM_VERSION "0.14.1")
set(QT_MINIMUM_VERSION "5.7.1")
find_package(Qt5LinguistTools ${QT_MINIMUM_VERSION} REQUIRED)
find_package(Qt5Widgets ${QT_MINIMUM_VERSION} REQUIRED)
find_package(lxqt ${LXQT_MINIMUM_VERSION} REQUIRED)
find_package(PolkitQt5-1 REQUIRED)
find_package(Qt5Widgets REQUIRED QUIET)
find_package(Qt5LinguistTools REQUIRED QUIET)
find_package(lxqt REQUIRED QUIET)
find_package(qt5xdg REQUIRED QUIET)
message(STATUS "Building with Qt${Qt5Core_VERSION}")
include(${LXQT_USE_FILE})
include(${QTXDG_USE_FILE})
# Patch Version
set(LXQT_POLKITAGENT_PATCH_VERSION 1)
include(LXQtTranslate)
set(LXQT_POLKITAGENT_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_POLKITAGENT_PATCH_VERSION})
add_definitions(
"-DLXQT_POLKITAGENT_VERSION=\"${LXQT_POLKITAGENT_VERSION}\""
)
include(LXQtPreventInSourceBuilds)
include(LXQtCompilerSettings NO_POLICY_SCOPE)
# Deal with a bug in polkit-qt5
if (NOT IS_ABSOLUTE "${POLKITQT-1_INCLUDE_DIR}")
......@@ -37,8 +57,6 @@ message(STATUS " include: ${POLKITQT-1_INCLUDE_DIR}")
# pkg-config --cflags glib-2.0
# pkg-config --cflags polkit-agent-1
include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}/src"
"${CMAKE_CURRENT_BINARY_DIR}"
${POLKIT_AGENT_INCLUDE_DIRS}
"${POLKITQT-1_INCLUDE_DIR}"
)
......@@ -58,7 +76,9 @@ set(lxqt-policykit-agent_UI
src/policykitagentgui.ui
)
# Translations
# Translations **********************************
include(LXQtTranslate)
lxqt_translate_ts(lxqt-policykit-agent_QM_FILES
UPDATE_TRANSLATIONS
${UPDATE_TRANSLATIONS}
......@@ -71,35 +91,42 @@ lxqt_translate_ts(lxqt-policykit-agent_QM_FILES
)
lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME})
qt5_wrap_ui(lxqt-policykit-agent_UI_CPP ${lxqt-policykit-agent_UI})
#************************************************
add_executable(lxqt-policykit-agent
${lxqt-policykit-agent_SRCS}
${lxqt-policykit-agent_MOCS}
${lxqt-policykit-agent_UI_CPP}
${lxqt-policykit-agent_QM_FILES}
${QM_LOADER}
)
target_compile_definitions(lxqt-policykit-agent
PRIVATE
"QT_USE_QSTRINGBUILDER"
"QT_NO_CAST_FROM_ASCII"
"QT_NO_CAST_TO_ASCII"
"QT_NO_URL_CAST_FROM_STRING"
"QT_NO_CAST_FROM_BYTEARRAY"
)
target_link_libraries(lxqt-policykit-agent
Qt5::Widgets
${QTXDG_LIBRARY}
${LXQT_LIBRARIES}
lxqt
${POLKITQT-1_CORE_LIBRARY}
${POLKITQT-1_AGENT_LIBRARY}
${POLKIT_AGENT_LIBRARIES}
${POLKIT_AGENT_LDFLAGS}
)
# install
install(TARGETS lxqt-policykit-agent DESTINATION bin)
# building tarball with CPack -------------------------------------------------
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${LXQT_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${LXQT_PATCH_VERSION})
set(CPACK_GENERATOR TBZ2)
set(CPACK_SOURCE_GENERATOR TBZ2)
set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp)
include(CPack)
install(TARGETS
lxqt-policykit-agent
DESTINATION "${POLKIT_AGENT_BINARY_DIR}"
COMPONENT Runtime
)
install(FILES
man/lxqt-policykit-agent.1
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
COMPONENT Runtime
)
add_subdirectory(autostart)
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
......@@ -23,8 +22,7 @@ specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations
below.
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
......@@ -89,9 +87,9 @@ libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it
becomes a de-facto standard. To achieve this, non-free programs must
be allowed to use the library. A more frequent case is that a free
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
......@@ -138,8 +136,8 @@ included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control
compilation and installation of the library.
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
......@@ -305,10 +303,10 @@ of these things:
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least
three years, to give the same user the materials specified in
Subsection 6a, above, for a charge no more than the cost of
performing this distribution.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
......@@ -386,10 +384,9 @@ all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
......@@ -407,11 +404,11 @@ be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
......
# lxqt-policykit
## Overview
lxqt-policykit is the polkit authentification agent of LXQt.
[polkit](https://www.freedesktop.org/wiki/Software/polkit/) is a software framework
to handle privileges of processes.
In LXQt it is e. g. used to extend the privileges of the GUI tools of
[lxqt-admin](https://github.com/lxqt/lxqt-admin/). These are launched by a regular
user. But in order to apply the settings they deal with root privileges are needed
and acquired via polkit.
Among the various components of polkit the authentication agent is the one to
query the user for credentials by dialogue windows like this one of lxqt-policykit.
![lxqt-policykit: GUI](lxqt-policykit_gui.png)
While there's only a single implementation of all other polkit components various
different authentication agents are provided by the various desktop environments.
Basically these can be used interchangeably, that is lxqt-policykit can be used
in an LXDE session or lxpolkit, the authentication agent of LXDE, can be used in
an Xfce session. Most of the time it's better to use the implementation provided
by a distinct desktop environment as it integrates better, though.
Technically, lxqt-policykit is just a single binary `lxqt-policykit-agent` which
is running as [LXQt Module](https://github.com/lxqt/lxqt-session#lxqt-modules)
and launching the GUI on demand.
Note that the naming lxqt-policykit is strictly speaking an anachronism. It refers
to Policykit which was the predecessor of polkit. The name wasn't changed when
Policykit was replaced by polkit as both provide roughly the same features albeit
they are technically different.
## Installing
### Compiling sources
Runtime dependencies are polkit-qt5 and [liblxqt](https://github.com/lxqt/liblxqt).
Additional build dependencies are CMake and optionally Git to pull latest VCS
checkouts. The localization files were outsourced to repository
[lxqt-l10n](https://github.com/lxqt/lxqt-l10n) so the corresponding dependencies
are needed, too. Please refer to this repository's `README.md` for further information.
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
#### Arch Linux
The latest release is provided by package `lxqt-policykit` in repository community,
the actual master checkout can be compiled by packages `lxqt-policykit-git` from
the [AUR](https://aur.archlinux.org).
#### Debian
Package `lxqt-policykit` is available in the official repositories as of Debian
stretch. For now it is comprising the translations as well but these will probably
be outsourced in package `lxqt-policykit-l10n` one day.
#### Fedora
Package `lxqt-policykit` is available as of Fedora 22.
#### openSUSE
Package `lxqt-policykit` is providing the binary, `lxqt-policykit-lang` the
translations. Both are available as of openSUSE Leap 42.1.
## Configuration, Usage
Like all LXQt Modules `lxqt-policykit-agent` can be adjusted from section
"Basic Settings" in configuration dialogue
[LXQt Session Settings](https://github.com/lxqt/lxqt-session#lxqt-session-settings)
of [lxqt-session](https://github.com/lxqt/lxqt-session).
From a user's point of view the usage is limited to interacting with the GUI as
seen above.
### Translation (Weblate)
<a href="https://weblate.lxqt.org/projects/lxqt/lxqt-policykit-agent/">
<img src="https://weblate.lxqt.org/widgets/lxqt/-/lxqt-policykit-agent/multi-auto.svg" alt="Translation status" />
</a>
file(GLOB DESKTOP_FILES_IN *.desktop.in)
# Translations **********************************
lxqt_translate_desktop(DESKTOP_FILES
SOURCES
${DESKTOP_FILES_IN}
)
add_custom_target(lxqt_policykit_autostart_desktop_files ALL DEPENDS ${DESKTOP_FILES})
#************************************************
install(FILES
${DESKTOP_FILES}
DESTINATION "${LXQT_ETC_XDG_DIR}/autostart"
COMPONENT Runtime
)
[Desktop Entry]
Type=Application
Name=PolicyKit Handler
TryExec=lxqt-policykit-agent
Exec=lxqt-policykit-agent
OnlyShowIn=LXQt;
X-LXQt-Module=true
#TRANSLATIONS_DIR=translations
# Translations
Name[ar]=معالج وحدة السِّياسة بوليسي كيت
# Translations
Name[cs]=Zacházení s politikami
# Translations
Name[da]=PolicyKit-håndtering
# Translations
Name[de]=PolicyKit-Steuerung
Comment[de]=Authentifizierungsagent für PolicyKit
# Translations
Name[el]=Διαχειριστής PolicyKit
# Translations
Name[eo]=Traktilo de PolicyKit
# Translations
Name[es]=Manipulador de PolicyKit
# Translations
Name[es_VE]=Encargado del Kit de politicas
# Translations
Name[eu]=PolicyKit maneiatzailea
# Translations
Name[fi]=PolicyKit-käsittelijä
# Translations
Name[fr]=Gestionnaire de PolicyKit
# Translations
Name[hu]=PolicyKit-kezelő
# Translations
Name[it_IT]=Gestore di PolicyKit
# Translations
Name[ja]=PolicyKitハンドラ
# Translations
Name[lt]=PolicyKit doroklė
# Translations
Name[nl]=PolicyKit Handler
# Translations
Name[pl_PL]=PolicyKit Handler
# Translations
Name[pt]=Gestor de políticas
# Translations
Name[pt_BR]=Manipulador PolicyKit
# Translations
Name[ru]= политики комплект Обработчик
# Translations
Name[ru_RU]=Обработчик PolicyKit
# Translations
Name[sl]=Upravljalnik PolicyKit
# Translations
Name[th_TH]=ตัวจัดการ PolicyKit
# Translations
Name[tr]=PolicyKit İşleyici
# Translations
Name[uk]=Маніпулятор PolicyKit
# Translations
Name[zh_CN]=PolicyKit 处理器
# Translations
Name[zh_TW]=PolicyKit處理器
This diff is collapsed.
Source: lxqt-policykit
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>,
Yukiharu YABUKI <yyabuki@debian.org>
Section: x11
Priority: optional
Build-Depends: debhelper-compat (= 12),
libkf5windowsystem-dev,
liblxqt0-dev (>= 0.14.1~),
libpolkit-agent-1-dev,
libpolkit-qt5-1-dev,
libqt5svg5-dev,
libqt5x11extras5-dev,
libx11-dev
Standards-Version: 4.3.0
Vcs-Browser: https://salsa.debian.org/lxqt-team/lxqt-policykit
Vcs-Git: https://salsa.debian.org/lxqt-team/lxqt-policykit.git
Homepage: https://github.com/lxqt/lxqt-policykit
Package: lxqt-policykit
Architecture: any
Depends: ${misc:Depends},
${shlibs:Depends},
lxqt-session
Recommends: lxqt-policykit-l10n
Suggests: lxqt | lxqt-core
Breaks: lxqt-common (<< 0.12.0)
Replaces: lxqt-common (<< 0.12.0)
Provides: polkit-1-auth-agent
Description: LXQt authentication agent for PolicyKit
The lxqt-policykit D-Bus session bus service that is used to
bring up authentication dialogs used for obtaining privileges.
.
This package contains the LXQt policy kit authentication agent.
Package: lxqt-policykit-l10n
Architecture: all
Multi-Arch: foreign
Section: localization
Depends: ${misc:Depends},
qttranslations5-l10n
Breaks: lxqt-policykit (<< 0.11.0)
Replaces: lxqt-policykit (<< 0.11.0)
Description: Language package for lxqt-policykit
This package contains the l10n files needed by the lxqt-policykit.
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: lxqt-policykit
Source: https://github.com/lxqt/lxqt-policykit
Files: *
Copyright: 2012-2019 LXQt team
2010-2012 Razor team
License: LGPL-2.1+
Files: debian/*
Copyright: 2014-2019 Alf Gaida <agaida@siduction.org>
2015 Yukiharu YABUKI <yyabuki@debian.org>
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".
AUTHORS
README.md
usr/share/lxqt/translations/lxqt-policykit-agent
etc/xdg/autostart/lxqt-policykit-agent.desktop
usr/bin/lxqt-policykit-agent
usr/share/man/man1/lxqt-policykit-agent.1
# Author: 2017-2018 Alf Gaida <agaida@siduction.org>
# License: WTFPL-2
# 0. You just DO WHAT THE FUCK YOU WANT TO.
# Variables
# =========
# baseversion= the first part of the version no (0.x.y~)
# distribution= target distribution
# repository= your repository
# branch= your branch, if needed
# commit= your commit , if needed
# target_dir= target dir, if needed, default is snapshot
#
# Functions
# =========
# cleanup ()
baseversion=0.14.1~
distribution=experimental-snapshots
uploadrepo=snapshot
repository="git@github.com:lxqt/lxqt-policykit"
# repository="git@github.com:4sid/lxqt-policykit"
# branch="-b lxqt-policykit-translation-move"
build="yes"
clean="yes"
gitcommit="yes"
push="yes"
upload="yes"
dryrun="no"
# cleanup function definiton
cleanup() {
echo ""
echo "┌────────────────────────────┐"
echo "│ Cleanup lxqt-policykit ... │"
echo "└────────────────────────────┘"
rm -rf .git*
rm -f .translation-update
}
#!/usr/bin/make -f
# export DH_VERBOSE=1
export LC_ALL=C.UTF-8
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh ${@} --buildsystem cmake
override_dh_missing:
dh_missing --fail-missing
override_dh_auto_configure:
dh_auto_configure -- \
-DUPDATE_TRANSLATIONS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
tar-ignore=.gitignore
Name: lxqt-policykit
Bug-Database: https://github.com/lxqt/lxqt-policykit/issues
Bug-Submit: https://github.com/lxqt/lxqt-policykit/issues/new
Changelog: https://github.com/lxqt/lxqt-policykit/blob/master/CHANGELOG
Repository: https://github.com/lxqt/lxqt-policykit
Repository-Browser: https://github.com/lxqt/lxqt-policykit
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFXQeMMBEACif4+9pTrC6uNmRng0ZbzLh7p3cazmbnp2YFgDQDJZ7ZNmebxy
ngRuRhjGuDcFAL/37BwJnrBpfZFK9ljoH4Fo5Jm9cOELaTy7AIcEiV9dKMyrKF1E
C76d8jHVuzuPbI92DkFdLZAdk+qjrrAy0x43PvUd+aaBGLcFs1ZMk7gOvElc2d95
zWWSp5anjukmGbp+EsStnWJkF6VHj56qmklfYy5ioiVBOSpXo/RsACAcIlz8C8A1
d4tNMiB2uF2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mO/RU3g6rb0TAwGFxDHj8t4JEDTc3zASG7wV/VTn06
d8XIH9CZOw3kUuhkQ3OR/PEj1BCeCC+caC+tBjO0fgvDp8RV7NFQQ9kH8R3/xlWd
6KMPtILE6fUft6LubWRGd1P5JBuzXivELolASajewbYtL/s87CCji3ngq0aT9raK
m02wqFzNbX1iv+w2iqPQXq6pdRyxtJ8+Q8Z7zEBGJS5nkrYjsLTduZIjJHYHYH7f
3/ydVjQ3z12iqHKElgaRI7RUmpNiNxVIr+TtuxzeC6G+CF++XNkUtJODvCmRaoJS
waYsitz8+LSv3tawZJ0iQkKc9nerQMuBD+AzIr3i4NgXiEIN513esUtnKzeyIIsL
ntUcBjXKuLCj8OZrZtexjq7edWWbN57/3ikyS2Z7y0i3O30qk5jmccSaS6kA7xTY
WCDFzbN2v2y+vGu9KYn+2HtrP2BtNa8JTh3waNeLUTpn4GV4mMrsZjOy6vhhHb91
1TKfI1gvjk7lE9xaWmcDjdI55dw3jIq8kK9SdgORGq9/S3g7KJNRjme+6GjqQfk=
=h7ww
-----END PGP PUBLIC KEY BLOCK-----
.TH lxqt-policykit-agent "1" "September 2012" "LxQt\-qt\ 0.5.0" "LxQt\-Qt\ Module"
.TH lxqt-policykit-agent "1" "September 2012" "LXQt\ 0.5.0" "LXQt\ Module"
.SH NAME
lxqt-policykit-agent \- Polkit agent for \fBLXDE-Qt\fR: the faster and lighter QT Desktop Environment
lxqt-policykit-agent \- Polkit agent for \fBLXQt\fR: the faster and lighter QT Desktop Environment
.SH SYNOPSIS
.B lxqt-policykit-agent
[\fICurrently No command line arguments\fR]
.br
.SH DESCRIPTION
This module handles policykit for \fBLXDE-Qt\fR. The polkit module, will perform
security tast over scale action privilegies.
This module handles policykit for \fBLXQt\fR. The authentication agent is used to make the user of
a session prove that the user of the session really is the user (by authenticating as the user) or
an administrative user (by authenticating as a administrator).
.P
The \fBLXDE-Qt modules\fR are desktop independent tools,
and operate as daemons for the local user for desktop specific operations.
The \fBLXQt modules\fR are desktop independent tools and operate as daemons
for the local user for desktop specific operations.
.P
\fBLXDE-Qt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt
\fBLXQt\fR is an advanced, easy-to-use and fast desktop environment based on Qt
technologies, ships several core desktop components, all of which are optional:
.P
* Panel
......@@ -24,29 +25,29 @@ technologies, ships several core desktop components, all of which are optional:
* Display manager handler
.P
These components perform similar actions to those available in other desktop
environments, and their name is self-descriptive. They are usually not launched
by hand but automatically, when choosing a LxQt\-Qt session in the Display
environments and their name is self-descriptive. They are usually not launched
by hand but automatically, when choosing a LXQt session in the Display
Manager.
.SH BEHAVIOR
The module detected on shares privilege escalation, and maintain a security dialog
The module detected on shares privilege escalation and maintain a security dialog
that ask for the user's key need for action.
.SH AUTOSTART
The module only are showed on \fBLXDE-Qt\fR desktop, but u can create an autostart action
for u prefered desktop environment.
The module is only shown in \fBLXQt\fR desktop, but one can create an autostart action
for other desktop environments.
.SH "REPORTING BUGS"
Report bugs to https://github.com/LXDE-Qt/LXDE-Qt/issues
Report bugs to https://github.com/lxqt/lxqt/issues
.SH "SEE ALSO"
\fBLXDE-Qt\fR it has been tailored for users who value simplicity, speed, and
an intuitive interface, also intended for less powerful machines. See:
\fBLXQt\fR has been tailored for users who value simplicity, speed and
an intuitive interface, it's also intended for less powerful machines. See:
.\" any module must refers to session app, for more info on start it
.P
\fBlxqt-session.1\fR LXDE-Qt for manage LXDE-Qt complete environment
\fBlxqt-session.1\fR LXQt for manage LXQt complete environment
.P
\fBstart-lxqt.1\fR LXDE-Qt display management independient starup.
\fBstart-lxqt.1\fR LXQt display management independent startup.
.P
\fBlxqt-config-session.1\fR LXDE-Qt application for performing session autostart applications
\fBlxqt-config-session.1\fR LXQt application for performing session autostart applications
.P
.SH AUTHOR
This manual page was created by \fBPICCORO Lenz McKAY\fR \fI<mckaygerhard@gmail.com>\fR
for \fBLXDE-Qt\fR project and VENENUX GNU/Linux but can be used by others.
for \fBLXQt\fR project and VENENUX GNU/Linux.
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXDE-Qt - a lightweight, Qt based, desktop toolset
* http://razor-qt.org
* LXQt - a lightweight, Qt based, desktop toolset
* https://lxqt.org
*
* Copyright: 2011-2012 Razor team
* Authors:
......@@ -31,6 +31,7 @@
#include <XdgIcon>
#include <LXQt/Settings>
#include <QCommandLineParser>
#include "policykitagent.h"
......@@ -40,10 +41,19 @@ int main(int argc, char *argv[])
g_type_init();
#endif
LxQt::Application app(argc, argv);
LXQt::Application app(argc, argv);
app.setQuitOnLastWindowClosed(false);
LxQtPolicykit::PolicykitAgent agent;
QCommandLineParser parser;
parser.setApplicationDescription(QStringLiteral("LXQt Policykit Agent"));
const QString VERINFO = QStringLiteral(LXQT_POLKITAGENT_VERSION
"\nliblxqt " LXQT_VERSION
"\nQt " QT_VERSION_STR);
app.setApplicationVersion(VERINFO);
parser.addVersionOption();
parser.addHelpOption();
parser.process(app);
LXQtPolicykit::PolicykitAgent agent;
return app.exec();
}
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXDE-Qt - a lightweight, Qt based, desktop toolset
* http://razor-qt.org
* LXQt - a lightweight, Qt based, desktop toolset
* https://lxqt.org
*
* Copyright: 2011-2012 Razor team
* Authors:
......@@ -36,7 +36,7 @@
#include "policykitagentgui.h"
namespace LxQtPolicykit
namespace LXQtPolicykit
{
PolicykitAgent::PolicykitAgent(QObject *parent)
......@@ -45,7 +45,7 @@ PolicykitAgent::PolicykitAgent(QObject *parent)
m_gui(0)
{
PolkitQt1::UnixSessionSubject session(getpid());
registerListener(session, "/org/lxqt/PolicyKit1/AuthenticationAgent");
registerListener(session, QStringLiteral("/org/lxqt/PolicyKit1/AuthenticationAgent"));
}
PolicykitAgent::~PolicykitAgent()
......@@ -68,7 +68,7 @@ void PolicykitAgent::initiateAuthentication(const QString &actionId,
{
if (m_inProgress)
{
QMessageBox::information(0, tr("PolicyKit Information"), "Another authentization in progress. Please try it again later");
QMessageBox::information(0, tr("PolicyKit Information"), tr("Another authentication is in progress. Please try again later."));
return;
}
m_inProgress = true;
......@@ -81,7 +81,7 @@ void PolicykitAgent::initiateAuthentication(const QString &actionId,
}
m_gui = new PolicykitAgentGUI(actionId, message, iconName, details, identities);
foreach (PolkitQt1::Identity i, identities)
for(const PolkitQt1::Identity& i : identities)
{
PolkitQt1::Agent::Session *session;
session = new PolkitQt1::Agent::Session(i, cookie, result);
......@@ -116,27 +116,38 @@ void PolicykitAgent::request(const QString &request, bool echo)
PolkitQt1::Identity identity = m_SessionIdentity[session];
m_gui->setPrompt(identity, request, echo);
if (m_gui->exec())
session->setResponse(m_gui->response());
else
session->setResponse("");
connect(m_gui, &QDialog::finished, [this, session] (int result)
{
if (result == QDialog::Accepted && m_gui->identity() == m_SessionIdentity[session].toString())
session->setResponse(m_gui->response());
else
session->cancel();
});
m_gui->show();
m_gui->activateWindow();
m_gui->raise();
}
void PolicykitAgent::completed(bool gainedAuthorization)
{
PolkitQt1::Agent::Session * session = qobject_cast<PolkitQt1::Agent::Session *>(sender());
Q_ASSERT(session);
Q_ASSERT(m_gui);
if (!gainedAuthorization)
if (m_gui->identity() == m_SessionIdentity[session].toString())
{
QMessageBox::information(0, tr("Authorization Failed"), tr("Authorization failed for some reason"));
if (!gainedAuthorization)
{
QMessageBox::information(0, tr("Authorization Failed"), tr("Authorization failed for some reason"));
}
// Note: the setCompleted() must be called exacly once (as the
// AsyncResult is shared by all the sessions)
session->result()->setCompleted();
m_inProgress = false;
}
session->result()->setCompleted();
delete session;
m_inProgress = false;
}
void PolicykitAgent::showError(const QString &text)
......
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXDE-Qt - a lightweight, Qt based, desktop toolset
* http://razor-qt.org
* LXQt - a lightweight, Qt based, desktop toolset
* https://lxqt.org
*
* Copyright: 2011-2012 Razor team
* Authors:
......@@ -38,7 +38,7 @@
#include <QApplication>
#include <QHash>
namespace LxQtPolicykit
namespace LXQtPolicykit
{
class PolicykitAgentGUI;
......
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXDE-Qt - a lightweight, Qt based, desktop toolset
* http://razor-qt.org
* LXQt - a lightweight, Qt based, desktop toolset
* https://lxqt.org
*
* Copyright: 2011-2012 Razor team
* Authors:
......@@ -24,11 +24,12 @@
* Boston, MA 02110-1301 USA
*
* END_COMMON_COPYRIGHT_HEADER */
#include <XdgIcon>
#include <QIcon>
#include "policykitagentgui.h"
#include <unistd.h>
namespace LxQtPolicykit
namespace LXQtPolicykit
{
......@@ -44,30 +45,47 @@ PolicykitAgentGUI::PolicykitAgentGUI(const QString &actionId,
Q_UNUSED(details); // it seems too confusing for end user (=me)
messageLabel->setText(message);
iconLabel->setPixmap(XdgIcon::fromTheme(iconName).pixmap(64, 64));
foreach (PolkitQt1::Identity identity, identities)
QIcon icon = QIcon::fromTheme(iconName);
if (icon.isNull())
icon = QIcon::fromTheme(QLatin1String("dialog-question"));
iconLabel->setPixmap(icon.pixmap(64, 64));
const uid_t current_uid = getuid();
int current_user_index = -1;
for (const PolkitQt1::Identity& identity : identities)
{
m_identityMap[identity.toString()] = identity;
const int i = identityComboBox->count(); // index of the added item
identityComboBox->addItem(identity.toString());
PolkitQt1::UnixUserIdentity const * const u_id = static_cast<const PolkitQt1::UnixUserIdentity *>(&identity);
if (u_id != nullptr && u_id->uid() == current_uid)
current_user_index = i;
}
if (current_user_index != -1)
identityComboBox->setCurrentIndex(current_user_index);
connect(identityComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &PolicykitAgentGUI::onIdentityChanged);
passwordEdit->setFocus(Qt::OtherFocusReason);
}
void PolicykitAgentGUI::setPrompt(const PolkitQt1::Identity &identity, const QString &text, bool echo)
{
int ix = identityComboBox->findText(identity.toString());
const int ix = identityComboBox->findText(identity.toString());
if (ix != -1)
{
identityComboBox->setCurrentIndex(ix);
passwordEdit->setFocus(Qt::OtherFocusReason);
identityComboBox->setItemData(ix, text, RolePromptText);
identityComboBox->setItemData(ix, echo, RolePromptEcho);
if (ix == identityComboBox->currentIndex())
{
promptLabel->setText(text);
passwordEdit->setEchoMode(echo ? QLineEdit::Normal : QLineEdit::Password);
}
}
promptLabel->setText(text);
passwordEdit->setEchoMode(echo ? QLineEdit::Normal : QLineEdit::Password);
}
PolkitQt1::Identity PolicykitAgentGUI::identity()
QString PolicykitAgentGUI::identity()
{
return m_identityMap[identityComboBox->currentText()];
Q_ASSERT(identityComboBox->currentIndex() != -1);
return identityComboBox->currentText();
}
QString PolicykitAgentGUI::response()
......@@ -75,4 +93,14 @@ QString PolicykitAgentGUI::response()
return passwordEdit->text();
}
void PolicykitAgentGUI::onIdentityChanged(int index)
{
QVariant text = identityComboBox->itemData(index, RolePromptText);
QVariant echo = identityComboBox->itemData(index, RolePromptEcho);
if (text != QVariant{})
promptLabel->setText(text.toString());
if (echo != QVariant{})
passwordEdit->setEchoMode(echo.toBool() ? QLineEdit::Normal : QLineEdit::Password);
}
} // namespace
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXDE-Qt - a lightweight, Qt based, desktop toolset
* http://razor-qt.org
* LXQt - a lightweight, Qt based, desktop toolset
* https://lxqt.org
*
* Copyright: 2011-2012 Razor team
* Authors:
......@@ -33,13 +33,20 @@
#include "ui_policykitagentgui.h"
namespace LxQtPolicykit
namespace LXQtPolicykit
{
class PolicykitAgentGUI : public QDialog, public Ui::PolicykitAgentGUI
{
Q_OBJECT
private:
enum DataRoles
{
RolePromptText = Qt::UserRole
, RolePromptEcho
};
public:
PolicykitAgentGUI(const QString &actionId,
const QString &message,
......@@ -48,11 +55,14 @@ public:
const PolkitQt1::Identity::List &identities);
void setPrompt(const PolkitQt1::Identity &identity, const QString &text, bool echo);
PolkitQt1::Identity identity();
/*! \brief Returns currently selected identity (serialized by toString())
*/
QString identity();
QString response();
private:
QHash<QString,PolkitQt1::Identity> m_identityMap;
public slots:
void onIdentityChanged(int index);
};
} // namespace
......
project(lxqt-policykit-agent)
build_component("." "")
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en_US">
<TS version="2.1">
<context>
<name>PolicykitAgentGUI</name>
<name>LXQtPolicykit::PolicykitAgent</name>
<message>
<source>Authentication Required</source>
<location filename="../src/policykitagent.cpp" line="71"/>
<location filename="../src/policykitagent.cpp" line="158"/>
<source>PolicyKit Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Identity:</source>
<location filename="../src/policykitagent.cpp" line="71"/>
<source>Another authentization in progress. Please try it again later.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password:</source>
<location filename="../src/policykitagent.cpp" line="139"/>
<source>Authorization Failed</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LxQtPolicykit::PolicykitAgent</name>
<message>
<source>PolicyKit Information</source>
<location filename="../src/policykitagent.cpp" line="139"/>
<source>Authorization failed for some reason</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Authorization Failed</source>
<location filename="../src/policykitagent.cpp" line="153"/>
<source>PolicyKit Error</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PolicykitAgentGUI</name>
<message>
<source>Authorization failed for some reason</source>
<location filename="../src/policykitagentgui.ui" line="14"/>
<source>Authentication Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PolicyKit Error</source>
<location filename="../src/policykitagentgui.ui" line="55"/>
<source>Identity:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/policykitagentgui.ui" line="65"/>
<source>Password:</source>
<translation type="unfinished"></translation>
</message>
</context>
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ar">
<context>
<name>LXQtPolicykit::PolicykitAgent</name>
<message>
<location filename="../src/policykitagent.cpp" line="71"/>
<location filename="../src/policykitagent.cpp" line="158"/>
<source>PolicyKit Information</source>
<translation>معلومات عُدّة السياسات</translation>
</message>