From 2a13a488bfc500aee7dd1d73ca719d1d21de92ad Mon Sep 17 00:00:00 2001 From: l30054665 Date: Wed, 6 Nov 2024 14:31:46 +0800 Subject: [PATCH 1/2] message Signed-off-by: l30054665 --- services/storage_manager/ipc/src/storage_manager_stub.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/storage_manager/ipc/src/storage_manager_stub.cpp b/services/storage_manager/ipc/src/storage_manager_stub.cpp index 299773d9..1c46cd00 100644 --- a/services/storage_manager/ipc/src/storage_manager_stub.cpp +++ b/services/storage_manager/ipc/src/storage_manager_stub.cpp @@ -1232,6 +1232,7 @@ int32_t StorageManagerStub::HandleUMountDfsDocs(MessageParcel &data, MessageParc int32_t StorageManagerStub::HandleNotifyMtpMount(MessageParcel &data, MessageParcel &reply) { + std::string id = data.ReadString(); std::string path = data.ReadString(); std::string desc = data.ReadString(); @@ -1248,6 +1249,7 @@ int32_t StorageManagerStub::HandleNotifyMtpMount(MessageParcel &data, MessagePar int32_t StorageManagerStub::HandleNotifyMtpUnmount(MessageParcel &data, MessageParcel &reply) { + std::string id = data.ReadString(); std::string path = data.ReadString(); int32_t err = NotifyMtpUnmounted(id, path); From a40d64a667ecc8403e0009fc49d58805c9e5c40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Wed, 6 Nov 2024 06:36:23 +0000 Subject: [PATCH 2/2] update services/storage_manager/ipc/src/storage_manager_stub.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- services/storage_manager/ipc/src/storage_manager_stub.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/storage_manager/ipc/src/storage_manager_stub.cpp b/services/storage_manager/ipc/src/storage_manager_stub.cpp index 1c46cd00..e2cbf80d 100644 --- a/services/storage_manager/ipc/src/storage_manager_stub.cpp +++ b/services/storage_manager/ipc/src/storage_manager_stub.cpp @@ -1232,6 +1232,9 @@ int32_t StorageManagerStub::HandleUMountDfsDocs(MessageParcel &data, MessageParc int32_t StorageManagerStub::HandleNotifyMtpMount(MessageParcel &data, MessageParcel &reply) { + if (!CheckClientPermission(PERMISSION_STORAGE_MANAGER)) { + return E_PERMISSION_DENIED; + } std::string id = data.ReadString(); std::string path = data.ReadString(); @@ -1249,7 +1252,10 @@ int32_t StorageManagerStub::HandleNotifyMtpMount(MessageParcel &data, MessagePar int32_t StorageManagerStub::HandleNotifyMtpUnmount(MessageParcel &data, MessageParcel &reply) { - + if (!CheckClientPermission(PERMISSION_STORAGE_MANAGER)) { + return E_PERMISSION_DENIED; + } + std::string id = data.ReadString(); std::string path = data.ReadString(); int32_t err = NotifyMtpUnmounted(id, path);