summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2000-10-11 12:17:06 +0000
committerru <ru@FreeBSD.org>2000-10-11 12:17:06 +0000
commitd7a5334858390fe328ad0979367fb34d9e4116da (patch)
treeed0bafa90404166e5ef04b8b9ed592d5281509cf /sbin
parent4813ffbba1b5860a42ccd4ea14fc9dbbc7520bea (diff)
downloadFreeBSD-src-d7a5334858390fe328ad0979367fb34d9e4116da.zip
FreeBSD-src-d7a5334858390fe328ad0979367fb34d9e4116da.tar.gz
Only interpret the last command line argument as a file to
be preprocessed if it is specified as an absolute pathname. PR: bin/16179
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ipfw/ipfw.810
-rw-r--r--sbin/ipfw/ipfw.c2
2 files changed, 7 insertions, 5 deletions
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8
index 234c1d3..3e50043 100644
--- a/sbin/ipfw/ipfw.8
+++ b/sbin/ipfw/ipfw.8
@@ -20,7 +20,7 @@
.Oc
.Op Fl U Ar macro
.Oc
-.Ar file
+.Ar pathname
.Nm ipfw
.Op Fl f | q
.Cm flush
@@ -207,8 +207,10 @@ To ease configuration, rules can be put into a file which is
processed using
.Nm
as shown in the first synopsis line.
-The
-.Ar file
+An absolute
+.Ar pathname
+must be used.
+The file
will be read line by line and applied as arguments to the
.Nm
utility.
@@ -216,7 +218,7 @@ utility.
Optionally, a preprocessor can be specified using
.Fl p Ar preproc
where
-.Ar file
+.Ar pathname
is to be piped through.
Useful preprocessors include
.Xr cpp 1
diff --git a/sbin/ipfw/ipfw.c b/sbin/ipfw/ipfw.c
index 27012eb..0c0f02a 100644
--- a/sbin/ipfw/ipfw.c
+++ b/sbin/ipfw/ipfw.c
@@ -2363,7 +2363,7 @@ main(ac, av)
* directory, things will fail miserably.
*/
- if (ac > 1 && access(av[ac - 1], R_OK) == 0) {
+ if (ac > 1 && av[ac - 1][0] == '/' && access(av[ac - 1], R_OK) == 0) {
qflag = pflag = i = 0;
lineno = 0;
OpenPOWER on IntegriCloud