Id in <tizen:app-widget> element should begin with <TIZEN_APPLICATION_ID>
authorKarol Pawlowski <k.pawlowski@samsung.com>
Tue, 1 Oct 2013 12:21:01 +0000 (14:21 +0200)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Tue, 1 Oct 2013 17:40:26 +0000 (17:40 +0000)
[Issue#]   WGL-573
[Problem]  Valid Id of <tizen:app-widget> element should be in format of
           <TIZEN_APPLICATION_ID>.<STRING>
[Cause]    Missing proper routine to check this condition.
[Solution] Add routine to check app-widget id.

[Verification]
    * Install widget attached to issue, which should fail:
      https://bugs.tizendev.org/jira/browse/WGL-573
    * Install correct widget, which should pass:
      https://bugs.tizendev.org/jira/browse/WGL-574

Change-Id: I07c408f192aab083cd0513e73bc35ffab7ed870d

src/jobs/widget_install/task_process_config.cpp

index f2967b9..3e41d24 100755 (executable)
@@ -508,6 +508,11 @@ void TaskProcessConfig::StepVerifyLivebox()
     FOREACH (it, liveBoxList) {
         std::string boxType;
 
+        if ((**it).m_liveboxId.find(m_installContext.widgetConfig.tzAppid) != 0) {
+            _E("Invalid app-widget id (doesn't begin with application id)");
+            ThrowMsg(Exceptions::WidgetConfigFileInvalid, "Invalid app-widget id (doesn't begin with application id)");
+        }
+
         if ((**it).m_type.empty()) {
             boxType = web_provider_livebox_get_default_type();
         } else {