diff options
author | 2002-06-05 15:59:52 +0000 | |
---|---|---|
committer | 2002-06-05 15:59:52 +0000 | |
commit | da1f1e197ef87d52bf1a8207a65e92106d56a078 (patch) | |
tree | 904b4432c5b35ab7120133738b426b2e5b17f8e6 /bin/systrace/filter.c | |
parent | use types in inttypes.h directly (diff) | |
download | wireguard-openbsd-da1f1e197ef87d52bf1a8207a65e92106d56a078.tar.xz wireguard-openbsd-da1f1e197ef87d52bf1a8207a65e92106d56a078.zip |
know about CWD. will make some filter rules simpler.
Diffstat (limited to 'bin/systrace/filter.c')
-rw-r--r-- | bin/systrace/filter.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/systrace/filter.c b/bin/systrace/filter.c index 237df9146de..7a005211105 100644 --- a/bin/systrace/filter.c +++ b/bin/systrace/filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filter.c,v 1.3 2002/06/04 19:15:54 deraadt Exp $ */ +/* $OpenBSD: filter.c,v 1.4 2002/06/05 15:59:52 provos Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -29,6 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/param.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/tree.h> @@ -44,6 +45,7 @@ #include "systrace.h" extern int connected; +extern char cwd[]; int filter_match(struct intercept_tlq *tls, struct logic *logic) @@ -385,7 +387,7 @@ filter_replace(char *buf, size_t buflen, char *match, char *repl) char * filter_expand(char *data) { - static char expand[1024]; + static char expand[2*MAXPATHLEN]; char *what; if (data != NULL) @@ -398,6 +400,8 @@ filter_expand(char *data) if (what != NULL) filter_replace(expand, sizeof(expand), "$USER", what); + filter_replace(expand, sizeof(expand), "$CWD", cwd); + return (expand); } |