Cleaned up init code.

There was lot of clutter and misleading comments in the code
and some minor coding convention issues. This patch cleans up
init.c for the most part.
libsmack: clean up smack_accesses_add_modify()

This patch makes smack_accesses_add_modify() easier to follow by
changing variable names bit more self-documentative and less easier
to mix up with adding and deleting rules. This patch also fixes some
very minor coding style errors.

Also documentation of this function is cleaned up.
Fixes for doxygen errors coming from 3810596.

Doxygen errors that are regression from 3810596. Went in because
I forgot to install doxygen into my test environment.
Documented order in which access rules are applied to kernel.
Fix: allow CIPSO labels with zero categories

There was false restriction in smack_cipso_add_from_file() that
disallowed CIPSO labels without categories.

For example, this example given in the SMACK kernel documentation
should be perfectly legal:

TopSecret 7
Change apply_cipso_cb() to use proper apply_cipso_file()

apply_cipso_cb() used improper apply_rules_file(). Changed this to
call apply_cipso_file() instead.
Merge branch 'cipso_bug' of git://github.com/zos/smack into zos-cipso_bug
Fix: accept 255 character labels

Example:

 # /home/jsakkine/devel/smack/utils/chsmack \
   -a$(printf '12345%.0s' {1..51}) foo
 foo: Invalid argument
 # /home/jsakkine/devel/smack/utils/chsmack \
   -a$(printf '12345%.0s' {1..51} | head -c -1) foo
 #

This patch fixes this issue.
utils/chsmack: fix hazardous option parsing

The variable option_index was only set to a proper value if the
given option is a long option. There was also exit() missing on
error condition if SMACK label was invalid.

This patch removes option_index, parameter name from corresponding
error message and adds exit() call when the error condition
realizes.

[jarkko.sakkinen@linux.intel.com: rewrote patch description]
Add parameter name back to the chsmack error message

This patch add parameter name back to the error message. Instead
of relaying on hazardous longindex parameter of getopt_long(), a
look-up table is constructed to map short option to the corresponding
struct option entry.

Additionally, the basename of the application is added to the error
message. Also usage message is converted to use basename instead of
the full path name.
Cleaning error logs for rules applying utilities

Removed perror logs from main utilities files. Moved error logs
inside /utils/common.c. Errors are logged from I/O operations and
applying rules/cipso from files.
Add smack_label_length() function

Kernel does not validate the Smack label - instead the label will be
cut on the first incorrect character (after parsing at least one
correct character).

This function gives the user possibility to verify the correctness
of the Smack label before use and calculate labels length.

Additionally, all string length calculations are replaces with this
function to make implementation safer.

[jarkko.sakkinen@linux.intel.com:
 did some modifications:
 - smack_is_label_valid() -> smack_label_length()
 - libsmack.c:
   * return length
   * loop invariant had off-by-one error
   * cosmetic: "++i" not "i++"
 - libsmack.h:
   * updated documentation
   * cosmetic: formatting errors in  @param and @return]
Fix value returned by smack_label_length()

In some cases smack_label_length have returned 0 on incorrect label.
Now smack_label_length() always returns -1 in case of incorrect label.
Use smack_label_length() internally instead strnlen()

Use smack_label_length() to check correctness labels
instead strnlen().