summaryrefslogtreecommitdiffstats
path: root/sandbox/linux/suid/linux_util.h
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 03:16:17 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 03:16:17 +0000
commitf8dd43724006ea8b000d1a842e66bc7b1b50d024 (patch)
tree83be185f7f05a432dae736d02975ebc80dd99c61 /sandbox/linux/suid/linux_util.h
parent739ee563b8acbc93d8c596d3d721fe794c334923 (diff)
downloadchromium_src-f8dd43724006ea8b000d1a842e66bc7b1b50d024.zip
chromium_src-f8dd43724006ea8b000d1a842e66bc7b1b50d024.tar.gz
chromium_src-f8dd43724006ea8b000d1a842e66bc7b1b50d024.tar.bz2
Allow chrome_sandbox to act as a helper program and find the socket with a given inode number.
BUG=none TEST=none Review URL: http://codereview.chromium.org/312003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30931 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/linux/suid/linux_util.h')
-rw-r--r--sandbox/linux/suid/linux_util.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/sandbox/linux/suid/linux_util.h b/sandbox/linux/suid/linux_util.h
new file mode 100644
index 0000000..72e3f00
--- /dev/null
+++ b/sandbox/linux/suid/linux_util.h
@@ -0,0 +1,20 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// The following is duplicated from base/linux_utils.h.
+// We shouldn't link against C++ code in a setuid binary.
+
+#ifndef SANDBOX_LINUX_SUID_LINUX_UTIL_H_
+#define SANDBOX_LINUX_SUID_LINUX_UTIL_H_
+
+#include <stdbool.h>
+#include <sys/types.h>
+
+static const char kFindInodeSwitch[] = "--find-inode";
+
+// Find the process which holds the given socket, named by inode number. If
+// multiple processes hold the socket, this function returns false.
+bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode);
+
+#endif // SANDBOX_LINUX_SUID_LINUX_UTIL_H_