From 45dd0a7ca855c4ce05f3d4dedffcd3d614b486b8 Mon Sep 17 00:00:00 2001 From: Zhou Shihui Date: Wed, 6 Aug 2025 10:14:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=89=E8=A3=85rename=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=90=8E=E9=87=8D=E8=AF=95copy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhou Shihui --- services/bundlemgr/src/base_bundle_installer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index a4d5669f8f..87c9f18907 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -5880,6 +5880,10 @@ ErrCode BaseBundleInstaller::CopyHapsToSecurityDir(const InstallParam &installPa } auto destination = BundleUtil::CopyFileToSecurityDir(bundlePaths[index], DirType::STREAM_INSTALL_DIR, toDeleteTempHapPath_, installParam.IsRenameInstall()); + if (destination.empty() && installParam.IsRenameInstall() && errno == EXDEV) { + destination = BundleUtil::CopyFileToSecurityDir(bundlePaths[index], DirType::STREAM_INSTALL_DIR, + toDeleteTempHapPath_, false); + } if (destination.empty()) { LOG_E(BMS_TAG_INSTALLER, "copy file %{private}s to security dir failed", bundlePaths[index].c_str()); return ERR_APPEXECFWK_INSTALL_COPY_HAP_FAILED; -- Gitee From 9a03556d84df3c07007efe319227dc053d5b78ba Mon Sep 17 00:00:00 2001 From: Zhou Shihui Date: Wed, 6 Aug 2025 10:30:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=89=E8=A3=85rename=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=90=8E=E9=87=8D=E8=AF=95copy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhou Shihui --- services/bundlemgr/src/base_bundle_installer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index 87c9f18907..f41dc7fa7f 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -5881,6 +5881,7 @@ ErrCode BaseBundleInstaller::CopyHapsToSecurityDir(const InstallParam &installPa auto destination = BundleUtil::CopyFileToSecurityDir(bundlePaths[index], DirType::STREAM_INSTALL_DIR, toDeleteTempHapPath_, installParam.IsRenameInstall()); if (destination.empty() && installParam.IsRenameInstall() && errno == EXDEV) { + LOG_W(BMS_TAG_INSTALLER, "rename hap failed, try to copy instead"); destination = BundleUtil::CopyFileToSecurityDir(bundlePaths[index], DirType::STREAM_INSTALL_DIR, toDeleteTempHapPath_, false); } -- Gitee