Functions smack_?setlabel() will return successfully after trying to remove
from file a label, that wasn't set.
Change-Id: Ic7396e3efe457bceca39c8fc5ab9b1151552e795
setxattr_func setfunc, removexattr_func removefunc)
{
char* xattr_name = get_xattr_name(type);
+ int ret;
/* Check validity of labels for LABEL_TRANSMUTE */
if (type == SMACK_LABEL_TRANSMUTE && label != NULL) {
}
if (label == NULL || label[0] == '\0') {
- return removefunc(file, xattr_name);
+ ret = removefunc(file, xattr_name);
+ if (ret == -1 && errno == ENODATA)
+ return 0;
+ return ret;
} else {
int len = strnlen(label, SMACK_LABEL_LEN + 1);
if (len > SMACK_LABEL_LEN)