Skip to content

Commit

Permalink
python: fix error in pydoc
Browse files Browse the repository at this point in the history
Fix the pydoc example so it's runnable.

Signed-off-by: Jonah Petri <jonah@petri.us>
Acked-by: Tom Hromatka <tom.hromatka@oracle.com>
[PM: fix subject line (add prefix)]
Signed-off-by: Paul Moore <paul@paul-moore.com>
  • Loading branch information
skrap authored and pcmoore committed Oct 1, 2019
1 parent 2b406e3 commit 853a24c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/python/seccomp.pyx
Expand Up @@ -61,13 +61,18 @@ Example:
# create a filter object with a default KILL action
f = SyscallFilter(defaction=KILL)
# add some basic syscalls which python typically wants
f.add_rule(ALLOW, "rt_sigaction")
f.add_rule(ALLOW, "rt_sigreturn")
f.add_rule(ALLOW, "exit_group")
f.add_rule(ALLOW, "brk")
# add syscall filter rules to allow certain syscalls
f.add_rule(ALLOW, "open")
f.add_rule(ALLOW, "close")
f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin))
f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout))
f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr))
f.add_rule(ALLOW, "rt_sigreturn")
f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
# load the filter into the kernel
f.load()
Expand Down

0 comments on commit 853a24c

Please sign in to comment.