aboutsummaryrefslogtreecommitdiff
path: root/contrib/pf/pfctl/pfctl_table.c
diff options
context:
space:
mode:
authorMax Laier <mlaier@FreeBSD.org>2004-08-22 16:58:06 +0000
committerMax Laier <mlaier@FreeBSD.org>2004-08-22 16:58:06 +0000
commitc5be312a19a0852552879b494b881d94779aa100 (patch)
tree7c1b786cbff64fe71f56cf8f970689030f283c5e /contrib/pf/pfctl/pfctl_table.c
parentca7a789aa69177e69d95008c0990d3a4c1112834 (diff)
downloadsrc-c5be312a19a0852552879b494b881d94779aa100.tar.gz
src-c5be312a19a0852552879b494b881d94779aa100.zip
Loopback a fix from Cedric Berger:
Fix table add/replace commands with securelevel=2. Reported by James J. Lippard. Discussed with: yongari MFC after: 5 days
Notes
Notes: svn path=/head/; revision=134175
Diffstat (limited to 'contrib/pf/pfctl/pfctl_table.c')
-rw-r--r--contrib/pf/pfctl/pfctl_table.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/pf/pfctl/pfctl_table.c b/contrib/pf/pfctl/pfctl_table.c
index 4aa606d17b17..7b838b042ae1 100644
--- a/contrib/pf/pfctl/pfctl_table.c
+++ b/contrib/pf/pfctl/pfctl_table.c
@@ -1,4 +1,5 @@
/* $OpenBSD: pfctl_table.c,v 1.59 2004/03/15 15:25:44 dhartmei Exp $ */
+/* add $OpenBSD: pfctl_table.c,v 1.61 2004/06/12 22:22:44 cedric Exp $ */
/*
* Copyright (c) 2002 Cedric Berger
@@ -88,7 +89,13 @@ static const char *istats_text[2][2][2] = {
#define CREATE_TABLE do { \
table.pfrt_flags |= PFR_TFLAG_PERSIST; \
- RVTEST(pfr_add_tables(&table, 1, &nadd, flags)); \
+ if ((!(opts & PF_OPT_NOACTION) || \
+ (opts & PF_OPT_DUMMYACTION)) && \
+ (pfr_add_tables(&table, 1, &nadd, flags)) && \
+ (errno != EPERM)) { \
+ radix_perror(); \
+ goto _error; \
+ } \
if (nadd) { \
warn_namespace_collision(table.pfrt_name); \
xprintf(opts, "%d table created", nadd); \