| 500 | |
| 501 | |
| 502 | Try<ContainerSeccompProfile> parseProfile(const string& path) |
| 503 | { |
| 504 | Try<string> read = os::read(path); |
| 505 | if (read.isError()) { |
| 506 | return Error( |
| 507 | "Failed to read Seccomp profile file '" + path + "': " + read.error()); |
| 508 | } |
| 509 | |
| 510 | Try<ContainerSeccompProfile> profile = parseProfileData(read.get()); |
| 511 | if (profile.isError()) { |
| 512 | return Error( |
| 513 | "Failed to parse Seccomp profile '" + path + "': " + profile.error()); |
| 514 | } |
| 515 | |
| 516 | return profile; |
| 517 | } |
| 518 | |
| 519 | } // namespace seccomp { |
| 520 | } // namespace internal { |