diff --git a/interfaces/common/src/sandbox_helper.cpp b/interfaces/common/src/sandbox_helper.cpp index 71b6d63c529838421bd008ef0a4730921ae252e8..863884aa02dbe43c97f73c9a4cc32ba784b26b9a 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 5981938dda5d73e4188169d78fafd4316ec63f21..dd9c76c2681fa9f4d351661dd45ad1ad55df7fa1 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 c4ffc9583bec766322d4978672760c984b5ca886..568d8a5737e7d7b4225d157879e409250fb1d661 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");