Skip to content

Instantly share code, notes, and snippets.

@mistydemeo
Created July 2, 2024 03:25
Show Gist options
  • Save mistydemeo/eb5618839258663067bdb4be8cbc47e1 to your computer and use it in GitHub Desktop.
Save mistydemeo/eb5618839258663067bdb4be8cbc47e1 to your computer and use it in GitHub Desktop.
diff --git a/sandbox-darwin.c b/sandbox-darwin.c
index 59b4d28..2636a11 100644
--- a/sandbox-darwin.c
+++ b/sandbox-darwin.c
@@ -63,7 +63,15 @@ ssh_sandbox_child(struct ssh_sandbox *box)
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("@PREFIX@/share/openssh/org.openssh.sshd.sb",
+ SANDBOX_NAMED_EXTERNAL, &errmsg) == -1)
+ else
if (sandbox_init(kSBXProfilePureComputation, SANDBOX_NAMED,
+#endif
&errmsg) == -1)
fatal("%s: sandbox_init: %s", __func__, errmsg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment