From 3b82864bccee1af625dd19faed511d5b76f66f9d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 14 Feb 2024 18:16:54 +0100 Subject: [PATCH] =?UTF-8?q?Config:=20Check=20the=20permissions=20of=20the?= =?UTF-8?q?=20linked=20file=20instead=20of=20the=20symlink=E2=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.d/config-stat-symlink.fix | 1 + lib/pleroma/config/release_runtime_provider.ex | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/config-stat-symlink.fix diff --git a/changelog.d/config-stat-symlink.fix b/changelog.d/config-stat-symlink.fix new file mode 100644 index 000000000..c8b98225d --- /dev/null +++ b/changelog.d/config-stat-symlink.fix @@ -0,0 +1 @@ +- Config: Check the permissions of the linked file instead of the symlink diff --git a/lib/pleroma/config/release_runtime_provider.ex b/lib/pleroma/config/release_runtime_provider.ex index 9ec0f975e..351639836 100644 --- a/lib/pleroma/config/release_runtime_provider.ex +++ b/lib/pleroma/config/release_runtime_provider.ex @@ -21,7 +21,7 @@ defmodule Pleroma.Config.ReleaseRuntimeProvider do with_runtime_config = if File.exists?(config_path) do # - %File.Stat{mode: mode} = File.lstat!(config_path) + %File.Stat{mode: mode} = File.stat!(config_path) if Bitwise.band(mode, 0o007) > 0 do raise "Configuration at #{config_path} has world-permissions, execute the following: chmod o= #{config_path}"