Skip to content

Commit

Permalink
Don't auto-enable Capsicum sandbox on FreeBSD 9/10.
Browse files Browse the repository at this point in the history
Since we changed from select() to ppoll() tests have been failing.
This seems to be because FreeBSD 10 (and presumably 9) do not allow
ppoll() in the privsep process and sshd will fail with "Not permitted in
capability mode".  Setting CAP_EVENT on the FDs doesn't help, but weirdly,
poll() works without that.  Those versions are EOL so this situation is
unlikely to change.
  • Loading branch information
daztucker committed Nov 19, 2021
1 parent a823f39 commit 04b172d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,11 @@ mips-sony-bsd|mips-sony-newsos4)
# and will crash if they cannot be opened.
AC_DEFINE([SANDBOX_SKIP_RLIMIT_NOFILE], [1],
[define if setrlimit RLIMIT_NOFILE breaks things])
case "$host" in
*-*-freebsd9.*|*-*-freebsd10.*)
# Capsicum on 9 and 10 do not allow ppoll() so don't auto-enable.
disable_capsicum=yes
esac
;;
*-*-bsdi*)
AC_DEFINE([SETEUID_BREAKS_SETUID])
Expand Down Expand Up @@ -3654,6 +3659,7 @@ elif test "x$sandbox_arg" = "xseccomp_filter" || \
AC_DEFINE([SANDBOX_SECCOMP_FILTER], [1], [Sandbox using seccomp filter])
elif test "x$sandbox_arg" = "xcapsicum" || \
( test -z "$sandbox_arg" && \
test "x$disable_capsicum" != "xyes" && \
test "x$ac_cv_header_sys_capsicum_h" = "xyes" && \
test "x$ac_cv_func_cap_rights_limit" = "xyes") ; then
test "x$ac_cv_header_sys_capsicum_h" != "xyes" && \
Expand Down

0 comments on commit 04b172d

Please sign in to comment.