In ugidfw(8), print the rule number and rule contents (as parsed and then

regenerated in libugidfw) rather than simply printing that the rule was
added with only the number.  This makes ugidfw(8) behave a bit more like
ipfw(8), and also means that the administrator sees how the rule was
interpreted once uids/gids/etc were processed.

Obtained from:	TrustedBSD Project
This commit is contained in:
Robert Watson 2008-12-24 22:40:13 +00:00
parent c494cd1e77
commit a8879d0d7d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=186480

View File

@ -71,7 +71,7 @@ usage(void)
void
add_rule(int argc, char *argv[])
{
char errstr[BUFSIZ];
char errstr[BUFSIZ], charstr[BUFSIZ];
struct mac_bsdextended_rule rule;
int error, rulenum;
@ -86,7 +86,10 @@ add_rule(int argc, char *argv[])
warnx("%s", errstr);
return;
}
printf("Added rule %d\n", rulenum);
if (bsde_rule_to_string(&rule, charstr, BUFSIZ) == -1)
warnx("Added rule, but unable to print string.");
else
printf("%d %s\n", rulenum, charstr);
}
void