Changeset View
Changeset View
Standalone View
Standalone View
sys/security/mac_biba/mac_biba.c
Show First 20 Lines • Show All 1,058 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
char tifname[IFNAMSIZ], *p, *q; | char tifname[IFNAMSIZ], *p, *q; | ||||
char tiflist[sizeof(trusted_interfaces)]; | char tiflist[sizeof(trusted_interfaces)]; | ||||
struct mac_biba *dest; | struct mac_biba *dest; | ||||
int len, type; | int len, type; | ||||
dest = SLOT(ifplabel); | dest = SLOT(ifplabel); | ||||
if (ifp->if_type == IFT_LOOP || interfaces_equal != 0) { | if (if_gettype(ifp) == IFT_LOOP || interfaces_equal != 0) { | ||||
type = MAC_BIBA_TYPE_EQUAL; | type = MAC_BIBA_TYPE_EQUAL; | ||||
goto set; | goto set; | ||||
} | } | ||||
if (trust_all_interfaces) { | if (trust_all_interfaces) { | ||||
type = MAC_BIBA_TYPE_HIGH; | type = MAC_BIBA_TYPE_HIGH; | ||||
goto set; | goto set; | ||||
} | } | ||||
Show All 10 Lines | if(*p != ' ' && *p != '\t') | ||||
*q = *p; | *q = *p; | ||||
for (p = q = tiflist;; p++) { | for (p = q = tiflist;; p++) { | ||||
if (*p == ',' || *p == '\0') { | if (*p == ',' || *p == '\0') { | ||||
len = p - q; | len = p - q; | ||||
if (len < IFNAMSIZ) { | if (len < IFNAMSIZ) { | ||||
bzero(tifname, sizeof(tifname)); | bzero(tifname, sizeof(tifname)); | ||||
bcopy(q, tifname, len); | bcopy(q, tifname, len); | ||||
if (strcmp(tifname, ifp->if_xname) == 0) { | if (strcmp(tifname, if_name(ifp)) == 0) { | ||||
type = MAC_BIBA_TYPE_HIGH; | type = MAC_BIBA_TYPE_HIGH; | ||||
break; | break; | ||||
} | } | ||||
} else { | } else { | ||||
*p = '\0'; | *p = '\0'; | ||||
printf("mac_biba warning: interface name " | printf("mac_biba warning: interface name " | ||||
"\"%s\" is too long (must be < %d)\n", | "\"%s\" is too long (must be < %d)\n", | ||||
q, IFNAMSIZ); | q, IFNAMSIZ); | ||||
▲ Show 20 Lines • Show All 2,697 Lines • Show Last 20 Lines |