CMake: Add dumpcap group option to installation

Change-Id: I2718776a908ae5f9c6c475a110f9170b812b392d
Reviewed-on: https://code.wireshark.org/review/29282
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
This commit is contained in:
João Valverde 2018-08-25 17:27:23 +01:00 committed by João Valverde
parent e09c9a8e46
commit e75905a583
2 changed files with 9 additions and 0 deletions

View File

@ -2549,6 +2549,10 @@ if(BUILD_dumpcap AND PCAP_FOUND)
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
if(ENABLE_DUMPCAP_GROUP)
install(CODE "execute_process(COMMAND chgrp ${DUMPCAP_INSTALL_GROUP} ${CMAKE_INSTALL_FULL_BINDIR}/dumpcap)")
install(CODE "execute_process(COMMAND chmod o-x ${CMAKE_INSTALL_FULL_BINDIR}/dumpcap)")
endif()
if(DUMPCAP_INSTALL_OPTION STREQUAL "capabilities")
install( CODE "execute_process(
COMMAND

View File

@ -86,6 +86,11 @@ option(ENABLE_LIBXML2 "Build with libxml2 support" ON)
set(DUMPCAP_INSTALL_OPTION "normal" CACHE STRING "Permissions to install")
set_property(CACHE DUMPCAP_INSTALL_OPTION PROPERTY STRINGS "normal" "suid" "capabilities")
if(UNIX)
option(ENABLE_DUMPCAP_GROUP "Install dumpcap with group ownership and permissions (default \"wireshark\")" OFF)
set(DUMPCAP_INSTALL_GROUP "wireshark" CACHE STRING "Group name for dumpcap (must exist)")
endif()
if(APPLE)
option(ENABLE_APPLICATION_BUNDLE "Build a macOS application bundle (Wireshark.app)" ON)
endif()