From dce35518d9b91b1bac0394792f83450fbe4aa3bc Mon Sep 17 00:00:00 2001 From: Sebastien Braun Date: Wed, 6 Oct 2010 15:17:40 +0200 Subject: Install PolKit policy file and try to detect the policy directory. --- src/input/CMakeLists.txt | 19 +++++++++++++++++++ src/input/org.openslx.pvs.input.policy | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/input/org.openslx.pvs.input.policy (limited to 'src/input') diff --git a/src/input/CMakeLists.txt b/src/input/CMakeLists.txt index 44cf6b6..0cf5177 100644 --- a/src/input/CMakeLists.txt +++ b/src/input/CMakeLists.txt @@ -67,16 +67,35 @@ if(UNIX) find_program(PKEXEC_LOCATION pkexec) if(PKEXEC_LOCATION OR ENABLE_POLKIT) set(POLKIT_FOUND ON) + set(POLKIT_PREFIX ${CMAKE_INSTALL_PREFIX}) + set(POLKIT_POLICY_DIR ${POLKIT_PREFIX}/share/polkit-1/actions) endif() else() pkg_check_modules(POLKIT "polkit-gobject-1") + if(POLKIT_FOUND) + execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} polkit-gobject-1 --variable=policydir + OUTPUT_VARIABLE POLKIT_POLICY_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT POLKIT_POLICY_DIR) + set(POLKIT_FOUND OFF) + endif() + endif() endif() # now, arrange for policykit integration: if(POLKIT_FOUND OR ENABLE_POLKIT) + if(NOT POLKIT_POLICY_DIR) + message(SEND_ERROR "PolicyKit integration is enabled, but cannot find PolicyKit's actions directory. Please set POLKIT_POLICY_DIR to the right value") + endif() + + install(FILES org.openslx.pvs.input.policy + DESTINATION ${POLKIT_POLICY_DIR}) set_property(SOURCE ${pvsprivinputd_SRCS} APPEND PROPERTY COMPILE_DEFINITIONS HAVE_POLKIT) + message(STATUS "PolicyKit integration: enabled") + else() + message(STATUS "PolicyKit integration: disabled") endif() endif() diff --git a/src/input/org.openslx.pvs.input.policy b/src/input/org.openslx.pvs.input.policy new file mode 100644 index 0000000..f0de9f2 --- /dev/null +++ b/src/input/org.openslx.pvs.input.policy @@ -0,0 +1,18 @@ + + + + The OpenSLX project + http://lab.openslx.org/pvs + + + Use privileged input actions in PVS + Authentication is required to let PVS use privileged input actions + + auth_self_keep + auth_self_keep + auth_admin_keep + + + -- cgit v1.2.3-55-g7522