From 7e401c041a319487d68509fb0c170edd4d36e897 Mon Sep 17 00:00:00 2001 From: s30030188 Date: Mon, 1 Sep 2025 16:05:10 +0800 Subject: [PATCH] =?UTF-8?q?dlopen=E6=B7=BB=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30030188 --- frameworks/native/appkit/app/main_thread.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frameworks/native/appkit/app/main_thread.cpp b/frameworks/native/appkit/app/main_thread.cpp index c3ca7b8e1b3..e3ff8c70345 100644 --- a/frameworks/native/appkit/app/main_thread.cpp +++ b/frameworks/native/appkit/app/main_thread.cpp @@ -4046,7 +4046,13 @@ void MainThread::HandleConfigByPlugin(Configuration &config, BundleInfo &bundleI return; } - void* handle = dlopen(PC_LIBRARY_PATH, RTLD_LAZY); + char resolvedPath[PATH_MAX] = {0}; + if (realpath(PC_LIBRARY_PATH, resolvedPath) == nullptr) { + TAG_LOGE(AAFwkTag::APPKIT, "errno = %{public}d", errno); + return; + } + + void* handle = dlopen(resolvedPath, RTLD_LAZY); if (handle == nullptr) { TAG_LOGW(AAFwkTag::APPKIT, "reason %{public}sn", dlerror()); return; -- Gitee