From 0d4fb3e8e446d2521023a24da7748f9a8647caa4 Mon Sep 17 00:00:00 2001 From: Daniel Hartmeier Date: Thu, 28 Feb 2002 15:51:18 +0000 Subject: Don't force /dev/pf to be opened read-write for pfctl -t/-m when values are only queried but not set. --- sbin/pfctl/pfctl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sbin/pfctl') 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; -- cgit v1.2.3