summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl.c
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2018-09-18 12:55:20 +0000
committerkn <kn@cvs.openbsd.org>2018-09-18 12:55:20 +0000
commitc09bfa81e4c2b26d2b435f8ba4ccdb46abd2055e (patch)
treec6d9d67501c0495ca21800dce4c0b4f252142eb1 /sbin/pfctl/pfctl.c
parentceb161aab56e6c9f725eb7b775406e45a2d65be5 (diff)
fix table commands under anchors
With r1.358 I simplified anchor handling but also broke semantics with regard to tables: # pfctl -a aname -t tname -T show pfctl: anchors apply to -f, -F and -s only Unbreak this by checking for table commands as well. OK bluhm
Diffstat (limited to 'sbin/pfctl/pfctl.c')
-rw-r--r--sbin/pfctl/pfctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index b08f7302337..bf7120d9083 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.359 2018/09/08 14:45:55 kn Exp $ */
+/* $OpenBSD: pfctl.c,v 1.360 2018/09/18 12:55:19 kn Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -2498,11 +2498,11 @@ main(int argc, char *argv[])
memset(anchorname, 0, sizeof(anchorname));
if (anchoropt != NULL) {
- if (mode == O_RDONLY && showopt == NULL) {
- warnx("anchors apply to -f, -F and -s only");
+ if (mode == O_RDONLY && showopt == NULL && tblcmdopt == NULL) {
+ warnx("anchors apply to -f, -F, -s, and -T only");
usage();
}
- if (mode == O_RDWR &&
+ if (mode == O_RDWR && tblcmdopt == NULL &&
(anchoropt[0] == '_' || strstr(anchoropt, "/_") != NULL))
errx(1, "anchor names beginning with '_' cannot "
"be modified from the command line");