summaryrefslogtreecommitdiff
path: root/bin/systrace/policy.c
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2002-06-04 23:05:27 +0000
committerNiels Provos <provos@cvs.openbsd.org>2002-06-04 23:05:27 +0000
commit960fd45a6d997d9ecb662a6f7224dfa1170821b1 (patch)
tree0b159904fd28dc085ff50f62167512f09ac2951f /bin/systrace/policy.c
parent45305862b66ca00d9ecd663264bd10fd7ed94159 (diff)
setup user systrace dir only if user policies are used.
Diffstat (limited to 'bin/systrace/policy.c')
-rw-r--r--bin/systrace/policy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/systrace/policy.c b/bin/systrace/policy.c
index 6fd08493356..c75fb4d6c4d 100644
--- a/bin/systrace/policy.c
+++ b/bin/systrace/policy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: policy.c,v 1.4 2002/06/04 20:13:19 provos Exp $ */
+/* $OpenBSD: policy.c,v 1.5 2002/06/04 23:05:26 provos Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -85,6 +85,8 @@ SPLAY_GENERATE(policytree, policy, node, policycompare);
SPLAY_PROTOTYPE(polnrtree, policy, nrnode, polnrcompare);
SPLAY_GENERATE(polnrtree, policy, nrnode, polnrcompare);
+extern int userpolicy;
+
char policydir[MAXPATHLEN];
void
@@ -117,7 +119,8 @@ systrace_initpolicy(char *file)
SPLAY_INIT(&policyroot);
SPLAY_INIT(&polnrroot);
- systrace_setupdir();
+ if (userpolicy)
+ systrace_setupdir();
if (file != NULL)
return (systrace_readpolicy(file));
@@ -261,7 +264,6 @@ int
systrace_addpolicy(char *name)
{
char *file = NULL;
- extern int userpolicy;
if (userpolicy) {
file = systrace_policyfilename(policydir, name);