Skip to content

Commit

Permalink
Remove moreinfo attribute
Browse files Browse the repository at this point in the history
The moreinfo attribute is not used by Flatcar and is Mac-specific
(see https://github.com/google/omaha/blob/main/doc/ServerProtocolV2.md).
Remove the unused moreinfo attribute (for the web view URL shown by
Google Software Update Agent on the Mac).
  • Loading branch information
pothos committed Jul 5, 2023
1 parent cb7fc92 commit a4ea93f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/update_engine/omaha_request_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ static const char* kTagMaxFailureCountPerUrl = "MaxFailureCountPerUrl";
// Deprecated: "ManifestSize"
// Deprecated: "MetadataSignatureRsa"
// Deprecated: "MetadataSize"
static const char* kTagMoreInfo = "MoreInfo";
// Deprecated: "MoreInfo"; See https://github.com/google/omaha/blob/main/doc/ServerProtocolV2.md
// "And on the Mac, the Google Software Update Agent supports the following optional attributes": Prompt, MoreInfo
static const char* kTagNeedsAdmin = "needsadmin";
static const char* kTagPrompt = "Prompt";
static const char* kTagSha256 = "sha256";
Expand Down Expand Up @@ -590,7 +591,6 @@ bool OmahaRequestAction::ParseParams(xmlDoc* doc,
}

// Get the optional properties one by one.
output_object->more_info_url = XmlGetProperty(pie_action_node, kTagMoreInfo);
output_object->needs_admin =
XmlGetProperty(pie_action_node, kTagNeedsAdmin) == "true";
output_object->prompt = XmlGetProperty(pie_action_node, kTagPrompt) == "true";
Expand Down
11 changes: 1 addition & 10 deletions src/update_engine/omaha_request_action_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ string GetNoUpdateResponse(const string& app_id) {

string GetUpdateResponse2(const string& app_id,
const string& display_version,
const string& more_info_url,
const string& prompt,
const string& codebase,
const string& filename,
Expand All @@ -87,7 +86,7 @@ string GetUpdateResponse2(const string& app_id,
"<packages><package hash=\"not-used\" name=\"" + filename + "\" "
"size=\"" + size + "\"/></packages>"
"<actions><action event=\"postinstall\" "
"MoreInfo=\"" + more_info_url + "\" Prompt=\"" + prompt + "\" "
"Prompt=\"" + prompt + "\" "
"IsDelta=\"true\" "
"IsDeltaPayload=\"true\" "
"sha256=\"" + hash + "\" "
Expand All @@ -99,7 +98,6 @@ string GetUpdateResponse2(const string& app_id,

string GetUpdateResponse(const string& app_id,
const string& display_version,
const string& more_info_url,
const string& prompt,
const string& codebase,
const string& filename,
Expand All @@ -108,7 +106,6 @@ string GetUpdateResponse(const string& app_id,
const string& size) {
return GetUpdateResponse2(app_id,
display_version,
more_info_url,
prompt,
codebase,
filename,
Expand Down Expand Up @@ -211,7 +208,6 @@ TEST(OmahaRequestActionTest, ValidUpdateTest) {
GetDefaultTestParams(),
GetUpdateResponse(OmahaRequestParams::kAppId,
"1.2.3.4", // version
"http://more/info",
"true", // prompt
"http://code/base/", // dl url
"file.signed", // file name
Expand All @@ -227,7 +223,6 @@ TEST(OmahaRequestActionTest, ValidUpdateTest) {
EXPECT_TRUE(response.update_exists);
EXPECT_EQ("1.2.3.4", response.display_version);
EXPECT_EQ("http://code/base/file.signed", response.payload_urls[0]);
EXPECT_EQ("http://more/info", response.more_info_url);
EXPECT_EQ("HASH1234=", response.hash);
EXPECT_EQ(123, response.size);
EXPECT_FALSE(response.needs_admin);
Expand Down Expand Up @@ -368,7 +363,6 @@ TEST(OmahaRequestActionTest, MissingFieldTest) {
EXPECT_TRUE(response.update_exists);
EXPECT_EQ("1.0.0.0", response.display_version);
EXPECT_EQ("http://missing/field/test/f", response.payload_urls[0]);
EXPECT_EQ("", response.more_info_url);
EXPECT_EQ("lkq34j5345", response.hash);
EXPECT_EQ(587, response.size);
EXPECT_TRUE(response.needs_admin);
Expand Down Expand Up @@ -502,7 +496,6 @@ TEST(OmahaRequestActionTest, XmlDecodeTest) {
GetDefaultTestParams(),
GetUpdateResponse(OmahaRequestParams::kAppId,
"1.2.3.4", // version
"testthe&lt;url", // more info
"true", // prompt
"testthe&amp;codebase/", // dl url
"file.signed", // file name
Expand All @@ -515,7 +508,6 @@ TEST(OmahaRequestActionTest, XmlDecodeTest) {
&response,
NULL));

EXPECT_EQ(response.more_info_url, "testthe<url");
EXPECT_EQ(response.payload_urls[0], "testthe&codebase/file.signed");
}

Expand All @@ -526,7 +518,6 @@ TEST(OmahaRequestActionTest, ParseIntTest) {
GetDefaultTestParams(),
GetUpdateResponse(OmahaRequestParams::kAppId,
"1.2.3.4", // version
"theurl", // more info
"true", // prompt
"thecodebase/", // dl url
"file.signed", // file name
Expand Down
1 change: 0 additions & 1 deletion src/update_engine/omaha_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ struct OmahaResponse {
// URL (i.e. in terms of Omaha XML, each value is a urlBase + packageName)
std::vector<std::string> payload_urls;

std::string more_info_url;
std::string hash;
off_t size;
// The number of URL-related failures to tolerate before moving on to the
Expand Down
3 changes: 0 additions & 3 deletions src/update_engine/omaha_response_handler_action_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ TEST_F(OmahaResponseHandlerActionTest, SimpleTest) {
in.update_exists = true;
in.display_version = "a.b.c.d";
in.payload_urls.push_back("http://foo/the_update_a.b.c.d.tgz");
in.more_info_url = "http://more/info";
in.hash = "HASH+";
in.size = 12;
in.needs_admin = true;
Expand All @@ -102,7 +101,6 @@ TEST_F(OmahaResponseHandlerActionTest, SimpleTest) {
in.update_exists = true;
in.display_version = "a.b.c.d";
in.payload_urls.push_back("http://foo/the_update_a.b.c.d.tgz");
in.more_info_url = "http://more/info";
in.hash = "HASHj+";
in.size = 12;
in.needs_admin = true;
Expand All @@ -119,7 +117,6 @@ TEST_F(OmahaResponseHandlerActionTest, SimpleTest) {
in.update_exists = true;
in.display_version = "a.b.c.d";
in.payload_urls.push_back(kLongName);
in.more_info_url = "http://more/info";
in.hash = "HASHj+";
in.size = 12;
in.needs_admin = true;
Expand Down

0 comments on commit a4ea93f

Please sign in to comment.