Skip to content

A platform for community discussion. Free, open, simple.

DEV: Upgrade landlock to 0.4.1 (#42779)

Alan Guo Xiang Tan5b3af347813a
diff --git a/Gemfile.lock b/Gemfile.lock
index 21c4e8583d5..4e93b10f5d1 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -314,7 +314,7 @@ GEM
simpleidn (~> 0.2)
jwt (2.10.1)
base64
- landlock (0.3)
+ landlock (0.4.1)
language_server-protocol (3.17.0.5)
libv8-node (24.12.0.1-aarch64-linux)
libv8-node (24.12.0.1-aarch64-linux-musl)
@@ -1105,7 +1105,7 @@ CHECKSUMS
json_completer (1.2.0) sha256=4665749172634eccb208c562eb59ea81dd7a612a1fa9a36df441ac473ff177b1
json_schemer (2.5.0) sha256=2f01fb4cce721a4e08dd068fc2030cffd0702a7f333f1ea2be6e8991f00ae396
jwt (2.10.1) sha256=e6424ae1d813f63e761a04d6284e10e7ec531d6f701917fadcd0d9b2deaf1cc5
- landlock (0.3) sha256=841ae1ef1318082a485ae919b6a481ceb9c2d3ac9294ada27e2a3c529446b23c
+ landlock (0.4.1) sha256=95c9b119ff831fae35756ddcd5e9d5f99b9705be71f37a0972f86c825b78b14f
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
libv8-node (24.12.0.1-aarch64-linux) sha256=22bd0246cde85d70c88cf772727ac3677a20ac1d169105f82efe5f1f7c39f755
libv8-node (24.12.0.1-aarch64-linux-musl) sha256=791b5960f79525e87d1bd1e5f2bf3715ef2a38bac6c97f297853e98a8411ba89
diff --git a/lib/discourse/safe_exec.rb b/lib/discourse/safe_exec.rb
index 99dbda15f83..dc32954245c 100644
--- a/lib/discourse/safe_exec.rb
+++ b/lib/discourse/safe_exec.rb
@@ -19,7 +19,7 @@ module Discourse
unsetenv_others: false,
chdir: nil,
connect_tcp: nil,
- bind_tcp: [],
+ bind_tcp: nil,
rlimits: {},
seccomp_deny_network: false,
max_output_bytes: nil,
@@ -38,7 +38,7 @@ module Discourse
env: env,
unsetenv_others: unsetenv_others,
chdir: chdir,
- connect_tcp: Array(connect_tcp),
+ connect_tcp: connect_tcp,
bind_tcp: bind_tcp,
rlimits: rlimits,
seccomp_deny_network: seccomp_deny_network,
diff --git a/spec/lib/discourse/safe_exec_spec.rb b/spec/lib/discourse/safe_exec_spec.rb
index 4604323e951..3521e23c502 100644
--- a/spec/lib/discourse/safe_exec_spec.rb
+++ b/spec/lib/discourse/safe_exec_spec.rb
@@ -4,7 +4,7 @@ require "discourse/safe_exec"
RSpec.describe Discourse::SafeExec do
describe ".capture" do
- it "delegates sandboxed execution to Landlock" do
+ it "delegates filesystem and seccomp sandboxing without Landlock network rules" do
status = instance_double(Process::Status, exited?: true, exitstatus: 0)
result =
instance_double(
@@ -51,8 +51,8 @@ RSpec.describe Discourse::SafeExec do
},
unsetenv_others: true,
chdir: nil,
- connect_tcp: [],
- bind_tcp: [],
+ connect_tcp: nil,
+ bind_tcp: nil,
rlimits: {
cpu_seconds: 1,
},