Export print_seccomp_fprog for further use in parser of ptrace syscall
* defs.h (print_seccomp_fprog): New prototype. * seccomp.c (print_seccomp_fprog): Remove "static" keyword. Move printing of struct seccomp_fprog fields ... (print_seccomp_filter): ... here.
This commit is contained in:
parent
01d16ccb96
commit
50a26514a5
3
defs.h
3
defs.h
@ -652,7 +652,8 @@ extern void tprint_iov(struct tcb *, unsigned long, unsigned long, int decode_io
|
||||
extern void tprint_iov_upto(struct tcb *, unsigned long, unsigned long, int decode_iov, unsigned long);
|
||||
extern void tprint_open_modes(unsigned int);
|
||||
extern const char *sprint_open_modes(unsigned int);
|
||||
extern void print_seccomp_filter(struct tcb *tcp, unsigned long);
|
||||
extern void print_seccomp_filter(struct tcb *, unsigned long);
|
||||
extern void print_seccomp_fprog(struct tcb *, unsigned long, unsigned short);
|
||||
|
||||
struct strace_statfs;
|
||||
extern void print_struct_statfs(struct tcb *tcp, long);
|
||||
|
11
seccomp.c
11
seccomp.c
@ -171,11 +171,9 @@ print_bpf_filter(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
print_seccomp_fprog(struct tcb *tcp, unsigned long addr, unsigned short len)
|
||||
{
|
||||
tprintf("{len=%u, filter=", len);
|
||||
|
||||
if (abbrev(tcp)) {
|
||||
printaddr(addr);
|
||||
} else {
|
||||
@ -185,8 +183,6 @@ print_seccomp_fprog(struct tcb *tcp, unsigned long addr, unsigned short len)
|
||||
print_array(tcp, addr, len, &filter, sizeof(filter),
|
||||
umoven_or_printaddr, print_bpf_filter, &insns);
|
||||
}
|
||||
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
#include "seccomp_fprog.h"
|
||||
@ -196,8 +192,11 @@ print_seccomp_filter(struct tcb *tcp, unsigned long addr)
|
||||
{
|
||||
struct seccomp_fprog fprog;
|
||||
|
||||
if (fetch_seccomp_fprog(tcp, addr, &fprog))
|
||||
if (fetch_seccomp_fprog(tcp, addr, &fprog)) {
|
||||
tprintf("{len=%hu, filter=", fprog.len);
|
||||
print_seccomp_fprog(tcp, fprog.filter, fprog.len);
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user