pkgsrc/security/openssh/patches/patch-sandbox-darwin.c
jperkin 13ff0e954c Explicitly disable roaming, as per CVE-2016-0777 and CVE-2016-0778.
Fix patch dates and offsets while here.  Bump PKGREVISION.
2016-01-18 12:53:25 +00:00

23 lines
722 B
C

$NetBSD: patch-sandbox-darwin.c,v 1.2 2016/01/18 12:53:26 jperkin Exp $
Support sandbox on newer OSX, from MacPorts.
--- sandbox-darwin.c.orig 2015-08-21 04:49:03.000000000 +0000
+++ sandbox-darwin.c
@@ -62,8 +62,16 @@ ssh_sandbox_child(struct ssh_sandbox *bo
struct rlimit rl_zero;
debug3("%s: starting Darwin sandbox", __func__);
+#ifdef __APPLE_SANDBOX_NAMED_EXTERNAL__
+#ifndef SANDBOX_NAMED_EXTERNAL
+#define SANDBOX_NAMED_EXTERNAL (0x3)
+#endif
+ if (sandbox_init("@PKG_SYSCONFDIR@/org.openssh.sshd.sb",
+ SANDBOX_NAMED_EXTERNAL, &errmsg) == -1)
+#else
if (sandbox_init(kSBXProfilePureComputation, SANDBOX_NAMED,
&errmsg) == -1)
+#endif
fatal("%s: sandbox_init: %s", __func__, errmsg);
/*