blob: 7686330d296b1dd5adeadaad3119b2056e476420 [file] [log] [blame]
drewry@google.combd940e92009-12-07 19:13:27 +00001// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4// Some portions Copyright (c) 2009 The Chromium Authors.
5//
6// Default Interface implementation
7
8#include "minijail/env.h"
9#include "minijail/options.h"
10#include "minijail/interface.h"
11
12namespace chromeos {
13namespace minijail {
14
15bool Interface::Run() const {
Will Drewry8e7799c2009-12-07 15:50:16 -080016 if (!options() || !options()->env()) {
17 LOG(ERROR) << "Initialize() not called or called with bad Env";
18 return false;
19 }
20 if (!options()->executable_path()) {
21 LOG(ERROR) << "No executable path given.";
22 return false;
23 }
drewry@google.combd940e92009-12-07 19:13:27 +000024 return options()->env()->Run(options()->executable_path(),
25 options()->arguments(),
26 options()->environment());
27}
28
29} // namespace minijail
30} // namespace chromeos