Smack: don't show empty rules when /smack/load or /smack/load2 is read
authorRafal Krypa <r.krypa@samsung.com>
Mon, 9 Jul 2012 17:36:34 +0000 (19:36 +0200)
committerElena Reshetova <elena.reshetova@intel.com>
Fri, 19 Oct 2012 10:48:02 +0000 (13:48 +0300)
commit31cad4f622b2ec2b7911a136fb8d05714534d23d
treed536da3f9dd7223ec2801d7efe56d07c9288f14c
parentb1e59c1fdcb84152cce407333776c49eb8ab707a
Smack: don't show empty rules when /smack/load or /smack/load2 is read

This patch removes empty rules (i.e. with access set to '-') from the
rule list presented to user space.

Smack by design never removes labels nor rules from its lists. Access
for a rule may be set to '-' to effectively disable it. Such rules would
show up in the listing generated when /smack/load or /smack/load2 is
read. This may cause clutter if many rules were disabled.

As a rule with access set to '-' is equivalent to no rule at all, they
may be safely hidden from the listing.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
security/smack/smackfs.c