Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jun 2011 06:50:09 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-ipfw@FreeBSD.org
Subject:   Re: bin/156653: commit references a PR
Message-ID:  <201106290650.p5T6o9rL037020@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/156653; it has been noted by GNATS.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/156653: commit references a PR
Date: Wed, 29 Jun 2011 06:45:58 +0000 (UTC)

 Author: ae
 Date: Wed Jun 29 06:45:44 2011
 New Revision: 223661
 URL: http://svn.freebsd.org/changeset/base/223661
 
 Log:
   Improve error reporting. Use corresponding error message when file to be
   preprocessed is missing. Also suggest to use absolute pathname if -p option
   is specified.
   
   PR:             bin/156653
   MFC after:      2 weeks
 
 Modified:
   head/sbin/ipfw/main.c
 
 Modified: head/sbin/ipfw/main.c
 ==============================================================================
 --- head/sbin/ipfw/main.c	Wed Jun 29 05:41:14 2011	(r223660)
 +++ head/sbin/ipfw/main.c	Wed Jun 29 06:45:44 2011	(r223661)
 @@ -262,7 +262,7 @@ ipfw_main(int oldac, char **oldav)
  	save_av = av;
  
  	optind = optreset = 1;	/* restart getopt() */
 -	while ((ch = getopt(ac, av, "abcdefhinNqs:STtv")) != -1)
 +	while ((ch = getopt(ac, av, "abcdefhinNp:qs:STtv")) != -1)
  		switch (ch) {
  		case 'a':
  			do_acct = 1;
 @@ -306,6 +306,10 @@ ipfw_main(int oldac, char **oldav)
  			co.do_resolv = 1;
  			break;
  
 +		case 'p':
 +			errx(EX_USAGE, "An absolute pathname must be used "
 +			    "with -p option.");
 +
  		case 'q':
  			co.do_quiet = 1;
  			break;
 @@ -603,9 +607,12 @@ main(int ac, char *av[])
  	 * as a file to be preprocessed.
  	 */
  
 -	if (ac > 1 && av[ac - 1][0] == '/' && access(av[ac - 1], R_OK) == 0)
 -		ipfw_readfile(ac, av);
 -	else {
 +	if (ac > 1 && av[ac - 1][0] == '/') {
 +		if (access(av[ac - 1], R_OK) == 0)
 +			ipfw_readfile(ac, av);
 +		else
 +			err(EX_USAGE, "pathname: %s", av[ac - 1]);
 +	} else {
  		if (ipfw_main(ac, av)) {
  			errx(EX_USAGE,
  			    "usage: ipfw [options]\n"
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106290650.p5T6o9rL037020>