summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ugidfw
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-12-24 22:40:13 +0000
committerrwatson <rwatson@FreeBSD.org>2008-12-24 22:40:13 +0000
commit885540f52ed19c7f6f20cdac7f7354fa9e9dd6c5 (patch)
tree220df2c8c7e4752ee72f56e34f224c94f46b957c /usr.sbin/ugidfw
parentec227891ebf88532712b2408f0fa839e0347afe1 (diff)
downloadFreeBSD-src-885540f52ed19c7f6f20cdac7f7354fa9e9dd6c5.zip
FreeBSD-src-885540f52ed19c7f6f20cdac7f7354fa9e9dd6c5.tar.gz
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
Diffstat (limited to 'usr.sbin/ugidfw')
-rw-r--r--usr.sbin/ugidfw/ugidfw.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/ugidfw/ugidfw.c b/usr.sbin/ugidfw/ugidfw.c
index 24e0228..977922a 100644
--- a/usr.sbin/ugidfw/ugidfw.c
+++ b/usr.sbin/ugidfw/ugidfw.c
@@ -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
OpenPOWER on IntegriCloud