Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: chromeos/process.h

Issue 6865041: libchromeos: Support setting uid/gid of child processes in process.h (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/common.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chromeos/process.cc » ('j') | chromeos/process.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/process.h
diff --git a/chromeos/process.h b/chromeos/process.h
index 9c45bfa15cae35e4732181cbb50fda90d4e78882..4f6bfda70145aebc87d229b61d54c93521115635 100644
--- a/chromeos/process.h
+++ b/chromeos/process.h
@@ -51,6 +51,12 @@ class Process {
// from child process's perspective iff |is_input|.
virtual void RedirectUsingPipe(int child_fd, bool is_input) = 0;
+ // Set the real/effective/saved user ID of the child process.
+ virtual void SetUid(uid_t uid) = 0;
+
+ // Set the real/effective/saved group ID of the child process.
+ virtual void SetGid(gid_t gid) = 0;
+
// Gets the pipe file descriptor mapped to the process's |child_fd|.
virtual int GetPipe(int child_fd) = 0;
@@ -100,6 +106,8 @@ class ProcessImpl : public Process {
virtual void AddArg(const std::string& arg);
virtual void RedirectOutput(const std::string& output_file);
virtual void RedirectUsingPipe(int child_fd, bool is_input);
+ virtual void SetUid(uid_t uid);
+ virtual void SetGid(gid_t gid);
virtual int GetPipe(int child_fd);
virtual bool Start();
virtual int Wait();
@@ -122,12 +130,6 @@ class ProcessImpl : public Process {
};
typedef std::map<int, PipeInfo> PipeMap;
- std::string output_file_;
- std::vector<std::string> arguments_;
- // Map of child target file descriptors (first) to information about
- // pipes created (second).
- PipeMap pipe_map_;
-
void UpdatePid(pid_t new_pid);
bool PopulatePipeMap();
@@ -136,6 +138,13 @@ class ProcessImpl : public Process {
// process. pid must not be modified except by calling
// UpdatePid(new_pid).
pid_t pid_;
+ std::string output_file_;
+ std::vector<std::string> arguments_;
+ // Map of child target file descriptors (first) to information about
+ // pipes created (second).
+ PipeMap pipe_map_;
+ uid_t uid_;
+ gid_t gid_;
};
} // namespace chromeos
« no previous file with comments | « no previous file | chromeos/process.cc » ('j') | chromeos/process.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698