Loading init/fuzzer/init_parser_fuzzer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ void InitParserFuzzer::InvokeParser() { std::string path = fdp_.ConsumeBool() ? fdp_.PickValueInArray(kValidPaths) : fdp_.ConsumeRandomLengthString(kMaxBytes); parser.ParseConfig(path); parser.ParseConfigFileInsecure(path); parser.ParseConfigFileInsecure(path, false /* follow_symlinks */); } void InitParserFuzzer::Process() { Loading init/host_init_verifier.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,9 @@ int main(int argc, char** argv) { } } } else { if (!parser.ParseConfigFileInsecure(*argv)) { if (!parser.ParseConfigFileInsecure(*argv, true /* follow_symlinks */)) { // Follow symlinks as inputs during build execution in Bazel's // execution root are symlinks, unlike Soong or Make. LOG(ERROR) << "Failed to open init rc script '" << *argv << "'"; return EXIT_FAILURE; } Loading init/parser.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -131,9 +131,9 @@ void Parser::ParseData(const std::string& filename, std::string* data) { } } bool Parser::ParseConfigFileInsecure(const std::string& path) { bool Parser::ParseConfigFileInsecure(const std::string& path, bool follow_symlinks = false) { std::string config_contents; if (!android::base::ReadFileToString(path, &config_contents)) { if (!android::base::ReadFileToString(path, &config_contents, follow_symlinks)) { return false; } Loading init/parser.h +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ class Parser { void AddSingleLineParser(const std::string& prefix, LineCallback callback); // Host init verifier check file permissions. bool ParseConfigFileInsecure(const std::string& path); bool ParseConfigFileInsecure(const std::string& path, bool follow_symlinks); size_t parse_error_count() const { return parse_error_count_; } Loading Loading
init/fuzzer/init_parser_fuzzer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ void InitParserFuzzer::InvokeParser() { std::string path = fdp_.ConsumeBool() ? fdp_.PickValueInArray(kValidPaths) : fdp_.ConsumeRandomLengthString(kMaxBytes); parser.ParseConfig(path); parser.ParseConfigFileInsecure(path); parser.ParseConfigFileInsecure(path, false /* follow_symlinks */); } void InitParserFuzzer::Process() { Loading
init/host_init_verifier.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,9 @@ int main(int argc, char** argv) { } } } else { if (!parser.ParseConfigFileInsecure(*argv)) { if (!parser.ParseConfigFileInsecure(*argv, true /* follow_symlinks */)) { // Follow symlinks as inputs during build execution in Bazel's // execution root are symlinks, unlike Soong or Make. LOG(ERROR) << "Failed to open init rc script '" << *argv << "'"; return EXIT_FAILURE; } Loading
init/parser.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -131,9 +131,9 @@ void Parser::ParseData(const std::string& filename, std::string* data) { } } bool Parser::ParseConfigFileInsecure(const std::string& path) { bool Parser::ParseConfigFileInsecure(const std::string& path, bool follow_symlinks = false) { std::string config_contents; if (!android::base::ReadFileToString(path, &config_contents)) { if (!android::base::ReadFileToString(path, &config_contents, follow_symlinks)) { return false; } Loading
init/parser.h +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ class Parser { void AddSingleLineParser(const std::string& prefix, LineCallback callback); // Host init verifier check file permissions. bool ParseConfigFileInsecure(const std::string& path); bool ParseConfigFileInsecure(const std::string& path, bool follow_symlinks); size_t parse_error_count() const { return parse_error_count_; } Loading