From de2e7393d66a31df2f4eec9227423f5b0ab7d3f0 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Wed, 11 Oct 2000 12:17:06 +0000 Subject: [PATCH] Only interpret the last command line argument as a file to be preprocessed if it is specified as an absolute pathname. PR: bin/16179 --- sbin/ipfw/ipfw.8 | 10 ++++++---- sbin/ipfw/ipfw.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index 234c1d35c3c..3e500432e03 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 27012eb5f94..0c0f02ab364 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;