!1938 Vdevadm tool shield user

Merge pull request !1938 from 李少雄/master
This commit is contained in:
openharmony_ci 2024-09-27 08:48:51 +00:00 committed by Gitee
commit 209f1fcfc1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 19 additions and 14 deletions

View File

@ -23,7 +23,6 @@ group("device_status_fuzztest") {
"addprivilegestub_fuzzer:fuzztest",
"addsubscriptlistener_fuzzer:fuzztest",
"devicegetcachestub_fuzzer:fuzztest",
"devicemanager_fuzzer:fuzztest",
"devicestatusagent_fuzzer:fuzztest",
"devicestatusclient_fuzzer:fuzztest",
"devicesubscribestub_fuzzer:fuzztest",
@ -40,6 +39,7 @@ group("device_status_fuzztest") {
"getudkey_fuzzer:fuzztest",
"handleallocsocketfd_fuzzer:fuzztest",
"ipcsocket_fuzzer:fuzztest",
"msdpdevicemanager_fuzzer:fuzztest",
"removedraglistener_fuzzer:fuzztest",
"removehotarealistener_fuzzer:fuzztest",
"removesubscriptlistener_fuzzer:fuzztest",

View File

@ -35,10 +35,10 @@ deps_ex = [
]
###############################fuzztest#################################
ohos_fuzztest("DeviceManagerFuzzTest") {
ohos_fuzztest("MsdpDeviceManagerFuzzTest") {
module_out_path = module_output_path
fuzz_config_file =
"${device_status_root_path}/test/fuzztest/devicemanager_fuzzer"
"${device_status_root_path}/test/fuzztest/msdpdevicemanager_fuzzer"
include_dirs = [
"${device_status_root_path}/libs/interface",
"${device_status_service_path}/interaction/drag/include",
@ -54,7 +54,7 @@ ohos_fuzztest("DeviceManagerFuzzTest") {
"-Dprotected=public",
]
sources = [ "devicemanager_fuzzer.cpp" ]
sources = [ "msdpdevicemanager_fuzzer.cpp" ]
deps = [
"${device_status_interfaces_path}/innerkits:devicestatus_client",
@ -72,5 +72,5 @@ ohos_fuzztest("DeviceManagerFuzzTest") {
group("fuzztest") {
testonly = true
deps = []
deps += [ ":DeviceManagerFuzzTest" ]
deps += [ ":MsdpDeviceManagerFuzzTest" ]
}

View File

@ -13,12 +13,12 @@
* limitations under the License.
*/
#include "devicemanager_fuzzer.h"
#include "msdpdevicemanager_fuzzer.h"
#include "ddm_adapter.h"
#include "devicestatus_define.h"
#undef LOG_TAG
#define LOG_TAG "DeviceManagerFuzzTest"
#define LOG_TAG "MsdpDeviceManagerFuzzTest"
namespace OHOS {
namespace Msdp {
namespace DeviceStatus {
@ -457,7 +457,7 @@ std::string GetStringFromData(int strlen)
return str;
}
bool DeviceManagerFuzzTest(const uint8_t* data, size_t size)
bool MsdpDeviceManagerFuzzTest(const uint8_t* data, size_t size)
{
if ((data == nullptr) || (size < 1)) {
return false;
@ -494,7 +494,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
return 0;
}
OHOS::Msdp::DeviceStatus::DeviceManagerFuzzTest(data, size);
OHOS::Msdp::DeviceStatus::MsdpDeviceManagerFuzzTest(data, size);
return 0;
}

View File

@ -13,10 +13,10 @@
* limitations under the License.
*/
#ifndef DEVICEMANAGER_FUZZER_H
#define DEVICEMANAGER_FUZZER_H
#ifndef MSDPDEVICEMANAGER_FUZZER_H
#define MSDPDEVICEMANAGER_FUZZER_H
#define FUZZ_PROJECT_NAME "devicemanager_fuzzer"
#define FUZZ_PROJECT_NAME "msdpdevicemanager_fuzzer"
#include <memory>
#include <string>
@ -107,4 +107,4 @@ private:
} // namespace DeviceStatus
} // namespace Msdp
} // namespace OHOS
#endif // DEVICEMANAGER_FUZZER_H
#endif // MSDPDEVICEMANAGER_FUZZER_H

View File

@ -101,7 +101,12 @@ ohos_executable("vdevadm") {
"json:nlohmann_json_static",
]
install_enable = true
if (build_variant == "root" && root_perf_main != "root_main") {
install_enable = true
} else {
install_enable = false
}
subsystem_name = "${device_status_subsystem_name}"
part_name = "${device_status_part_name}"
}