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

Unified Diff: remoting/host/remoting_me2me_host.cc

Issue 1710653002: Prevent creation of the GnubbyExtension if no socket name is defined. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 788968be2ae1b10a87b9ff3d911a4ecf63a522fa..dd35409a255a6bf48a205439341dbdcb4551bc26 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -427,7 +427,8 @@ class HostProcess : public ConfigWatcher::Delegate,
bool curtain_required_;
ThirdPartyAuthConfig third_party_auth_config_;
- bool enable_gnubby_auth_;
+ bool gnubby_auth_policy_enabled_;
+ bool skip_gnubby_extension_creation_;
Lambros 2016/02/18 01:02:39 Optional: Maybe better to invert the meaning and c
joedow 2016/02/18 02:24:37 That's a good point, I was originally thinking I w
// Boolean to change flow, where necessary, if we're
// capturing a window instead of the entire desktop.
@@ -491,7 +492,8 @@ HostProcess::HostProcess(scoped_ptr<ChromotingHostContext> context,
allow_relay_(true),
allow_pairing_(true),
curtain_required_(false),
- enable_gnubby_auth_(false),
+ gnubby_auth_policy_enabled_(false),
+ skip_gnubby_extension_creation_(false),
enable_window_capture_(false),
window_id_(0),
self_(this),
@@ -886,8 +888,12 @@ void HostProcess::StartOnUiThread() {
base::FilePath gnubby_socket_name = base::CommandLine::ForCurrentProcess()->
GetSwitchValuePath(kAuthSocknameSwitchName);
- if (!gnubby_socket_name.empty())
+ if (!gnubby_socket_name.empty()) {
remoting::GnubbyAuthHandler::SetGnubbySocketName(gnubby_socket_name);
+ } else {
+ // No socket name means no gnubby support.
+ skip_gnubby_extension_creation_ = true;
+ }
#endif // defined(OS_LINUX)
// Create a desktop environment factory appropriate to the build type &
@@ -1395,11 +1401,11 @@ bool HostProcess::OnGnubbyAuthPolicyUpdate(base::DictionaryValue* policies) {
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
if (!policies->GetBoolean(policy::key::kRemoteAccessHostAllowGnubbyAuth,
- &enable_gnubby_auth_)) {
+ &gnubby_auth_policy_enabled_)) {
return false;
}
- if (enable_gnubby_auth_) {
+ if (gnubby_auth_policy_enabled_) {
HOST_LOG << "Policy enables gnubby auth.";
} else {
HOST_LOG << "Policy disables gnubby auth.";
@@ -1536,7 +1542,7 @@ void HostProcess::StartHost() {
context_->audio_task_runner(),
context_->video_encode_task_runner()));
- if (enable_gnubby_auth_) {
+ if (gnubby_auth_policy_enabled_ && !skip_gnubby_extension_creation_) {
host_->AddExtension(make_scoped_ptr(new GnubbyExtension()));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698