Prevent potentially unterminated buffers while adding rule to the list

Functions smack_accesses_add() and smack_accesses_add_modify() don't check
length of arguments subject and object. These arguments are used as source
for strncpy(), which can cause labels to be truncated.

But the length argument for strncpy() is too large. This might cause
rule->subject or rule->object to be not terminated by null character.
It can happen when these functions are called from outside libsmack.
It can also happen while parsing files in smack_accesses_add_from_file(),
because that function doesn't validate subject and object too.

This commit fixes the problem by checking arguments in smack_accesses_add()
and smack_accesses_add_modify(). After checking strcpy() is safe for
copying them.
Avoid memory allocation while opening smackfs files.

Using openat() on pre-opened smackfs directory eliminates need to construct
absolute path to a smackfs file before opening it.
Merge pull request #13 from rafal-krypa/samsung

Samsung
Cleaned up command line arguments handling in chsmack.

Argument handling code looks terrible at the moment in chsmack.
Migrated to getopt_long().
Added AUTHORS file.
Revert "Avoid memory allocation while opening smackfs files."

This reverts commit 6c1d15b1fe420b848d7afdd0a7ef0c20dfdcc08e.
Removed redundant is_smackfs_mounted().

This functionality is fully handled in the library initialization.
Major documentation cleanup.

smack.h was starting to rotten so I did a major cleanup for it.
Also fixed couple of minor doxygen issues by removing deprecated
variables.
Update version and maintainer information

Set version information to 1.1 for the next libsmack release.
Change maintainer email from @intel.com to @linux.intel.com.
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
Merge remote-tracking branch 'mainline/master'

Conflicts:
	configure.ac
	libsmack/Makefile.am
	libsmack/libsmack.c
	libsmack/sys/smack.h