mirror of
https://github.com/darlinghq/darling.git
synced 2024-11-23 12:19:43 +00:00
Set mldr & mldr32 file capabilities at install time
This commit is contained in:
parent
dd58ddd68c
commit
1737780ead
18
cmake/setcap.cmake
Normal file
18
cmake/setcap.cmake
Normal 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)
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user