/base/update/updater/interfaces/kits/misc_info/ |
H A D | misc_info.cpp | 26 char *realPath = realpath(path.c_str(), NULL);
in WriteUpdaterMessage() local 27 if (realPath == nullptr) {
in WriteUpdaterMessage() 28 LOG(ERROR) << "realPath is NULL" << " : " << strerror(errno);
in WriteUpdaterMessage() 31 FILE* fp = fopen(realPath, "rb+");
in WriteUpdaterMessage() 32 free(realPath);
in WriteUpdaterMessage() 58 char *realPath = realpath(path.c_str(), NULL);
in ReadUpdaterMessage() local 59 if (realPath == nullptr) {
in ReadUpdaterMessage() 60 LOG(ERROR) << "realPath is NULL" << " : " << strerror(errno);
in ReadUpdaterMessage() 63 FILE* fp = fopen(realPath, "rb");
in ReadUpdaterMessage() 64 free(realPath);
in ReadUpdaterMessage() 119 char *realPath = realpath(path.c_str(), NULL); WriteUpdaterParaMisc() local 161 char *realPath = realpath(path.c_str(), NULL); ReadUpdaterParaMisc() local [all...] |
/base/security/code_signature/test/unittest/ |
H A D | local_code_sign_utils_test.cpp | 57 std::string realPath;
in HWTEST_F() local 59 bool bRet = OHOS::PathToRealPath(DEMO_AN_PATH2, realPath);
in HWTEST_F() 61 bRet = FsverityUtilsHelper::GetInstance().GenerateFormattedDigest(realPath.c_str(), digest);
in HWTEST_F() 79 std::string realPath;
in HWTEST_F() local 81 bool bRet = OHOS::PathToRealPath(DEMO_AN_PATH2, realPath);
in HWTEST_F() 83 bRet = FsverityUtilsHelper::GetInstance().GenerateFormattedDigest(realPath.c_str(), digest);
in HWTEST_F() 101 std::string realPath = DEMO_AN_PATH2 + "invalid";
in HWTEST_F() local 102 bool bRet = FsverityUtilsHelper::GetInstance().GenerateFormattedDigest(realPath.c_str(), digest);
in HWTEST_F()
|
/base/startup/appspawn/modules/common/ |
H A D | appspawn_begetctl.c | 44 char *realPath = realpath(ptyName, NULL); in RunAppSandbox() local 45 if (realPath == NULL) { in RunAppSandbox() 49 APPSPAWN_CHECK(realPath != NULL, _exit(1), "Failed get realpath, err=%{public}d", errno); in RunAppSandbox() 50 int n = strncmp(realPath, "/dev/pts/", strlen("/dev/pts/")); in RunAppSandbox() 51 APPSPAWN_CHECK(n == 0, free(realPath); _exit(1), "pts path %{public}s is invaild", realPath); in RunAppSandbox() 52 int fd = open(realPath, O_RDWR); in RunAppSandbox() 53 free(realPath); in RunAppSandbox()
|
/base/security/code_signature/utils/src/ |
H A D | file_helper.cpp | 30 std::string realPath;
in CheckFilePathValid() local 31 if (!OHOS::PathToRealPath(path, realPath)) {
in CheckFilePathValid() 35 return (realPath.size() > baseRealPath.size()) &&
in CheckFilePathValid() 36 (baseRealPath.compare(realPath.substr(0, baseRealPath.size())) == 0);
in CheckFilePathValid()
|
/base/security/dlp_permission_service/services/dlp_permission/sa/adapt/ |
H A D | file_operator.cpp | 50 char realPath[PATH_MAX] = {0}; in InputFileByPathAndContent() local 51 (void)realpath(str.c_str(), realPath); in InputFileByPathAndContent() 53 if (str.compare(realPath) != 0) { in InputFileByPathAndContent() 54 DLP_LOG_INFO(LABEL, "path need to be canonical, str %{public}s realPath %{public}s.", str.c_str(), realPath); in InputFileByPathAndContent() 91 char realPath[PATH_MAX] = {0}; in GetFileContentByPath() local 92 if ((realpath(path.c_str(), realPath) == nullptr) && (errno != ENOENT)) { in GetFileContentByPath() 96 if (!IsExistFile(realPath)) { in GetFileContentByPath() 97 DLP_LOG_INFO(LABEL, "cannot find file, path = %{public}s", realPath); in GetFileContentByPath() 101 std::ifstream i(realPath); in GetFileContentByPath() [all...] |
/base/startup/init/services/modules/reboot/ |
H A D | reboot_misc.c | 37 char *realPath = GetRealPath(path);
in RBMiscWriteUpdaterMessage() local 38 BEGET_CHECK_RETURN_VALUE(realPath != NULL, -1);
in RBMiscWriteUpdaterMessage() 40 FILE *fp = fopen(realPath, "rb+");
in RBMiscWriteUpdaterMessage() 41 free(realPath);
in RBMiscWriteUpdaterMessage() 42 realPath = NULL;
in RBMiscWriteUpdaterMessage() 56 char *realPath = GetRealPath(path);
in RBMiscReadUpdaterMessage() local 57 if (realPath != NULL) {
in RBMiscReadUpdaterMessage() 58 fp = fopen(realPath, "rb");
in RBMiscReadUpdaterMessage() 59 free(realPath);
in RBMiscReadUpdaterMessage() 60 realPath in RBMiscReadUpdaterMessage() [all...] |
/base/security/security_guard/services/security_collector/src/ |
H A D | lib_loader.cpp | 37 std::string realPath; in LoadLib() local 38 if (!PathToRealPath(m_libPath, realPath) || realPath.find("/system/lib") != 0) { in LoadLib() 39 LOGE("LoadLib m_libPath error, realPath: %{public}s", realPath.c_str()); in LoadLib() 42 m_handle = dlopen(realPath.c_str(), RTLD_LAZY); in LoadLib()
|
/base/update/sys_installer/services/module_update/src/ |
H A D | module_loop.cpp | 147 string realPath = GetRealPath(sysfsDevice); in ConfigureReadAhead() local 148 if (realPath.empty()) { in ConfigureReadAhead() 154 if (stat(realPath.c_str(), &fileState) != 0) { in ConfigureReadAhead() 155 LOG(ERROR) << "Fail to Stat file: " << realPath << ", errno=" << errno; in ConfigureReadAhead() 159 (void)chmod(realPath.c_str(), fileState.st_mode); in ConfigureReadAhead() 161 UniqueFd sysfsFd(open(realPath.c_str(), O_RDWR | O_CLOEXEC)); in ConfigureReadAhead() 164 if (chmod(realPath.c_str(), 0644) != 0) { in ConfigureReadAhead() 165 LOG(WARNING) << "Fail to chmod file: " << realPath << ", errno=" << errno; in ConfigureReadAhead() 167 sysfsFd = UniqueFd(open(realPath.c_str(), O_RDWR | O_CLOEXEC)); in ConfigureReadAhead() 169 LOG(ERROR) << "Fail to open file: " << realPath << ", errn in ConfigureReadAhead() 242 string realPath = GetRealPath(target); SetUpLoopDevice() local 292 string realPath = GetRealPath(device); WaitForDevice() local [all...] |
/base/hiviewdfx/faultloggerd/common/dfxutil/ |
H A D | string_util.h | 32 inline bool RealPath(const std::string& path, std::string& realPath) in RealPath() argument 35 realPath.reserve(PATH_MAX); in RealPath() 36 realPath.resize(PATH_MAX - 1); in RealPath() 37 if (realpath(path.c_str(), &(realPath[0])) == nullptr) { in RealPath() 41 realPath = path; in RealPath()
|
/base/startup/init/ueventd/ |
H A D | ueventd_firmware_handler.c | 35 char realPath[PATH_MAX] = { 0 }; in HandleFimwareDeviceEvent() local 36 realpath(fwLoadingPath, realPath); in HandleFimwareDeviceEvent() 37 int fd = open(realPath, O_WRONLY | O_CLOEXEC); in HandleFimwareDeviceEvent()
|
/base/update/updater/services/applypatch/ |
H A D | partition_record.cpp | 35 char *realPath = realpath(miscBlockDevice.c_str(), NULL); in IsPartitionUpdated() local 36 if (realPath == nullptr) { in IsPartitionUpdated() 37 LOG(ERROR) << "realPath is NULL" << " : " << strerror(errno); in IsPartitionUpdated() 40 int fd = open(realPath, O_RDONLY | O_EXCL | O_CLOEXEC | O_BINARY); in IsPartitionUpdated() 41 free(realPath); in IsPartitionUpdated() 119 char *realPath = realpath(miscBlockDevice.c_str(), NULL); in RecordPartitionUpdateStatus() local 120 if (realPath == nullptr) { in RecordPartitionUpdateStatus() 121 LOG(ERROR) << "realPath is NULL" << " : " << strerror(errno); in RecordPartitionUpdateStatus() 124 int fd = open(realPath, O_RDWR | O_EXCL | O_CLOEXEC | O_BINARY); in RecordPartitionUpdateStatus() 125 free(realPath); in RecordPartitionUpdateStatus() [all...] |
H A D | data_writer.cpp | 40 char *realPath = realpath(path.c_str(), NULL); in OpenPath() local 41 if (realPath == nullptr) { in OpenPath() 42 LOG(ERROR) << "realPath is NULL" << " : " << strerror(errno); in OpenPath() 45 int fd = open(realPath, O_RDWR | O_LARGEFILE); in OpenPath() 46 free(realPath); in OpenPath()
|
/base/inputmethod/imf/services/file/src/ |
H A D | file_operator.cpp | 87 auto realPath = GetRealPath(cfgFiles->paths[i]); in Read() local 88 if (realPath.empty()) { in Read() 91 content = Read(realPath, key); in Read() 124 char realPath[PATH_MAX] = { 0x00 }; in GetRealPath() local 125 if (realpath(path, realPath) == nullptr) { in GetRealPath() 129 return std::string(realPath); in GetRealPath()
|
/base/update/sys_installer/frameworks/actions/verify_action/src/ |
H A D | pkg_verify.cpp | 46 std::string realPath {}; in Verify() 47 if (!Utils::PathToRealPath(pkgPath, realPath)) { in Verify() 53 int ret = VerifyPackage(realPath.c_str(), Utils::GetCertName().c_str(), "", nullptr, 0); in Verify()
|
/base/hiviewdfx/hiview/plugins/faultlogger/service/idl/ |
H A D | faultlog_query_result_ohos.cpp | 46 std::string realPath; in GetNext() local 47 if ((!info->logPath.empty()) && OHOS::HiviewDFX::FileUtil::PathToRealPath(info->logPath, realPath)) { in GetNext() 48 ret->fd = TEMP_FAILURE_RETRY(open(realPath.c_str(), O_RDONLY)); in GetNext()
|
/base/startup/init/services/init/lite/ |
H A D | init_cmds.c | 81 char *realPath = GetRealPath(ctx->argv[0]);
in DoLoadCfg() local 82 INIT_ERROR_CHECK(realPath != NULL, return, "Failed to get realpath %s", ctx->argv[0]);
in DoLoadCfg() 83 FILE *fp = fopen(realPath, "r");
in DoLoadCfg() 86 free(realPath);
in DoLoadCfg() 106 free(realPath);
in DoLoadCfg()
|
/base/update/sys_installer/services/module_update/util/src/ |
H A D | module_hvb_ops.cpp | 80 std::string realPath = GetRealPath(path); in HvbReadFromPartition() local 81 if (realPath.empty()) { in HvbReadFromPartition() 91 OHOS::UniqueFd fd(open(realPath.c_str(), O_RDONLY | O_CLOEXEC)); in HvbReadFromPartition() 93 LOG(ERROR) << "failed to open file " << realPath << " err=" << errno; in HvbReadFromPartition() 97 LOG(ERROR) << "failed to read file " << realPath; in HvbReadFromPartition()
|
/base/startup/init/services/modules/trace/ |
H A D | init_trace.c | 91 char realPath[PATH_MAX] = "";
in ReadFile() local 92 realpath(path, realPath);
in ReadFile() 93 FILE *fd = fopen(realPath, "r");
in ReadFile() 177 char realPath[PATH_MAX] = "";
in WriteStrToFile() local 178 realpath(workspace->buffer, realPath);
in WriteStrToFile() 179 FILE *outfile = fopen(realPath, "w");
in WriteStrToFile() 332 char realPath[PATH_MAX] = "";
in ClearTrace() local 333 realpath(workspace->buffer, realPath);
in ClearTrace() 335 int fd = open(realPath, O_RDWR);
in ClearTrace() 382 char realPath[PATH_MA in DumpTrace() local 426 char realPath[PATH_MAX] = { 0 }; MarkOthersClockSync() local [all...] |
/base/startup/init/interfaces/innerkits/control_fd/ |
H A D | control_fd_service.c | 76 char *realPath = GetRealPath(msg->ptyName); in CmdOnRecvMessage() local 77 BEGET_ERROR_CHECK(realPath != NULL, _exit(1), "Failed get realpath, err=%d", errno); in CmdOnRecvMessage() 78 int n = strncmp(realPath, "/dev/pts/", strlen("/dev/pts/")); in CmdOnRecvMessage() 79 BEGET_ERROR_CHECK(n == 0, free(realPath); _exit(1), "pts path %s is invaild", realPath); in CmdOnRecvMessage() 80 int fd = open(realPath, O_RDWR); in CmdOnRecvMessage() 81 free(realPath); in CmdOnRecvMessage()
|
/base/sensors/miscdevice/utils/common/src/ |
H A D | file_utils.cpp | 44 char realPath[PATH_MAX] = {};
in ReadJsonFile() local 45 if (realpath(filePath.c_str(), realPath) == nullptr) {
in ReadJsonFile() 49 if (!CheckFileDir(realPath, CONFIG_DIR)) {
in ReadJsonFile() 53 if (!CheckFileExtendName(realPath, "json")) {
in ReadJsonFile() 57 if (!IsFileExists(realPath)) {
in ReadJsonFile() 61 if (!CheckFileSize(realPath)) {
in ReadJsonFile() 65 FILE *fp = fopen(realPath, "r");
in ReadJsonFile()
|
/base/security/code_signature/interfaces/innerkits/code_sign_utils/src/ |
H A D | code_sign_utils.cpp | 179 std::string realPath;
184 if (!OHOS::PathToRealPath(path, realPath)) {
194 return EnableCodeSignForFile(realPath, arg);
227 std::string realPath;
228 if (!OHOS::PathToRealPath(path, realPath)) {
233 ret = codeSignHelper.ParseCodeSignBlock(realPath, storedEntryMap_, type);
235 return HandleCodeSignBlockFailure(realPath, ret);
241 int32_t CodeSignUtils::HandleCodeSignBlockFailure(const std::string &realPath, int32_t ret)
247 ReportParseCodeSig(realPath, ret);
|
/base/msdp/device_status/libs/src/ |
H A D | devicestatus_data_parse.cpp | 139 char realPath[PATH_MAX] = { 0 }; in ReadJsonFile() local 140 if (realpath(filePath.c_str(), realPath) == nullptr) { in ReadJsonFile() 144 if (!CheckFileDir(realPath, MSDP_DATA_DIR)) { in ReadJsonFile() 148 if (!CheckFileExtendName(realPath, "json")) { in ReadJsonFile() 160 return ReadFile(realPath); in ReadJsonFile()
|
/base/security/selinux_adapter/framework/policycoreutils/src/ |
H A D | selinux_restorecon.c | 104 static int RestoreconRecurseFromParentDir(const char *realPath, char *newSecontext) in RestoreconRecurseFromParentDir() argument 107 paths[0] = strdup(realPath); in RestoreconRecurseFromParentDir() 195 char realPath[PATH_MAX + 1] = { 0x00 }; in RestoreconFromParentDir() local 197 if (realpath(path, realPath) == NULL || realpath(path, parent) == NULL) { in RestoreconFromParentDir() 208 int ret = RestoreconRecurseFromParentDir(realPath, parentSecontext); in RestoreconFromParentDir()
|
/base/hiviewdfx/hiview/plugins/usage_event_report/service/ |
H A D | usage_event_report_service.cpp | 48 char realPath[PATH_MAX] = { 0x00 };
in InitWorkPath() local 49 if (strlen(path) >= PATH_MAX || realpath(path, realPath) == nullptr) {
in InitWorkPath() 53 if (std::string realPathStr = realPath; realPathStr.rfind(DEFAULT_WORK_PATH, 0) != 0) {
in InitWorkPath() 57 workPath_ = realPath;
in InitWorkPath()
|
/base/telephony/sms_mms/frameworks/native/mms/src/ |
H A D | mms_buffer.cpp | 104 char realPath[PATH_MAX] = {0}; in WriteBufferFromFile() local 105 if (strPathName.empty() || realpath(strPathName.c_str(), realPath) == NULL) { in WriteBufferFromFile() 106 TELEPHONY_LOGE("path or realPath is NULL"); in WriteBufferFromFile() 110 std::string filePath = realPath; in WriteBufferFromFile() 119 pFile = fopen(realPath, "rb"); in WriteBufferFromFile()
|