summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorben <ben@chromium.org>2016-02-23 23:50:19 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-24 07:51:20 +0000
commita16b491f249de01d84114889f2ea3a8aea966413 (patch)
treebf275c5f7a0fb4704e170b4d2aa112bec1288313 /ash
parent3436fa2dc73318d3dbaf6a6784d0ddee9be0243d (diff)
downloadchromium_src-a16b491f249de01d84114889f2ea3a8aea966413.zip
chromium_src-a16b491f249de01d84114889f2ea3a8aea966413.tar.gz
chromium_src-a16b491f249de01d84114889f2ea3a8aea966413.tar.bz2
Add a user id parameter to connections.
This is simply a uint32 that identifies the user running a particular instance. Note that the shell cares nothing about higher level semantic meaning/mapping of this identifier. That's for a user service to perform. An application that connects to another specifies the user id they wish the target to be run as. This can either be a specific user, the root user, or "inherit" which means either their own identity or root, whichever is available in that order. The application manager resolves "inherit" to the source identity or the root identity, and initializes & completes the connection. When a target application is initialized, the shell tells it (via Initialize()) the identity it is run as. When a target application receives an inbound connection, the shell tells it (via AcceptConnection) the identity of the caller. This allows a service run as root to service connections from other users, and create facades scoped to that user. Long term, only specific applications will be able to pass anything other than "inherit" as the user id. (e.g. the login app and the profile creator app). This isn't done in this CL. I need to add some tests for this, along with the rest of the shell stuff. TBD. R=sky@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Review URL: https://codereview.chromium.org/1719193003 Cr-Commit-Position: refs/heads/master@{#377239}
Diffstat (limited to 'ash')
-rw-r--r--ash/mus/sysui_application.cc3
-rw-r--r--ash/mus/sysui_application.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/ash/mus/sysui_application.cc b/ash/mus/sysui_application.cc
index d5e008c..739242d 100644
--- a/ash/mus/sysui_application.cc
+++ b/ash/mus/sysui_application.cc
@@ -256,7 +256,8 @@ SysUIApplication::~SysUIApplication() {}
void SysUIApplication::Initialize(mojo::Shell* shell,
const std::string& url,
- uint32_t id) {
+ uint32_t id,
+ uint32_t user_id) {
ash_init_.reset(new AshInit());
ash_init_->Initialize(shell);
}
diff --git a/ash/mus/sysui_application.h b/ash/mus/sysui_application.h
index d7bebe5..c09804e 100644
--- a/ash/mus/sysui_application.h
+++ b/ash/mus/sysui_application.h
@@ -24,7 +24,8 @@ class SysUIApplication : public mojo::ShellClient {
// mojo::ShellClient:
void Initialize(mojo::Shell* shell,
const std::string& url,
- uint32_t id) override;
+ uint32_t id,
+ uint32_t user_id) override;
bool AcceptConnection(mojo::Connection* connection) override;
mojo::TracingImpl tracing_;