summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2002-02-28 15:51:18 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2002-02-28 15:51:18 +0000
commit0d4fb3e8e446d2521023a24da7748f9a8647caa4 (patch)
tree0581aa8d46b2decc0b06594873fe353da9a1b0e5 /sbin/pfctl
parent83ab906b7f4e09fec010a491ba78be6743e13c1a (diff)
Don't force /dev/pf to be opened read-write for pfctl -t/-m when values
are only queried but not set.
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/pfctl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 175f0b78244..cd649865409 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.53 2002/02/27 18:11:45 dhartmei Exp $ */
+/* $OpenBSD: pfctl.c,v 1.54 2002/02/28 15:51:17 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -840,7 +840,8 @@ main(int argc, char *argv[])
break;
case 'm':
limitopt = optarg;
- mode = O_RDWR;
+ if (strchr(limitopt, '=') != NULL)
+ mode = O_RDWR;
break;
case 'n':
opts |= PF_OPT_NOACTION;
@@ -862,7 +863,8 @@ main(int argc, char *argv[])
break;
case 't':
timeoutopt = optarg;
- mode = O_RDWR;
+ if (strchr(timeoutopt, '=') != NULL)
+ mode = O_RDWR;
break;
case 'v':
opts |= PF_OPT_VERBOSE;