diff options
-rw-r--r-- | actions.c | 18 | ||||
-rw-r--r-- | gluten.h | 7 |
2 files changed, 18 insertions, 7 deletions
@@ -167,6 +167,7 @@ int do_call(struct arg_clone *c) int do_actions(struct action actions[], unsigned int n_actions, int pid, int notifyfd, uint64_t id) { + struct seccomp_notif_addfd resp_fd; struct seccomp_notif_resp resp; struct arg_clone c; unsigned int i; @@ -210,6 +211,23 @@ int do_actions(struct action actions[], unsigned int n_actions, int pid, if (send_target(&resp, notifyfd) == -1) return -1; break; + case A_INJECT_A: + resp_fd.id = id; + resp_fd.flags |= SECCOMP_ADDFD_FLAG_SEND; + resp_fd.newfd = actions[i].inj.newfd; + resp_fd.srcfd = actions[i].inj.old; + resp_fd.flags |= SECCOMP_ADDFD_FLAG_SETFD; + if (send_inject_target(&resp_fd, notifyfd) == -1) + return -1; + break; + case A_INJECT: + resp_fd.id = id; + resp_fd.newfd = actions[i].inj.newfd; + resp_fd.srcfd = actions[i].inj.old; + resp_fd.flags |= SECCOMP_ADDFD_FLAG_SETFD; + if (send_inject_target(&resp_fd, notifyfd) == -1) + return -1; + break; default: fprintf(stderr, "unknow action %d \n", actions[i].type); } @@ -75,12 +75,6 @@ struct act_inject { uint32_t old; }; -struct act_inject_a { - uint32_t newfd; - uint32_t old; - int64_t value; -}; - struct action { enum action_type type; union { @@ -89,7 +83,6 @@ struct action { struct act_continue cont; struct act_return ret; struct act_inject inj; - struct act_inject_a inj_a; }; }; #endif /* GLUTEN_H */ |