FreeBSD Bugzilla – Attachment 203222 Details for
Bug 236857
Fix sysctl check for some sys/audit/process-control tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch (with errno) to skip tests if kernel build without CAPABILITIES
tests_sys_audit_process-control-ERRNO.diff (text/plain), 1.30 KB, created by
Olivier Cochard
on 2019-03-28 20:24:11 UTC
(
hide
)
Description:
patch (with errno) to skip tests if kernel build without CAPABILITIES
Filename:
MIME Type:
Creator:
Olivier Cochard
Created:
2019-03-28 20:24:11 UTC
Size:
1.30 KB
patch
obsolete
>Index: tests/sys/audit/process-control.c >=================================================================== >--- tests/sys/audit/process-control.c (revision 345541) >+++ tests/sys/audit/process-control.c (working copy) >@@ -40,6 +40,7 @@ > #include <sys/wait.h> > > #include <atf-c.h> >+#include <errno.h> > #include <fcntl.h> > #include <signal.h> > #include <stdint.h> >@@ -1515,8 +1516,10 @@ > int capinfo; > size_t len = sizeof(capinfo); > const char *capname = "kern.features.security_capability_mode"; >- ATF_REQUIRE_EQ(0, sysctlbyname(capname, &capinfo, &len, NULL, 0)); > >+ if (sysctlbyname(capname, &capinfo, &len, NULL, 0) == -1) >+ atf_tc_skip("sysctl for %s failed: %s", capname, strerror(errno)); >+ > /* Without CAPABILITY_MODE enabled, cap_enter() returns ENOSYS */ > if (!capinfo) > atf_tc_skip("Capsicum is not enabled in the system"); >@@ -1553,8 +1556,10 @@ > int capinfo, modep; > size_t len = sizeof(capinfo); > const char *capname = "kern.features.security_capability_mode"; >- ATF_REQUIRE_EQ(0, sysctlbyname(capname, &capinfo, &len, NULL, 0)); > >+ if (sysctlbyname(capname, &capinfo, &len, NULL, 0) == -1) >+ atf_tc_skip("sysctl for %s failed: %s", capname, strerror(errno)); >+ > /* Without CAPABILITY_MODE enabled, cap_getmode() returns ENOSYS */ > if (!capinfo) > atf_tc_skip("Capsicum is not enabled in the system");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 236857
:
203217
|
203222
|
203223
|
203226
|
203241