|
Lines 1515-1522
Link Here
|
| 1515 |
int capinfo; |
1515 |
int capinfo; |
| 1516 |
size_t len = sizeof(capinfo); |
1516 |
size_t len = sizeof(capinfo); |
| 1517 |
const char *capname = "kern.features.security_capability_mode"; |
1517 |
const char *capname = "kern.features.security_capability_mode"; |
| 1518 |
ATF_REQUIRE_EQ(0, sysctlbyname(capname, &capinfo, &len, NULL, 0)); |
|
|
| 1519 |
|
1518 |
|
|
|
1519 |
if (sysctlbyname(capname, &capinfo, &len, NULL, 0) == -1) |
| 1520 |
atf_tc_skip("sysctl %s doesn't exist", capname); |
| 1521 |
|
| 1520 |
/* Without CAPABILITY_MODE enabled, cap_enter() returns ENOSYS */ |
1522 |
/* Without CAPABILITY_MODE enabled, cap_enter() returns ENOSYS */ |
| 1521 |
if (!capinfo) |
1523 |
if (!capinfo) |
| 1522 |
atf_tc_skip("Capsicum is not enabled in the system"); |
1524 |
atf_tc_skip("Capsicum is not enabled in the system"); |
|
Lines 1553-1560
Link Here
|
| 1553 |
int capinfo, modep; |
1555 |
int capinfo, modep; |
| 1554 |
size_t len = sizeof(capinfo); |
1556 |
size_t len = sizeof(capinfo); |
| 1555 |
const char *capname = "kern.features.security_capability_mode"; |
1557 |
const char *capname = "kern.features.security_capability_mode"; |
| 1556 |
ATF_REQUIRE_EQ(0, sysctlbyname(capname, &capinfo, &len, NULL, 0)); |
|
|
| 1557 |
|
1558 |
|
|
|
1559 |
if (sysctlbyname(capname, &capinfo, &len, NULL, 0) == -1) |
| 1560 |
atf_tc_skip("sysctl %s doesn't exist", capname); |
| 1561 |
|
| 1558 |
/* Without CAPABILITY_MODE enabled, cap_getmode() returns ENOSYS */ |
1562 |
/* Without CAPABILITY_MODE enabled, cap_getmode() returns ENOSYS */ |
| 1559 |
if (!capinfo) |
1563 |
if (!capinfo) |
| 1560 |
atf_tc_skip("Capsicum is not enabled in the system"); |
1564 |
atf_tc_skip("Capsicum is not enabled in the system"); |