Revert "utils: use common code for apply_rules and apply_cipso"

This reverts commit 68e38ff3936597a3189d29f57a68dae5ac08db1e.
Merge branch 'v1.0.x'
Revert "libsmack: clean up redundant stuff"

This reverts commit d6f8c52011013f536b7171c2d1f3e9c5ecfaf2f9.
libsmack: clean up redundant stuff

Cleaned up redundant constants and code. Grouped related constants
nearby each other.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
(cherry picked from commit d6f8c52011013f536b7171c2d1f3e9c5ecfaf2f9)
libsmack: Improved getting and setting

Adds the function 'smack_set_label_to_path' to the library.
That new function validate the label before setting it.

Fixes a bug in function 'smack_new_label_from_path' whose
specification stated that the length of the label is returned
but that returned zero. Also take into account a strange
behaviour of the LSM Smack to returns the effective length.

Change-Id: Ia5e3a7f59691d124984721e5392e70322426515b
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
chsmack: Use of libsmack for operations

This commit focuses on using libsmack to perform its operations.
The operations done by libsmack are: validating, reading and writing
labels.

It also adds the isolation of the usage message and the use of
the predefined key values from <linux/xattr.h>

Change-Id: Id67698d823c71ebdc4aeced4c371dcb95f7c7ea9
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
libsmack: Add function smack_remove_label_for_path

Change-Id: I11ad508d45e527085618c6572ff4072e924bba34
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
chsmack: adding options --remove and --dereference

Using the option --remove (-d), chsmack is able to delete
the security tags specified or the all if none is set.
(See issue #28).

The option --dereference (-L) indicates that the symbolic
links have to be followed, that is their target that will
be altered.

Change-Id: I33d1a4824f7f3f10b0ba3d621a311c6e665137e6
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>