Use xattr.h from libc, not from libattr.

This fixes include in libsmack.c introduced in commit f409c17.
fix: smack_new_from_path() follow parameter

Mistake in smack_new_from_path(). When follow is true getxattr()
should be called and lgetxattr() otherwise.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Return length of the label on success in smack_new_label_from*

Return length of the label on success and negative value on
failure.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Added missing smack_new_label_from_path symbol to libsmack.sym

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
smack_new_label_from_path fix: removed const specifier

Label parameter had const specifier by mistake.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Merge pull request #12 from rafal-krypa/samsung

Use xattr.h from libc, not from libattr.
Removed smackd and smackctl.

For shell usage smackload is enough so we don't want to be these as
part of the 1.0 release. systemd has built-in support for loading
SMACK rules.
Documentation fixes

* Added doc/smack_new_label_from_path.3.
* Fixed doxygen warnings from smack.h.
Added smackctl back.

Added smackctl back because Debian needs it.
LIBSMACK -> LIBSMAC_1.0 in libsmack.sym

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Removed doc/smackd.8 from debian/smack-utils.manpages
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.