make execsnoop optional as module

This commit is contained in:
springzfx
2020-05-25 13:49:40 +08:00
parent 1c72a204a1
commit 076651b984
9 changed files with 63 additions and 51 deletions

View File

@@ -4,6 +4,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src)
add_executable(cgattach cgattach.cpp ../src/cgroup_attach.cpp ../src/common.cpp)
install(TARGETS cgattach DESTINATION /usr/bin PERMISSIONS ${basic_permission})
add_executable(execsnoop execsnoop.cpp ../src/common.cpp)
target_link_libraries(execsnoop bcc)
install(TARGETS execsnoop DESTINATION /usr/bin PERMISSIONS ${basic_permission})
add_executable(execsnoop_exec execsnoop.cpp ../src/common.cpp ../src/execsnoop.cpp)
set_target_properties(execsnoop_exec PROPERTIES OUTPUT_NAME execsnoop)
target_link_libraries(execsnoop_exec bcc)
install(TARGETS execsnoop_exec DESTINATION /usr/bin PERMISSIONS ${basic_permission})

View File

@@ -1,7 +1,8 @@
#include "execsnoop.hpp"
#include "execsnoop.h"
#include "common.h"
#include <unistd.h>
using namespace std;
using namespace CGPROXY::EXESNOOP;
using namespace CGPROXY::EXECSNOOP;
#define PATH_MAX_LEN 128