apps: Install su as setuid
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3887b98a7d
commit
46be0bd458
@ -1,20 +1,24 @@
|
||||
function(luna_app SOURCE_FILE APP_NAME)
|
||||
function(luna_app SOURCE_FILE APP_NAME SETUID)
|
||||
add_executable(${APP_NAME} ${SOURCE_FILE})
|
||||
target_compile_options(${APP_NAME} PRIVATE -Os ${COMMON_FLAGS} -Wno-write-strings)
|
||||
add_dependencies(${APP_NAME} libc)
|
||||
target_include_directories(${APP_NAME} PRIVATE ${LUNA_BASE}/usr/include)
|
||||
target_link_libraries(${APP_NAME} PRIVATE os)
|
||||
if(${SETUID})
|
||||
install(TARGETS ${APP_NAME} DESTINATION ${LUNA_ROOT}/initrd/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE SETUID)
|
||||
else()
|
||||
install(TARGETS ${APP_NAME} DESTINATION ${LUNA_ROOT}/initrd/bin)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
luna_app(init.cpp init)
|
||||
luna_app(env.cpp env)
|
||||
luna_app(su.cpp su)
|
||||
luna_app(sh.cpp sh)
|
||||
luna_app(cat.cpp cat)
|
||||
luna_app(date.cpp date)
|
||||
luna_app(edit.cpp edit)
|
||||
luna_app(ls.cpp ls)
|
||||
luna_app(chown.cpp chown)
|
||||
luna_app(chmod.cpp chmod)
|
||||
luna_app(mkdir.cpp mkdir)
|
||||
luna_app(init.cpp init OFF)
|
||||
luna_app(env.cpp env OFF)
|
||||
luna_app(su.cpp su ON)
|
||||
luna_app(sh.cpp sh OFF)
|
||||
luna_app(cat.cpp cat OFF)
|
||||
luna_app(date.cpp date OFF)
|
||||
luna_app(edit.cpp edit OFF)
|
||||
luna_app(ls.cpp ls OFF)
|
||||
luna_app(chown.cpp chown OFF)
|
||||
luna_app(chmod.cpp chmod OFF)
|
||||
luna_app(mkdir.cpp mkdir OFF)
|
||||
|
Loading…
Reference in New Issue
Block a user