From owner-svn-src-all@FreeBSD.ORG Wed Dec 24 22:40:13 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C526106564A; Wed, 24 Dec 2008 22:40:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 497D68FC1E; Wed, 24 Dec 2008 22:40:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBOMeD0B096672; Wed, 24 Dec 2008 22:40:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBOMeDGS096671; Wed, 24 Dec 2008 22:40:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200812242240.mBOMeDGS096671@svn.freebsd.org> From: Robert Watson Date: Wed, 24 Dec 2008 22:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186480 - head/usr.sbin/ugidfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Dec 2008 22:40:13 -0000 Author: rwatson Date: Wed Dec 24 22:40:13 2008 New Revision: 186480 URL: http://svn.freebsd.org/changeset/base/186480 Log: 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 Modified: head/usr.sbin/ugidfw/ugidfw.c Modified: head/usr.sbin/ugidfw/ugidfw.c ============================================================================== --- head/usr.sbin/ugidfw/ugidfw.c Wed Dec 24 19:57:22 2008 (r186479) +++ head/usr.sbin/ugidfw/ugidfw.c Wed Dec 24 22:40:13 2008 (r186480) @@ -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