Merge pull request #1554 from majestrate/cmake-check-for-setcap-2021-03-01

add explicit check for setcap
pull/1563/head
Jeff 3 years ago committed by GitHub
commit d0e4069762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,7 +37,9 @@ else()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
option(WITH_SETCAP "Enables setcap'ing the lokinet binary with the required capabilities during installation (requires root)" ON)
if(WITH_SETCAP)
install(CODE "execute_process(COMMAND setcap cap_net_admin,cap_net_bind_service=+eip ${CMAKE_INSTALL_PREFIX}/bin/lokinet)")
find_program(setcap_bin NAMES setcap HINTS /sbin /usr/sbin REQUIRED)
message(STATUS "found setcap: ${setcap_bin}")
install(CODE "execute_process(COMMAND ${setcap_bin} cap_net_admin,cap_net_bind_service=+eip ${CMAKE_INSTALL_PREFIX}/bin/lokinet)")
endif()
endif()

Loading…
Cancel
Save