blob: 76dadb946d1748538007d69dccee49c83a68e217 [file] [log] [blame]
Hardik Goyalb09d6b02019-08-13 16:15:50 -07001// Copyright 2019 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
5#include "debugd/src/helper_utils.h"
6
7#include <inttypes.h>
8#include <vector>
9
10#include <base/strings/stringprintf.h>
11
12namespace debugd {
13
14bool GetHelperPath(const std::string& relative_path, std::string* full_path) {
15 const char* helpers_dir = "/usr/libexec/debugd/helpers";
16 std::string path =
17 base::StringPrintf("%s/%s", helpers_dir, relative_path.c_str());
18
19 if (path.length() > PATH_MAX)
20 return false;
21
22 *full_path = path;
23 return true;
24}
25
26} // namespace debugd