about summary refs log tree commit diff
path: root/frida_mode/src/seccomp/seccomp.c
blob: 99111591a2536a67032a6401993307bb5da0446f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "frida-gumjs.h"

#include "debug.h"

#include "seccomp.h"
#include "util.h"

char *seccomp_filename = NULL;

void seccomp_on_fork(void) {

  if (seccomp_filename == NULL) { return; }

#ifdef __APPLE__
  FATAL("Seccomp not supported on OSX");
#else
  seccomp_callback_parent();
#endif

}

void seccomp_config(void) {

  seccomp_filename = getenv("AFL_FRIDA_SECCOMP_FILE");

}

void seccomp_init(void) {

  OKF("Seccomp - file [%s]", seccomp_filename);

  if (seccomp_filename == NULL) { return; }

#ifdef __APPLE__
  FATAL("Seccomp not supported on OSX");
#else
  seccomp_callback_initialize();
#endif

}