summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2003-12-24 13:04:04 +0000
committermaxim <maxim@FreeBSD.org>2003-12-24 13:04:04 +0000
commit912d84fa39ca176c72b4a298434a9608a5b24a36 (patch)
tree17bcfa115ec5dd98737a43e0eaadd72a729c1e1a /sbin/ipfw
parent36f747d768607e88238c6a9f8815d0ecf658d207 (diff)
downloadFreeBSD-src-912d84fa39ca176c72b4a298434a9608a5b24a36.zip
FreeBSD-src-912d84fa39ca176c72b4a298434a9608a5b24a36.tar.gz
o Legitimate -f (force) flags for -p (preprocessor) case.
PR: bin/60433 Submitted: Bjoern A. Zeeb MFC after: 3 weeks
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/ipfw.82
-rw-r--r--sbin/ipfw/ipfw2.c11
2 files changed, 9 insertions, 4 deletions
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8
index cc60303..0d6f50f 100644
--- a/sbin/ipfw/ipfw.8
+++ b/sbin/ipfw/ipfw.8
@@ -54,7 +54,7 @@
.Op Ar number ...
.Pp
.Nm
-.Op Fl cnNqS
+.Op Fl cfnNqS
.Oo
.Fl p Ar preproc
.Oo
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 6a151e7..88a36db 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -63,6 +63,7 @@ int
do_dynamic, /* display dynamic rules */
do_expired, /* display expired dynamic rules */
do_compact, /* show rules in compact mode */
+ do_force, /* do not ask for confirmation */
show_sets, /* display rule sets */
test_only, /* only check syntax */
comment_only, /* only print action and comment */
@@ -3593,7 +3594,6 @@ ipfw_main(int oldac, char **oldav)
int ch, ac, save_ac;
char **av, **save_av;
int do_acct = 0; /* Show packet/byte count */
- int do_force = 0; /* Don't ask for confirmation */
#define WHITESP " \t\f\v\n\r"
if (oldac == 0)
@@ -3678,7 +3678,8 @@ ipfw_main(int oldac, char **oldav)
}
/* Set the force flag for non-interactive processes */
- do_force = !isatty(STDIN_FILENO);
+ if (!do_force)
+ do_force = !isatty(STDIN_FILENO);
/* Save arguments for final freeing of memory. */
save_ac = ac;
@@ -3840,12 +3841,16 @@ ipfw_readfile(int ac, char *av[])
filename = av[ac-1];
- while ((c = getopt(ac, av, "cNnp:qS")) != -1) {
+ while ((c = getopt(ac, av, "cfNnp:qS")) != -1) {
switch(c) {
case 'c':
do_compact = 1;
break;
+ case 'f':
+ do_force = 1;
+ break;
+
case 'N':
do_resolv = 1;
break;
OpenPOWER on IntegriCloud