diff --git a/frameworks/common/src/dlp_policy.cpp b/frameworks/common/src/dlp_policy.cpp index f1f545920b52ee80bab3e8de1954c36e5674c99c..8e44d5ea2e798ce8f06b44c7abaa9018726a1688 100644 --- a/frameworks/common/src/dlp_policy.cpp +++ b/frameworks/common/src/dlp_policy.cpp @@ -68,7 +68,7 @@ static bool CheckTime(uint64_t time) std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); if (time < curTime) { DLP_LOG_ERROR(LABEL, - "Perm expiry time is earlier than current time, cur=%{public}" PRIu64 ", set=%{public}" PRIu64 "", curTime, + "Perm expiry time is earlier than current time, cur=%{public}" PRIu64", set=%{public}" PRIu64"", curTime, time); return false; } diff --git a/interfaces/inner_api/dlp_parse/src/dlp_file.cpp b/interfaces/inner_api/dlp_parse/src/dlp_file.cpp index 76e1c835639a18bc2c75806b8d7332869c095626..7639cc6829e3552a9cebc88d51648448dfbc5482 100755 --- a/interfaces/inner_api/dlp_parse/src/dlp_file.cpp +++ b/interfaces/inner_api/dlp_parse/src/dlp_file.cpp @@ -678,7 +678,7 @@ int32_t DlpFile::GenFile(int32_t inPlainFileFd) return DLP_PARSE_ERROR_FILE_OPERATE_FAIL; } head_.txtSize = static_cast(fileLen); - DLP_LOG_DEBUG(LABEL, "fileLen %{private}ld", fileLen); + DLP_LOG_DEBUG(LABEL, "fileLen %{private}" PRId64, fileLen); // clean dlpFile if (ftruncate(dlpFd_, 0) == -1) { @@ -950,7 +950,7 @@ uint32_t DlpFile::GetFsContentSize() const return INVALID_FILE_SIZE; } if (head_.txtOffset > fileStat.st_size || fileStat.st_size >= static_cast(INVALID_FILE_SIZE)) { - DLP_LOG_ERROR(LABEL, "size error %{public}d %{public}ld", head_.txtOffset, fileStat.st_size); + DLP_LOG_ERROR(LABEL, "size error %{public}d %{public}" PRId64, head_.txtOffset, fileStat.st_size); return INVALID_FILE_SIZE; } if (static_cast(fileStat.st_size) - head_.txtOffset == 0) { diff --git a/interfaces/inner_api/dlp_permission/test/unittest/src/dlp_permission_kit_test.cpp b/interfaces/inner_api/dlp_permission/test/unittest/src/dlp_permission_kit_test.cpp index 958e5b70576585553c3a531e6d7754a992813cce..87503367df3578635c80ece98f68a014a50eb2ff 100644 --- a/interfaces/inner_api/dlp_permission/test/unittest/src/dlp_permission_kit_test.cpp +++ b/interfaces/inner_api/dlp_permission/test/unittest/src/dlp_permission_kit_test.cpp @@ -91,7 +91,7 @@ static bool TestSetSelfTokenId(AccessTokenID tokenId) return false; } - DLP_LOG_INFO(LABEL, "set self tokenId from %{public}lu to %{public}d", GetSelfTokenID(), tokenId); + DLP_LOG_INFO(LABEL, "set self tokenId from %{public}" PRIu64 " to %{public}d", GetSelfTokenID(), tokenId); if (SetSelfTokenID(tokenId) != DLP_OK) { DLP_LOG_ERROR(LABEL, "set self tokenId fail"); if (setuid(uid) != 0) { @@ -340,7 +340,7 @@ HWTEST_F(DlpPermissionKitTest, SetRetentionState02, TestSize.Level1) { int32_t uid = getuid(); AccessTokenID tokenId = GetSelfTokenID(); - DLP_LOG_INFO(LABEL, "SetRetentionState02 tokenId from %{public}lu ", GetSelfTokenID()); + DLP_LOG_INFO(LABEL, "SetRetentionState02 tokenId from %{public}" PRIu64, GetSelfTokenID()); std::vector docUriVec; std::vector retentionSandBoxInfoVec; SandboxInfo sandboxInfo; @@ -374,7 +374,7 @@ HWTEST_F(DlpPermissionKitTest, SetRetentionState03, TestSize.Level1) int32_t uid = getuid(); SandboxInfo sandboxInfo; AccessTokenID tokenId = GetSelfTokenID(); - DLP_LOG_INFO(LABEL, "SetRetentionState03 tokenId from %{public}lu ", GetSelfTokenID()); + DLP_LOG_INFO(LABEL, "SetRetentionState03 tokenId from %{public}" PRIu64, GetSelfTokenID()); ASSERT_EQ(DLP_OK, DlpPermissionKit::InstallDlpSandbox(DLP_MANAGER_APP, FULL_CONTROL, DEFAULT_USERID, sandboxInfo, TEST_URI)); diff --git a/interfaces/kits/napi_common/src/napi_common.cpp b/interfaces/kits/napi_common/src/napi_common.cpp index 2141691f821b278e06c4aca3f05b2524423ae27d..a6bf12dda99c1622fd5babe39929f1bc77e6cf8c 100644 --- a/interfaces/kits/napi_common/src/napi_common.cpp +++ b/interfaces/kits/napi_common/src/napi_common.cpp @@ -286,7 +286,7 @@ void OpenDlpFileSubscriberPtr::OnOpenDlpFile(OpenDlpFileCallbackInfo &result) openDlpFileWorker->env = env_; openDlpFileWorker->ref = ref_; openDlpFileWorker->result = result; - DLP_LOG_DEBUG(LABEL, "result uri = %{public}s, openTime = %{public}lu", result.uri.c_str(), + DLP_LOG_DEBUG(LABEL, "result uri = %{public}s, openTime = %{public}" PRIu64, result.uri.c_str(), result.timeStamp); openDlpFileWorker->subscriber = this; work->data = reinterpret_cast(openDlpFileWorker); @@ -625,7 +625,7 @@ bool GetGenerateDlpFileParams( } DLP_LOG_DEBUG(LABEL, - "Fd: %{private}ld, ownerAccount: %{private}s,ownerAccountId: %{private}s, ownerAccountType: %{private}d, " + "Fd: %{private}" PRId64 ",ownerAccount:%{private}s,ownerAccountId: %{private}s, ownerAccountType: %{private}d," "contactAccount: %{private}s, size: %{private}zu", asyncContext.plaintextFd, asyncContext.property.ownerAccount.c_str(), asyncContext.property.ownerAccountId.c_str(), asyncContext.property.ownerAccountType, @@ -656,7 +656,7 @@ bool GetOpenDlpFileParams(const napi_env env, const napi_callback_info info, Dlp } } - DLP_LOG_DEBUG(LABEL, "Fd: %{private}ld", asyncContext.ciphertextFd); + DLP_LOG_DEBUG(LABEL, "Fd: %{private}" PRId64, asyncContext.ciphertextFd); return true; } @@ -688,7 +688,7 @@ bool GetIsDlpFileParams(const napi_env env, const napi_callback_info info, DlpFi } } - DLP_LOG_DEBUG(LABEL, "Fd: %{private}ld", asyncContext.ciphertextFd); + DLP_LOG_DEBUG(LABEL, "Fd: %{private}" PRId64, asyncContext.ciphertextFd); return true; } @@ -796,7 +796,7 @@ bool GetRecoverDlpFileParams( } } - DLP_LOG_DEBUG(LABEL, "plaintextFd: %{private}ld", asyncContext.plaintextFd); + DLP_LOG_DEBUG(LABEL, "plaintextFd: %{private}" PRId64, asyncContext.plaintextFd); return true; } @@ -1208,7 +1208,7 @@ napi_value VisitInfoToJs(napi_env env, const std::vector& in napi_value timestampJs; NAPI_CALL(env, napi_create_int64(env, item.visitTimestamp, ×tampJs)); NAPI_CALL(env, napi_set_named_property(env, objInfo, "lastOpenTime", timestampJs)); - DLP_LOG_DEBUG(LABEL, "Get visitTimestamp %{public}ld", item.visitTimestamp); + DLP_LOG_DEBUG(LABEL, "Get visitTimestamp %{public}" PRId64, item.visitTimestamp); napi_value uriJs; NAPI_CALL(env, napi_create_string_utf8(env, item.docUri.c_str(), NAPI_AUTO_LENGTH, &uriJs)); NAPI_CALL(env, napi_set_named_property(env, objInfo, "uri", uriJs)); diff --git a/patches/patches.json b/patches/patches.json new file mode 100644 index 0000000000000000000000000000000000000000..c21042c6bf2b3ec8ea232233be725eafe296f560 --- /dev/null +++ b/patches/patches.json @@ -0,0 +1,9 @@ +{ + "patches": [ + { + "project":"productdefine_common", + "path":"productdefine/common", + "pr_url":"https://gitee.com/openharmony/productdefine_common/pulls/697" + } + ] +}