lib-shim-v2/0003-Check-if-a-path-is-abstract-before-connection.patch
kamizjw 1a5e0cc69d lib-shim-v2:sync some patches
(cherry picked from commit b342f7fdfcdeac79309b9bc5a6b136a9ead8e82b)
2025-01-20 19:51:57 +08:00

27 lines
914 B
Diff

From fc7460e84deb77b18c895b7f4b46497a5e3ca740 Mon Sep 17 00:00:00 2001
From: czrz <chengzeruizhi@huawei.com>
Date: Wed, 7 Dec 2022 08:11:14 +0000
Subject: [PATCH 2/4] !20 Check if a path is abstract before connection * Check
if a path is abstract before connection
---
src/client/client.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/client.rs b/src/client/client.rs
index 3f231f2..8240b53 100644
--- a/src/client/client.rs
+++ b/src/client/client.rs
@@ -96,7 +96,7 @@ pub fn new_conn(container_id: &String, addr: &String) -> Result<()> {
};
let path = Path::new(&MAIN_SEPARATOR.to_string()).join(address);
- let fd = connect_to_socket(true, &path.to_string_lossy())?;
+ let fd = connect_to_socket(!addr.starts_with("unix://"), &path.to_string_lossy())?;
TTRPC_CLIENTS.lock().unwrap().insert(
container_id.clone(),
Store {
--
2.40.1