/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/test/ |
H A D | dlp_file_manager_test.cpp | 80 std::shared_ptr<DlpFile> filePtr; in HWTEST_F() local 81 EXPECT_EQ(filePtr, nullptr); in HWTEST_F() 82 EXPECT_EQ(DlpFileManager::GetInstance().AddDlpFileNode(filePtr), DLP_PARSE_ERROR_VALUE_INVALID); in HWTEST_F() 83 EXPECT_EQ(DlpFileManager::GetInstance().RemoveDlpFileNode(filePtr), DLP_PARSE_ERROR_VALUE_INVALID); in HWTEST_F() 84 filePtr = std::make_shared<DlpFile>(1, DLP_TEST_DIR, 0, false); in HWTEST_F() 85 ASSERT_NE(filePtr, nullptr); in HWTEST_F() 86 EXPECT_EQ(DlpFileManager::GetInstance().AddDlpFileNode(filePtr), DLP_OK); in HWTEST_F() 87 EXPECT_EQ(DlpFileManager::GetInstance().AddDlpFileNode(filePtr), DLP_PARSE_ERROR_FILE_ALREADY_OPENED); in HWTEST_F() 90 EXPECT_EQ(DlpFileManager::GetInstance().RemoveDlpFileNode(filePtr), DLP_OK); in HWTEST_F() 92 DlpFileManager::GetInstance().g_DlpFileMap_[1] = filePtr; in HWTEST_F() 111 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(i, DLP_TEST_DIR, i, false); HWTEST_F() local 229 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(g_fdDlp, DLP_TEST_DIR, 0, false); HWTEST_F() local 272 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(g_fdDlp, DLP_TEST_DIR, 0, false); HWTEST_F() local 315 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(g_fdDlp, DLP_TEST_DIR, 0, false); HWTEST_F() local 365 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(g_fdDlp, DLP_TEST_DIR, 0, false); HWTEST_F() local 426 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(1000, DLP_TEST_DIR, 0, false); HWTEST_F() local 463 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(1000, DLP_TEST_DIR, 0, false); HWTEST_F() local 486 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(1000, DLP_TEST_DIR, 0, false); HWTEST_F() local 516 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(1000, DLP_TEST_DIR, 0, false); HWTEST_F() local 540 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(1000, DLP_TEST_DIR, 0, false); HWTEST_F() local 569 std::shared_ptr<DlpFile> filePtr; HWTEST_F() local 589 std::shared_ptr<DlpFile> filePtr; HWTEST_F() local 609 std::shared_ptr<DlpFile> filePtr; HWTEST_F() local 658 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local [all...] |
H A D | dlp_file_kits_test.cpp | 99 std::shared_ptr<DlpFile> filePtr; in CreateDlpFileFd() local 101 g_dlpFileFd, prop, filePtr, DLP_TEST_DIR); in CreateDlpFileFd() 108 DlpFileManager::GetInstance().CloseDlpFile(filePtr); in CreateDlpFileFd()
|
/base/request/request/frameworks/js/napi/src/upload/ |
H A D | obtain_file.cpp | 61 FILE *filePtr = nullptr;
in GetDataAbilityFile() local 72 filePtr = fdopen(fd, "r");
in GetDataAbilityFile() 73 if (filePtr == nullptr) {
in GetDataAbilityFile() 79 (void)fseek(filePtr, 0, SEEK_END);
in GetDataAbilityFile() 80 fileLength = ftell(filePtr);
in GetDataAbilityFile() 86 (void)fseek(filePtr, 0, SEEK_SET);
in GetDataAbilityFile() 89 *file = filePtr;
in GetDataAbilityFile() 133 FILE *filePtr = fopen(filePath.c_str(), "r");
in GetInternalFile() local 134 if (filePtr == nullptr) {
in GetInternalFile() 138 (void)fseek(filePtr, in GetInternalFile() [all...] |
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/src/ |
H A D | dlp_file_manager.cpp | 44 int32_t DlpFileManager::AddDlpFileNode(const std::shared_ptr<DlpFile>& filePtr) in AddDlpFileNode() argument 46 if (filePtr == nullptr) { in AddDlpFileNode() 47 DLP_LOG_ERROR(LABEL, "Add dlp file node failed, filePtr is null"); in AddDlpFileNode() 55 auto iter = g_DlpFileMap_.find(filePtr->dlpFd_); in AddDlpFileNode() 57 DLP_LOG_ERROR(LABEL, "Add dlp file node fail, fd %{public}d already exist", filePtr->dlpFd_); in AddDlpFileNode() 60 g_DlpFileMap_[filePtr->dlpFd_] = filePtr; in AddDlpFileNode() 64 int32_t DlpFileManager::RemoveDlpFileNode(const std::shared_ptr<DlpFile>& filePtr) in RemoveDlpFileNode() argument 66 if (filePtr == nullptr) { in RemoveDlpFileNode() 67 DLP_LOG_ERROR(LABEL, "Remove dlp file node fail, filePtr i in RemoveDlpFileNode() 221 UpdateDlpFile(bool isNeedAdapter, uint32_t oldCertSize, const std::string& workDir, const std::vector<uint8_t>& cert, std::shared_ptr<DlpFile>& filePtr) UpdateDlpFile() argument 249 ParseDlpFileFormat(std::shared_ptr<DlpFile>& filePtr, const std::string& workDir, const std::string& appId) ParseDlpFileFormat() argument 323 SetDlpFileParams(std::shared_ptr<DlpFile>& filePtr, const DlpProperty& property) const SetDlpFileParams() argument 415 GenerateDlpFile( int32_t plainFileFd, int32_t dlpFileFd, const DlpProperty& property, std::shared_ptr<DlpFile>& filePtr, const std::string& workDir) GenerateDlpFile() argument 507 OpenDlpFile(int32_t dlpFileFd, std::shared_ptr<DlpFile>& filePtr, const std::string& workDir, const std::string& appId) OpenDlpFile() argument 558 RecoverDlpFile(std::shared_ptr<DlpFile>& filePtr, int32_t plainFd) const RecoverDlpFile() argument [all...] |
/base/security/dlp_permission_service/interfaces/inner_api/dlp_fuse/src/ |
H A D | dlp_link_manager.cpp | 59 int32_t DlpLinkManager::AddDlpLinkFile(const std::shared_ptr<DlpFile>& filePtr, const std::string& dlpLinkName) in AddDlpLinkFile() argument 61 if (filePtr == nullptr) { in AddDlpLinkFile() 84 if ((linkFileNode != nullptr) && (filePtr == linkFileNode->GetDlpFilePtr())) { in AddDlpLinkFile() 90 DlpLinkFile *node = new (std::nothrow) DlpLinkFile(dlpLinkName, filePtr); in AddDlpLinkFile() 98 filePtr->SetLinkStatus(); in AddDlpLinkFile() 102 int32_t DlpLinkManager::StopDlpLinkFile(const std::shared_ptr<DlpFile>& filePtr) in StopDlpLinkFile() argument 104 if (filePtr == nullptr) { in StopDlpLinkFile() 116 if (filePtr == node->GetDlpFilePtr()) { in StopDlpLinkFile() 118 filePtr->RemoveLinkStatus(); in StopDlpLinkFile() 127 int32_t DlpLinkManager::RestartDlpLinkFile(const std::shared_ptr<DlpFile>& filePtr) in RestartDlpLinkFile() argument 152 ReplaceDlpLinkFile(const std::shared_ptr<DlpFile>& filePtr, const std::string& dlpLinkName) ReplaceDlpLinkFile() argument 181 DeleteDlpLinkFile(const std::shared_ptr<DlpFile>& filePtr) DeleteDlpLinkFile() argument 230 DlpLinkFile* filePtr = iter->second; DumpDlpLinkFile() local [all...] |
/base/security/dlp_permission_service/interfaces/inner_api/dlp_fuse/include/ |
H A D | dlp_link_manager.h | 33 int32_t AddDlpLinkFile(const std::shared_ptr<DlpFile>& filePtr, const std::string& dlpLinkName); 34 int32_t StopDlpLinkFile(const std::shared_ptr<DlpFile>& filePtr); 35 int32_t RestartDlpLinkFile(const std::shared_ptr<DlpFile>& filePtr); 36 int32_t ReplaceDlpLinkFile(const std::shared_ptr<DlpFile>& filePtr, const std::string& dlpLinkName); 37 int32_t DeleteDlpLinkFile(const std::shared_ptr<DlpFile>& filePtr);
|
/base/security/dlp_permission_service/interfaces/inner_api/dlp_fuse/test/unittest/src/ |
H A D | dlp_fuse_test.cpp | 732 std::shared_ptr<DlpFile> filePtr = nullptr; in HWTEST_F() local 733 EXPECT_EQ(DlpLinkManager::GetInstance().AddDlpLinkFile(filePtr, ""), DLP_FUSE_ERROR_DLP_FILE_NULL); in HWTEST_F() 735 filePtr = std::make_shared<DlpFile>(1000, DLP_TEST_DIR, 0, false); in HWTEST_F() 736 EXPECT_EQ(DlpLinkManager::GetInstance().AddDlpLinkFile(filePtr, ""), DLP_FUSE_ERROR_VALUE_INVALID); in HWTEST_F() 738 EXPECT_EQ(DlpLinkManager::GetInstance().AddDlpLinkFile(filePtr, "linkfile"), DLP_OK); in HWTEST_F() 739 EXPECT_EQ(DlpLinkManager::GetInstance().AddDlpLinkFile(filePtr, "linkfile"), DLP_FUSE_ERROR_LINKFILE_EXIST); in HWTEST_F() 741 DlpLinkManager::GetInstance().DeleteDlpLinkFile(filePtr); in HWTEST_F() 753 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(-1, DLP_TEST_DIR, 0, false); in HWTEST_F() local 754 ASSERT_NE(filePtr, nullptr); in HWTEST_F() 760 EXPECT_EQ(DlpLinkManager::GetInstance().AddDlpLinkFile(filePtr, "linkfil in HWTEST_F() 776 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 819 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(1000, DLP_TEST_DIR, 0, false); HWTEST_F() local 887 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 901 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 916 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 932 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 947 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 969 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 991 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 1012 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 1030 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 1056 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local 1081 std::shared_ptr<DlpFile> filePtr = nullptr; HWTEST_F() local [all...] |
H A D | fuse_daemon_test.cpp | 618 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(-1, DLP_TEST_DIR, 0, false); in HWTEST_F() local 619 ASSERT_NE(filePtr, nullptr); in HWTEST_F() 621 DlpLinkManager::GetInstance().AddDlpLinkFile(filePtr, "test"); in HWTEST_F() 637 DlpLinkManager::GetInstance().DeleteDlpLinkFile(filePtr); in HWTEST_F() 650 std::shared_ptr<DlpFile> filePtr = std::make_shared<DlpFile>(-1, DLP_TEST_DIR, 0, false); in HWTEST_F() local 651 DlpLinkManager::GetInstance().AddDlpLinkFile(filePtr, "test"); in HWTEST_F() 671 DlpLinkManager::GetInstance().DeleteDlpLinkFile(filePtr); in HWTEST_F()
|
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/include/ |
H A D | dlp_file_manager.h | 37 int32_t plainFileFd, int32_t dlpFileFd, const DlpProperty& property, std::shared_ptr<DlpFile>& filePtr, 39 int32_t OpenDlpFile(int32_t dlpFileFd, std::shared_ptr<DlpFile>& filePtr, const std::string& workDir, 48 int32_t AddDlpFileNode(const std::shared_ptr<DlpFile>& filePtr); 49 int32_t RemoveDlpFileNode(const std::shared_ptr<DlpFile>& filePtr); 54 const std::vector<uint8_t>& cert, std::shared_ptr<DlpFile>& filePtr); 57 int32_t ParseDlpFileFormat(std::shared_ptr<DlpFile>& filePtr, const std::string& workDir, const std::string& appId); 61 int32_t SetDlpFileParams(std::shared_ptr<DlpFile>& filePtr, const DlpProperty& property) const;
|