Minor style tweaks.
This commit is contained in:
parent
7b3a18a595
commit
e6f6fc88e2
@ -121,8 +121,8 @@ SYSCTL_INT(_security_mac_biba, OID_AUTO, max_compartments, CTLFLAG_RD,
|
||||
&max_compartments, 0, "Maximum supported compartments");
|
||||
|
||||
static int ptys_equal = 0;
|
||||
SYSCTL_INT(_security_mac_biba, OID_AUTO, ptys_equal, CTLFLAG_RW,
|
||||
&ptys_equal, 0, "Label pty devices as biba/equal on create");
|
||||
SYSCTL_INT(_security_mac_biba, OID_AUTO, ptys_equal, CTLFLAG_RW, &ptys_equal,
|
||||
0, "Label pty devices as biba/equal on create");
|
||||
TUNABLE_INT("security.mac.biba.ptys_equal", &ptys_equal);
|
||||
|
||||
static int interfaces_equal;
|
||||
@ -638,12 +638,10 @@ biba_parse_element(struct mac_biba_element *element, char *string)
|
||||
char *compartment, *end, *grade;
|
||||
int value;
|
||||
|
||||
if (strcmp(string, "high") == 0 ||
|
||||
strcmp(string, "hi") == 0) {
|
||||
if (strcmp(string, "high") == 0 || strcmp(string, "hi") == 0) {
|
||||
element->mbe_type = MAC_BIBA_TYPE_HIGH;
|
||||
element->mbe_grade = MAC_BIBA_TYPE_UNDEF;
|
||||
} else if (strcmp(string, "low") == 0 ||
|
||||
strcmp(string, "lo") == 0) {
|
||||
} else if (strcmp(string, "low") == 0 || strcmp(string, "lo") == 0) {
|
||||
element->mbe_type = MAC_BIBA_TYPE_LOW;
|
||||
element->mbe_grade = MAC_BIBA_TYPE_UNDEF;
|
||||
} else if (strcmp(string, "equal") == 0 ||
|
||||
@ -665,9 +663,8 @@ biba_parse_element(struct mac_biba_element *element, char *string)
|
||||
element->mbe_grade = value;
|
||||
|
||||
/*
|
||||
* Optional compartment piece of the element. If none
|
||||
* are included, we assume that the label has no
|
||||
* compartments.
|
||||
* Optional compartment piece of the element. If none are
|
||||
* included, we assume that the label has no compartments.
|
||||
*/
|
||||
if (string == NULL)
|
||||
return (0);
|
||||
@ -688,8 +685,8 @@ biba_parse_element(struct mac_biba_element *element, char *string)
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: destructively consumes the string, make a local copy before
|
||||
* calling if that's a problem.
|
||||
* Note: destructively consumes the string, make a local copy before calling
|
||||
* if that's a problem.
|
||||
*/
|
||||
static int
|
||||
biba_parse(struct mac_biba *mb, char *string)
|
||||
|
@ -727,8 +727,8 @@ lomac_parse_element(struct mac_lomac_element *element, char *string)
|
||||
} else if (strcmp(string, "low") == 0 || strcmp(string, "lo") == 0) {
|
||||
element->mle_type = MAC_LOMAC_TYPE_LOW;
|
||||
element->mle_grade = MAC_LOMAC_TYPE_UNDEF;
|
||||
} else if (strcmp(string, "equal") == 0 || strcmp(string, "eq") == 0)
|
||||
{
|
||||
} else if (strcmp(string, "equal") == 0 ||
|
||||
strcmp(string, "eq") == 0) {
|
||||
element->mle_type = MAC_LOMAC_TYPE_EQUAL;
|
||||
element->mle_grade = MAC_LOMAC_TYPE_UNDEF;
|
||||
} else {
|
||||
@ -817,8 +817,7 @@ lomac_parse(struct mac_lomac *ml, char *string)
|
||||
}
|
||||
|
||||
if (auxsingle != NULL) {
|
||||
error = lomac_parse_element(&ml->ml_auxsingle,
|
||||
auxsingle);
|
||||
error = lomac_parse_element(&ml->ml_auxsingle, auxsingle);
|
||||
if (error)
|
||||
return (error);
|
||||
ml->ml_flags |= MAC_LOMAC_FLAG_AUX;
|
||||
|
@ -399,14 +399,12 @@ mls_set_range(struct mac_mls *mm, u_short typelow, u_short levellow,
|
||||
mm->mm_rangelow.mme_type = typelow;
|
||||
mm->mm_rangelow.mme_level = levellow;
|
||||
if (compartmentslow != NULL)
|
||||
memcpy(mm->mm_rangelow.mme_compartments,
|
||||
compartmentslow,
|
||||
memcpy(mm->mm_rangelow.mme_compartments, compartmentslow,
|
||||
sizeof(mm->mm_rangelow.mme_compartments));
|
||||
mm->mm_rangehigh.mme_type = typehigh;
|
||||
mm->mm_rangehigh.mme_level = levelhigh;
|
||||
if (compartmentshigh != NULL)
|
||||
memcpy(mm->mm_rangehigh.mme_compartments,
|
||||
compartmentshigh,
|
||||
memcpy(mm->mm_rangehigh.mme_compartments, compartmentshigh,
|
||||
sizeof(mm->mm_rangehigh.mme_compartments));
|
||||
mm->mm_flags |= MAC_MLS_FLAG_RANGE;
|
||||
}
|
||||
@ -689,12 +687,10 @@ mls_parse(struct mac_mls *mm, char *string)
|
||||
}
|
||||
|
||||
if (rangelow != NULL) {
|
||||
error = mls_parse_element(&mm->mm_rangelow,
|
||||
rangelow);
|
||||
error = mls_parse_element(&mm->mm_rangelow, rangelow);
|
||||
if (error)
|
||||
return (error);
|
||||
error = mls_parse_element(&mm->mm_rangehigh,
|
||||
rangehigh);
|
||||
error = mls_parse_element(&mm->mm_rangehigh, rangehigh);
|
||||
if (error)
|
||||
return (error);
|
||||
mm->mm_flags |= MAC_MLS_FLAG_RANGE;
|
||||
@ -736,7 +732,6 @@ mls_copy_label(struct label *src, struct label *dest)
|
||||
*SLOT(dest) = *SLOT(src);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Object-specific entry point implementations are sorted alphabetically by
|
||||
* object type name and then by operation.
|
||||
|
Loading…
x
Reference in New Issue
Block a user