|
Lines 126-150
AC_CHECK_DECL([SECCOMP_MODE_FILTER], [ha
Link Here
|
| 126 |
#include <linux/seccomp.h> |
126 |
#include <linux/seccomp.h> |
| 127 |
]) |
127 |
]) |
| 128 |
fi |
128 |
fi |
| 129 |
if test "x$have_seccomp_filter" = "x1" ; then |
|
|
| 130 |
AC_MSG_CHECKING([kernel for seccomp_filter support]) |
| 131 |
AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
| 132 |
#include <errno.h> |
| 133 |
#include <linux/seccomp.h> |
| 134 |
#include <stdlib.h> |
| 135 |
#include <sys/prctl.h> |
| 136 |
]], |
| 137 |
[[ errno = 0; |
| 138 |
prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0); |
| 139 |
exit(errno == EFAULT ? 0 : 1); ]])], |
| 140 |
[ AC_MSG_RESULT([yes]) ], [ |
| 141 |
AC_MSG_RESULT([no]) |
| 142 |
# Disable seccomp filter as a target |
| 143 |
have_seccomp_filter=0 |
| 144 |
], |
| 145 |
[ AC_MSG_RESULT([cross-compiling, assuming yes]) ] |
| 146 |
) |
| 147 |
fi |
| 148 |
|
129 |
|
| 149 |
use_stack_protector=1 |
130 |
use_stack_protector=1 |
| 150 |
AC_ARG_WITH([stackprotect], |
131 |
AC_ARG_WITH([stackprotect], |
|
Lines 2575-2595
AC_ARG_WITH([sandbox],
Link Here
|
| 2575 |
fi |
2556 |
fi |
| 2576 |
] |
2557 |
] |
| 2577 |
) |
2558 |
) |
|
|
2559 |
SANDBOX_STYLE="" |
| 2578 |
if test "x$sandbox_arg" = "xsystrace" || \ |
2560 |
if test "x$sandbox_arg" = "xsystrace" || \ |
| 2579 |
( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then |
2561 |
( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then |
| 2580 |
test "x$have_systr_policy_kill" != "x1" && \ |
2562 |
test "x$have_systr_policy_kill" != "x1" && \ |
| 2581 |
AC_MSG_ERROR([systrace sandbox requires systrace headers and SYSTR_POLICY_KILL support]) |
2563 |
AC_MSG_ERROR([systrace sandbox requires systrace headers and SYSTR_POLICY_KILL support]) |
| 2582 |
SANDBOX_STYLE="systrace" |
2564 |
SANDBOX_STYLE="$SANDBOX_STYLE systrace" |
| 2583 |
AC_DEFINE([SANDBOX_SYSTRACE], [1], [Sandbox using systrace(4)]) |
2565 |
AC_DEFINE([SANDBOX_SYSTRACE], [1], [Sandbox using systrace(4)]) |
| 2584 |
elif test "x$sandbox_arg" = "xdarwin" || \ |
2566 |
fi |
|
|
2567 |
if test "x$sandbox_arg" = "xdarwin" || \ |
| 2585 |
( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \ |
2568 |
( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \ |
| 2586 |
test "x$ac_cv_header_sandbox_h" = "xyes") ; then |
2569 |
test "x$ac_cv_header_sandbox_h" = "xyes") ; then |
| 2587 |
test "x$ac_cv_func_sandbox_init" != "xyes" -o \ |
2570 |
test "x$ac_cv_func_sandbox_init" != "xyes" -o \ |
| 2588 |
"x$ac_cv_header_sandbox_h" != "xyes" && \ |
2571 |
"x$ac_cv_header_sandbox_h" != "xyes" && \ |
| 2589 |
AC_MSG_ERROR([Darwin seatbelt sandbox requires sandbox.h and sandbox_init function]) |
2572 |
AC_MSG_ERROR([Darwin seatbelt sandbox requires sandbox.h and sandbox_init function]) |
| 2590 |
SANDBOX_STYLE="darwin" |
2573 |
SANDBOX_STYLE="$SANDBOX_STYLE darwin" |
| 2591 |
AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)]) |
2574 |
AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)]) |
| 2592 |
elif test "x$sandbox_arg" = "xseccomp_filter" || \ |
2575 |
fi |
|
|
2576 |
if test "x$sandbox_arg" = "xseccomp_filter" || \ |
| 2593 |
( test -z "$sandbox_arg" && \ |
2577 |
( test -z "$sandbox_arg" && \ |
| 2594 |
test "x$have_seccomp_filter" == "x1" && \ |
2578 |
test "x$have_seccomp_filter" == "x1" && \ |
| 2595 |
test "x$ac_cv_header_linux_audit_h" = "xyes" && \ |
2579 |
test "x$ac_cv_header_linux_audit_h" = "xyes" && \ |
|
Lines 2604-2624
elif test "x$sandbox_arg" = "xseccomp_fi
Link Here
|
| 2604 |
AC_MSG_ERROR([seccomp_filter sandbox requires seccomp headers]) |
2588 |
AC_MSG_ERROR([seccomp_filter sandbox requires seccomp headers]) |
| 2605 |
test "x$ac_cv_func_prctl" != "xyes" && \ |
2589 |
test "x$ac_cv_func_prctl" != "xyes" && \ |
| 2606 |
AC_MSG_ERROR([seccomp_filter sandbox requires prctl function]) |
2590 |
AC_MSG_ERROR([seccomp_filter sandbox requires prctl function]) |
| 2607 |
SANDBOX_STYLE="seccomp_filter" |
2591 |
SANDBOX_STYLE="$SANDBOX_STYLE seccomp_filter" |
| 2608 |
AC_DEFINE([SANDBOX_SECCOMP_FILTER], [1], [Sandbox using seccomp filter]) |
2592 |
AC_DEFINE([SANDBOX_SECCOMP_FILTER], [1], [Sandbox using seccomp filter]) |
| 2609 |
elif test "x$sandbox_arg" = "xrlimit" || \ |
2593 |
fi |
|
|
2594 |
if test "x$sandbox_arg" = "xrlimit" || \ |
| 2610 |
( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" ) ; then |
2595 |
( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" ) ; then |
| 2611 |
test "x$ac_cv_func_setrlimit" != "xyes" && \ |
2596 |
test "x$ac_cv_func_setrlimit" != "xyes" && \ |
| 2612 |
AC_MSG_ERROR([rlimit sandbox requires setrlimit function]) |
2597 |
AC_MSG_ERROR([rlimit sandbox requires setrlimit function]) |
| 2613 |
SANDBOX_STYLE="rlimit" |
2598 |
SANDBOX_STYLE="$SANDBOX_STYLE rlimit" |
| 2614 |
AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)]) |
2599 |
AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)]) |
| 2615 |
elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \ |
2600 |
fi |
|
|
2601 |
if test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \ |
| 2616 |
test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then |
2602 |
test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then |
| 2617 |
SANDBOX_STYLE="none" |
2603 |
SANDBOX_STYLE="$SANDBOX_STYLE none" |
| 2618 |
AC_DEFINE([SANDBOX_NULL], [1], [no privsep sandboxing]) |
2604 |
fi |
| 2619 |
else |
2605 |
if test -z "$SANDBOX_STYLE" ; then |
| 2620 |
AC_MSG_ERROR([unsupported --with-sandbox]) |
2606 |
AC_MSG_ERROR([unsupported --with-sandbox]) |
| 2621 |
fi |
2607 |
fi |
|
|
2608 |
SANDBOX_STYLE="${SANDBOX_STYLE# }" |
| 2622 |
|
2609 |
|
| 2623 |
# Cheap hack to ensure NEWS-OS libraries are arranged right. |
2610 |
# Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 2624 |
if test ! -z "$SONY" ; then |
2611 |
if test ! -z "$SONY" ; then |