From 92ae20abe98d1ece5293ce69c77762627db7708f Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 29 Mar 2018 15:07:55 -0400 Subject: External Proprietary Lock Screen URL Fix The service enpoints in the policy table should be saved as strings instead of integers. --- src/components/policy/policy_external/src/sql_pt_queries.cc | 2 +- src/components/policy/policy_external/src/sql_pt_representation.cc | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc index 4afce16885..9702c315b0 100644 --- a/src/components/policy/policy_external/src/sql_pt_queries.cc +++ b/src/components/policy/policy_external/src/sql_pt_queries.cc @@ -325,7 +325,7 @@ const std::string kCreateSchema = "`consent_group.fk_consent_group_functional_group1_idx` " " ON `consent_group`(`functional_group_id`); " "CREATE TABLE IF NOT EXISTS `endpoint`( " - " `service` INTEGER NOT NULL, " + " `service` VARCHAR(100) NOT NULL, " " `url` VARCHAR(100) NOT NULL, " " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, " " CONSTRAINT `fk_endpoint_application1` " diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index f9cc5e5ed5..6cc68cb102 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -1262,11 +1262,7 @@ bool SQLPTRepresentation::SaveServiceEndpoints( const policy_table::URL& urls = app_it->second; policy_table::URL::const_iterator url_it; for (url_it = urls.begin(); url_it != urls.end(); ++url_it) { - std::stringstream temp_stream(it->first); - int service; - temp_stream.seekg(3); - temp_stream >> service; - query.Bind(0, service); + query.Bind(0, it->first); query.Bind(1, *url_it); query.Bind(2, app_it->first); if (!query.Exec() || !query.Reset()) { -- cgit v1.2.1