Re: pfctl: Refine error message

2020-01-15 Thread Alexandr Nedvedicky
On Wed, Jan 15, 2020 at 04:44:55PM +0100, Klemens Nanni wrote:
> While code in pf/pfctl confusingly uses either anchor or ruleset
> depending on the context, pfctl(8) (both manual and user interface)
> should be consistent.  There should be no difference between anchor and
> ruleset for users, implying there is one only makes for confusion:
> 
>   # pfctl -a regress -Fa
>   pfctl: Anchor or Ruleset does not exist.
> 
> The synopsis itself is `-a anchor' and with the other diff this error
> message format should be well in line with how we use err(3) across the
> tree.
> 
>   # ./obj/pfctl -a regress -Fa
>   pfctl: Anchor does not exist
> 
> OK?

makes sense.

OK sashan



pfctl: Refine error message

2020-01-15 Thread Klemens Nanni
While code in pf/pfctl confusingly uses either anchor or ruleset
depending on the context, pfctl(8) (both manual and user interface)
should be consistent.  There should be no difference between anchor and
ruleset for users, implying there is one only makes for confusion:

# pfctl -a regress -Fa
pfctl: Anchor or Ruleset does not exist.

The synopsis itself is `-a anchor' and with the other diff this error
message format should be well in line with how we use err(3) across the
tree.

# ./obj/pfctl -a regress -Fa
pfctl: Anchor does not exist

OK?


Index: pfctl_radix.c
===
RCS file: /cvs/src/sbin/pfctl/pfctl_radix.c,v
retrieving revision 1.35
diff -u -p -r1.35 pfctl_radix.c
--- pfctl_radix.c   28 Jun 2019 13:32:45 -  1.35
+++ pfctl_radix.c   15 Jan 2020 15:44:42 -
@@ -568,7 +568,7 @@ pfr_strerror(int errnum)
case ESRCH:
return "Table does not exist";
case ENOENT:
-   return "Anchor or Ruleset does not exist";
+   return "Anchor does not exist";
default:
return strerror(errnum);
}