libsmack: early fail in accesses_apply() if modify rules are not supported

In accesses_apply(), in the beginning of each iteration, check
that change_fd is a valid file descriptor if the current rule
is a modify rule. Return with -1 immediately if that is not the
case.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
libsmack: check in accesses_apply() that rule has short labels

Check rule has short labels when only 'load' is available.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
libsmack: remove redundant strlen() call from accesses_apply()

Return value of snprintf() should give the same length as strlen()
would given that string fits into buffer.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
libsmack: remove redundant check for clear flag form accesses_apply()

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
libsmack: fix smack_cipso_apply() failing with more than one rule

Fixing regression in f47b9c90 that causes smack_cipso_apply() to fail due
to a typo.

Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
smackctl: fix reporting "unknown action" (regression in ce452ab)

Running "smackctl apply" and "smackctl clear" ended with error and
message about unknown action, although the action was known and
performed successfully.

Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
Merge remote-tracking branch 'rafal-krypa/issue70' into v1.0.x
Merge remote-tracking branch 'jsakkine/issue60' into v1.0.x