summaryrefslogtreecommitdiffstats
path: root/bin/systrace/systrace.c
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>2003-06-16 06:36:40 +0000
committeritojun <itojun@openbsd.org>2003-06-16 06:36:40 +0000
commitcd1e39b59e15fb65a1ae03ebde716ef9fc29dd7f (patch)
tree3bb16ac32c4655e410047a9e0953f9c996c82c1e /bin/systrace/systrace.c
parentadd supported device; (diff)
downloadwireguard-openbsd-cd1e39b59e15fb65a1ae03ebde716ef9fc29dd7f.tar.xz
wireguard-openbsd-cd1e39b59e15fb65a1ae03ebde716ef9fc29dd7f.zip
- limited number of processes per systrace
- escape fixes for special characters markus, sturm ok. from provos
Diffstat (limited to 'bin/systrace/systrace.c')
-rw-r--r--bin/systrace/systrace.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/bin/systrace/systrace.c b/bin/systrace/systrace.c
index 5eaca041569..9b5bd1c2be2 100644
--- a/bin/systrace/systrace.c
+++ b/bin/systrace/systrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: systrace.c,v 1.42 2002/12/12 00:39:14 avsm Exp $ */
+/* $OpenBSD: systrace.c,v 1.43 2003/06/16 06:36:40 itojun Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -124,7 +124,7 @@ make_output(char *output, size_t outlen, const char *binname,
if (line == NULL)
continue;
- snprintf(p, size, ", %s: %s", tl->name, line);
+ snprintf(p, size, ", %s: %s", tl->name, strescape(line));
p = output + strlen(output);
size = outlen - strlen(output);
@@ -377,6 +377,18 @@ execres_cb(int fd, pid_t pid, int policynr, const char *emulation,
fprintf(stderr, "Terminating %d: %s\n", pid, name);
}
+void
+policyfree_cb(int policynr, void *arg)
+{
+ struct policy *policy;
+
+ if ((policy = systrace_findpolnr(policynr)) == NULL)
+ errx(1, "%s:%d: find %d", __func__, __LINE__,
+ policynr);
+
+ systrace_freepolicy(policy);
+}
+
static void
child_handler(int sig)
{