From 9193cef83df694e8c245ee783d060dcf10c4f8b0 Mon Sep 17 00:00:00 2001 From: cuiruibin Date: Thu, 9 Jan 2025 22:02:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=88=86=E4=BA=AB=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=97=A5=E5=BF=97=E6=89=93=E7=82=B9=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E5=AE=9A=E4=BD=8D=E5=AE=9A=E7=95=8C=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=20Signed-off-by:=20cuiruibin=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interfaces/common/src/sandbox_helper.cpp | 2 +- .../innerkits/native/file_share/src/file_permission.cpp | 5 +++++ .../native/remote_file_share/src/remote_file_share.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/interfaces/common/src/sandbox_helper.cpp b/interfaces/common/src/sandbox_helper.cpp index 71b6d63c5..863884aa0 100644 --- a/interfaces/common/src/sandbox_helper.cpp +++ b/interfaces/common/src/sandbox_helper.cpp @@ -429,7 +429,7 @@ bool SandboxHelper::CheckValidPath(const std::string &filePath) char realPath[PATH_MAX]{'\0'}; if (realpath(filePath.c_str(), realPath) == nullptr) { - LOGE("realpath failed with %{public}d", errno); + LOGE("realpath failed with errno = %{public}d, filePath = %{private}s", errno, filePath.c_str()); return false; } diff --git a/interfaces/innerkits/native/file_share/src/file_permission.cpp b/interfaces/innerkits/native/file_share/src/file_permission.cpp index 5981938dd..dd9c76c26 100644 --- a/interfaces/innerkits/native/file_share/src/file_permission.cpp +++ b/interfaces/innerkits/native/file_share/src/file_permission.cpp @@ -243,6 +243,7 @@ int32_t FilePermission::CheckUriPersistentPermission(uint32_t tokenId, } vector resultCodes; + LOGI("CheckUriPersistentPermission pathPolicies size: %{public}zu", pathPolicies.size()); int32_t sandboxManagerErrorCode = SandboxManagerKit::CheckPersistPolicy(tokenId, pathPolicies, resultCodes); for (size_t i = resultCodes.size(); i < pathPolicies.size(); i++) { resultCodes.emplace_back(false); @@ -273,6 +274,7 @@ int32_t FilePermission::PersistPermission(const vector &uriPolici return EPERM; } vector resultCodes; + LOGI("PersistPermission pathPolicies size: %{public}zu", pathPolicies.size()); int32_t sandboxManagerErrorCode = SandboxManagerKit::PersistPolicy(pathPolicies, resultCodes); errorCode = ErrorCodeConversion(sandboxManagerErrorCode, errorResults, resultCodes); if (errorCode == EPERM) { @@ -296,6 +298,7 @@ int32_t FilePermission::RevokePermission(const vector &uriPolicie return EPERM; } vector resultCodes; + LOGI("RevokePermission pathPolicies size: %{public}zu", pathPolicies.size()); int32_t sandboxManagerErrorCode = SandboxManagerKit::UnPersistPolicy(pathPolicies, resultCodes); errorCode = ErrorCodeConversion(sandboxManagerErrorCode, errorResults, resultCodes); if (errorCode == EPERM) { @@ -319,6 +322,7 @@ int32_t FilePermission::ActivatePermission(const vector &uriPolic return EPERM; } vector resultCodes; + LOGI("ActivatePermission pathPolicies size: %{public}zu", pathPolicies.size()); auto &uriPermissionClient = AAFwk::UriPermissionManagerClient::GetInstance(); int32_t sandboxManagerErrorCode = uriPermissionClient.Active(pathPolicies, resultCodes); errorCode = ErrorCodeConversion(sandboxManagerErrorCode, errorResults, resultCodes); @@ -343,6 +347,7 @@ int32_t FilePermission::DeactivatePermission(const vector &uriPol return EPERM; } vector resultCodes; + LOGI("DeactivatePermission pathPolicies size: %{public}zu", pathPolicies.size()); int32_t sandboxManagerErrorCode = SandboxManagerKit::StopAccessingPolicy(pathPolicies, resultCodes); errorCode = ErrorCodeConversion(sandboxManagerErrorCode, errorResults, resultCodes); if (errorCode == EPERM) { diff --git a/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp b/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp index c4ffc9583..568d8a573 100644 --- a/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp +++ b/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp @@ -442,7 +442,7 @@ int32_t RemoteFileShare::GetDfsUrisFromLocal(const std::vector &uri for (auto &uriStr : uriList) { Uri uri(uriStr); std::string bundleName = uri.GetAuthority(); - LOGD("GetDfsUriFromLocal begin"); + LOGD("GetDfsUriFromLocal begin, uri: %{private}s", uriStr.c_str()); std::string physicalPath = GetPhysicalPath(uri, std::to_string(userId)); if (physicalPath == "") { LOGE("Failed to get physical path"); -- Gitee