* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_ALLOW);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = util_filter_output(&opts, ctx);
if (rc)
* read, write, exit, and rt_sigreturn
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
-
+ return ENOMEM;
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0);
if (rc != 0)
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 1,
SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <limits.h>
#include <unistd.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0);
if (rc != 0)
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <limits.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
/* NOTE - syscalls referenced by number to make the test simpler */
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0);
if (rc != 0)
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
/* The next three seccomp_rule_add_exact() calls for read must
* go together in this order to catch an infinite loop. */
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
/* the syscall and argument numbers are all fake to make the test
* simpler */
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
/* the syscall and argument numbers are all fake to make the test
* simpler */
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
/* the syscall and argument numbers are all fake to make the test
* simpler */
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
-#include <unistd.h>
#include <errno.h>
+#include <unistd.h>
#include <seccomp.h>
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
/* the syscall and argument numbers are all fake to make the test
* simpler */
ctx = seccomp_init(SCMP_ACT_ALLOW);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_attr_get(ctx, SCMP_FLTATR_ACT_DEFAULT, &val);
if (rc != 0)
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
-
+ return ENOMEM;
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0);
if (rc != 0)
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <string.h>
#include <seccomp.h>
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
-#include <unistd.h>
#include <errno.h>
+#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
if (rc != 0)
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
-#include <unistd.h>
#include <errno.h>
+#include <unistd.h>
#include <seccomp.h>
goto out_all;
ctx_32 = seccomp_init(SCMP_ACT_KILL);
- if (ctx_32 == NULL)
+ if (ctx_32 == NULL) {
+ rc = -ENOMEM;
goto out_all;
+ }
ctx_64 = seccomp_init(SCMP_ACT_KILL);
- if (ctx_64 == NULL)
+ if (ctx_64 == NULL) {
+ rc = -ENOMEM;
goto out_all;
+ }
rc = seccomp_arch_remove(ctx_32, SCMP_ARCH_NATIVE);
if (rc != 0)
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_ALLOW);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, SCMP_SYS(read), 1,
SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
if (rc != 0)
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(action);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
+
rc = seccomp_rule_add_exact(ctx,
SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
if (rc != 0)
SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0);
if (rc != 0)
goto out;
+
rc = seccomp_load(ctx);
if (rc != 0)
goto out;
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_TRAP);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
+
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0);
if (rc != 0)
goto out;
SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0);
if (rc != 0)
goto out;
+
rc = seccomp_load(ctx);
if (rc != 0)
goto out;
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
arg_cmp = SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO);
rc = seccomp_rule_add_exact_array(ctx, SCMP_ACT_ALLOW,
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
if (rc != 0)
ctx = seccomp_init(SCMP_ACT_TRAP);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
+
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1,
SCMP_A0(SCMP_CMP_EQ, fd));
if (rc != 0)
SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0);
if (rc != 0)
goto out;
+
rc = seccomp_load(ctx);
if (rc != 0)
goto out;
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <stdlib.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, 10, 2,
SCMP_A0(SCMP_CMP_EQ, 11),
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
if (rc != 0)