struct smack_rule *rule = NULL;
if (strnlen(subject, SMACK_LABEL_LEN + 1) > SMACK_LABEL_LEN ||
- strnlen(object, SMACK_LABEL_LEN + 1) > SMACK_LABEL_LEN) {
- errno = ERANGE;
+ strnlen(object, SMACK_LABEL_LEN + 1) > SMACK_LABEL_LEN)
return -1;
- }
rule = calloc(sizeof(struct smack_rule), 1);
if (rule == NULL)
struct smack_rule *rule = NULL;
if (strnlen(subject, SMACK_LABEL_LEN + 1) > SMACK_LABEL_LEN ||
- strnlen(object, SMACK_LABEL_LEN + 1) > SMACK_LABEL_LEN) {
- errno = ERANGE;
+ strnlen(object, SMACK_LABEL_LEN + 1) > SMACK_LABEL_LEN)
return -1;
- }
rule = calloc(sizeof(struct smack_rule), 1);
if (rule == NULL)
if (subject == NULL || object == NULL || access == NULL ||
strtok_r(NULL, " \t\n", &ptr) != NULL) {
- errno = EINVAL;
fclose(file);
return -1;
}
int access2 = 1;
char path[PATH_MAX];
- if (!smackfs_mnt) {
- errno = EFAULT;
+ if (!smackfs_mnt)
return -1;
- }
snprintf(path, sizeof path, "%s/access2", smackfs_mnt);
fd = open(path, O_RDWR);
char path[PATH_MAX];
int offset=0;
- if (!smackfs_mnt) {
- errno = EFAULT;
+ if (!smackfs_mnt)
return -1;
- }
snprintf(path, sizeof path, "%s/cipso2", smackfs_mnt);
fd = open(path, O_WRONLY);
level = strtok_r(NULL, " \t\n", &ptr);
cat = strtok_r(NULL, " \t\n", &ptr);
if (label == NULL || level == NULL ||
- strlen(label) > SMACK_LABEL_LEN) {
- errno = EINVAL;
+ strlen(label) > SMACK_LABEL_LEN)
goto err_out;
- }
strcpy(mapping->label, label);
if (errno)
goto err_out;
- if (val < 0 || val > LEVEL_MAX) {
- errno = ERANGE;
+ if (val < 0 || val > LEVEL_MAX)
goto err_out;
- }
mapping->level = val;
if (errno)
goto err_out;
- if (val < 0 || val > CAT_MAX_VALUE) {
- errno = ERANGE;
+ if (val < 0 || val > CAT_MAX_VALUE)
goto err_out;
- }
mapping->cats[i] = val;
int load2 = 1;
char path[PATH_MAX];
- if (!smackfs_mnt) {
- errno = EFAULT;
+ if (!smackfs_mnt)
return -1;
- }
snprintf(path, sizeof path, "%s/load2", smackfs_mnt);
load_fd = open(path, O_WRONLY);