MCPcopy Create free account
hub / github.com/apache/mesos / parseProfileData

Function parseProfileData

src/linux/seccomp/seccomp_parser.cpp:468–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466
467
468Try<ContainerSeccompProfile> parseProfileData(const string& data)
469{
470 Try<JSON::Object> json = JSON::parse<JSON::Object>(data);
471 if (json.isError()) {
472 return Error(json.error());
473 }
474
475 ContainerSeccompProfile profile;
476
477 Try<Nothing> defaultAction = parseDefaultAction(json.get(), &profile);
478 if (defaultAction.isError()) {
479 return Error(defaultAction.error());
480 }
481
482 Try<Nothing> archMap = parseArchMap(json.get(), &profile);
483 if (archMap.isError()) {
484 return Error(archMap.error());
485 }
486
487 Try<Nothing> syscalls = parseSyscalls(json.get(), &profile);
488 if (syscalls.isError()) {
489 return Error(syscalls.error());
490 }
491
492 // Verify Seccomp profile.
493 Try<Owned<SeccompFilter>> seccompFilter = SeccompFilter::create(profile);
494 if (seccompFilter.isError()) {
495 return Error(seccompFilter.error());
496 }
497
498 return std::move(profile);
499}
500
501
502Try<ContainerSeccompProfile> parseProfile(const string& path)

Callers 2

TEST_FFunction · 0.85
parseProfileFunction · 0.85

Calls 8

parseDefaultActionFunction · 0.85
parseArchMapFunction · 0.85
parseSyscallsFunction · 0.85
errorMethod · 0.65
ErrorFunction · 0.50
createFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45

Tested by 1

TEST_FFunction · 0.68