Merge branch 'config-stat-symlink' into 'develop'

Config: Check the permissions of the linked file instead of the symlink

See merge request pleroma/pleroma!4061
This commit is contained in:
Haelwenn 2024-02-15 01:48:03 +00:00
commit f28dcc9cb7
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
- Config: Check the permissions of the linked file instead of the symlink

View File

@ -21,7 +21,7 @@ defmodule Pleroma.Config.ReleaseRuntimeProvider do
with_runtime_config =
if File.exists?(config_path) do
# <https://git.pleroma.social/pleroma/pleroma/-/issues/3135>
%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}"