From b2d621ce6f1bc8f2cede7cf4c51476664b065cf6 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Mon, 11 Aug 2025 19:10:31 +0800 Subject: [PATCH] os/linux/ld: do not crash the program if the `ld.so.conf` entry is not readable --- Library/Homebrew/os/linux/ld.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/os/linux/ld.rb b/Library/Homebrew/os/linux/ld.rb index ce0e21fcbf..ec6295e1d6 100644 --- a/Library/Homebrew/os/linux/ld.rb +++ b/Library/Homebrew/os/linux/ld.rb @@ -49,6 +49,8 @@ module OS def self.library_paths(conf_path = Pathname(sysconfdir)/"ld.so.conf") conf_file = Pathname(conf_path) return [] unless conf_file.exist? + return [] unless conf_file.file? + return [] unless conf_file.readable? @library_paths_cache ||= T.let({}, T.nilable(T::Hash[String, T::Array[String]])) cache_key = conf_file.to_s