Set mldr & mldr32 file capabilities at install time

This commit is contained in:
Lubos Dolezel 2017-05-17 08:27:27 +02:00
parent dd58ddd68c
commit 1737780ead
2 changed files with 23 additions and 0 deletions

18
cmake/setcap.cmake Normal file
View File

@ -0,0 +1,18 @@
include(FindSetcap)
function(setcap file caps)
install(CODE "execute_process(
COMMAND
${SETCAP_EXECUTABLE}
cap_sys_rawio+ep
${CMAKE_INSTALL_PREFIX}/${file}
RESULT_VARIABLE
_SETCAP_RESULT
)
if( _SETCAP_RESULT )
message( WARNING \"setcap failed (${_SETCAP_RESULT}).\")
endif()"
)
endfunction(setcap)

View File

@ -46,3 +46,8 @@ install(TARGETS darling DESTINATION bin
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
SETUID)
include(setcap)
setcap(libexec/darling/bin/mldr cap_sys_rawio+ep)
setcap(libexec/darling/bin/mldr32 cap_sys_rawio+ep)