From 00c51ff1e80d5b802d62475b06413d8fe4aa3b04 Mon Sep 17 00:00:00 2001 From: dsecurity49 Date: Sat, 22 Aug 2026 18:32:45 +0530 Subject: [PATCH] fix: gate Unix database hosts by platform --- src/sync.rs | 1 + tests/common/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/sync.rs b/src/sync.rs index e8dbe2c..3684d27 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -56,6 +56,7 @@ pub(crate) fn database_config_is_local(config: &PostgresConfig) -> bool { .iter() .all(|address| address.is_loopback()) && config.get_hosts().iter().all(|host| match host { + #[cfg(unix)] Host::Unix(_) => true, Host::Tcp(name) => is_local_host(name), }) diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 3ce2c8c..de0ea0b 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -31,6 +31,7 @@ pub fn database_hosts_are_local(config: &postgres::Config) -> bool { .iter() .all(|address| address.is_loopback()) && config.get_hosts().iter().all(|host| match host { + #[cfg(unix)] postgres::config::Host::Unix(_) => true, postgres::config::Host::Tcp(host) if host.eq_ignore_ascii_case("localhost") => true, postgres::config::Host::Tcp(host) => host