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

Unified Diff: dbus_service.cc

Issue 3965001: AU: Restrict URL/version change over D-Bus to non-official builds only. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Created 10 years, 2 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 | utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus_service.cc
diff --git a/dbus_service.cc b/dbus_service.cc
index 677dbc85990469fdb8e1a293bd833b1acf5268ea..63fbf501da1f2c841d4166e63c3211ef782be261 100644
--- a/dbus_service.cc
+++ b/dbus_service.cc
@@ -3,9 +3,13 @@
// found in the LICENSE file.
#include "update_engine/dbus_service.h"
+
#include <string>
-#include "base/logging.h"
+
+#include <base/logging.h>
+
#include "update_engine/marshal.glibmarshal.h"
+#include "update_engine/utils.h"
using std::string;
@@ -51,8 +55,18 @@ gboolean update_engine_service_attempt_update(UpdateEngineService* self,
gchar* app_version,
gchar* omaha_url,
GError **error) {
- const string update_app_version = app_version ? app_version : "";
- const string update_omaha_url = omaha_url ? omaha_url : "";
+ string update_app_version;
+ string update_omaha_url;
+ // Only non-official (e.g., dev and test) builds can override the current
+ // version and update server URL over D-Bus.
+ if (!chromeos_update_engine::utils::IsOfficialBuild()) {
+ if (app_version) {
+ update_app_version = app_version;
+ }
+ if (omaha_url) {
+ update_omaha_url = omaha_url;
+ }
+ }
LOG(INFO) << "Attempt update: app_version=\"" << update_app_version << "\" "
<< "omaha_url=\"" << update_omaha_url << "\"";
self->update_attempter_->CheckForUpdate(app_version, omaha_url);
« no previous file with comments | « no previous file | utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698