<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" version="0.0.1" viewmodes="fullscreen">
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" version="00.00.0001" viewmodes="fullscreen windowed floating">
<name>hello</name>
+ <name xml:lang="en">hello</name>
<icon src="icon.png" />
<!-- tizen application element -->
<xs:include schemaLocation="access.xsd"/>
<xs:include schemaLocation="updates.xsd"/>
<xs:import namespace="http://tizen.org/ns/widgets" schemaLocation="widgets.tizen.xsd"/>
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<!--
Widget Packaging and Configuration <http://www.w3.org/TR/widgets/>
requires common.rnc
<xs:attributeGroup ref="widgets:extension"/>
<xs:attribute name="id" type="xs:anyURI"/>
<xs:attribute name="defaultlocale"/>
- <xs:attribute name="version"/>
+ <xs:attribute name="version" type="widgets:data.versionNumber"/>
<xs:attribute name="min-version" type="widgets:data.versionNumber"/>
<xs:attribute name="height" type="widgets:data.positiveNumber"/>
<xs:attribute name="width" type="widgets:data.positiveNumber"/>
</xs:list>
</xs:simpleType>
</xs:attribute>
+ <!-- Requirment from IDE UX -->
+ <xs:attribute ref="xml:lang"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element ref="widgets:span"/>
<xs:group ref="widgets:foreignElement"/>
</xs:choice>
+ <!-- Requirment from IDE UX -->
+ <xs:attribute ref="xml:lang"/>
<xs:attributeGroup ref="widgets:global.attrs"/>
<xs:attributeGroup ref="widgets:global.xml"/>
<xs:attributeGroup ref="widgets:extension"/>
<xs:element ref="widgets:span"/>
<xs:group ref="widgets:foreignElement"/>
</xs:choice>
+ <!-- Requirment from IDE UX -->
+ <xs:attribute ref="xml:lang"/>
<xs:attributeGroup ref="widgets:global.attrs"/>
<xs:attributeGroup ref="widgets:global.xml"/>
<xs:attributeGroup ref="widgets:extension"/>
<xs:element ref="widgets:span"/>
<xs:group ref="widgets:foreignElement"/>
</xs:choice>
+ <!-- Requirment from IDE UX -->
+ <xs:attribute ref="xml:lang"/>
<xs:attributeGroup ref="widgets:global.attrs"/>
<xs:attributeGroup ref="widgets:global.xml"/>
<xs:attributeGroup ref="widgets:extension"/>
</xs:complexType>
</xs:element>
- <xs:element name="content-security-policy" type="xs:string"/>
- <xs:element name="content-security-policy-report-only" type="xs:string"/>
- <xs:element name="allow-navigation" type="xs:string"/>
+ <xs:element name="content-security-policy">
+ <xs:complexType mixed="true">
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="content-security-policy-report-only">
+ <xs:complexType mixed="true">
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="allow-navigation">
+ <xs:complexType mixed="true">
+ </xs:complexType>
+ </xs:element>
<xs:element name="app-widget">
<xs:complexType mixed="true">
#git:framework/web/wrt-installer
Name: wrt-installer
Summary: Installer for tizen Webruntime
-Version: 0.1.88
+Version: 0.1.90
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
LogError("Failed to unzip for widget");
result = ConfigureResult::Failed_DrmError;
}
+ Catch(Exceptions::MissingConfig)
+ {
+ LogError("Failed to localize config.xml");
+ result = ConfigureResult::Failed_InvalidConfig;
+ }
return result;
}
}
}
+ if(!DPL::Utils::Path(configFile).Exists())
+ {
+ ThrowMsg(Exceptions::MissingConfig, "Config file not exists");
+ }
+
parser.Parse(configFile,
ElementParserPtr(
new RootParser<WidgetParser>(configInfo,
Jobs::WidgetInstall::TaskSmack::SmackFolderLabelingStep()");
#ifdef WRT_SMACK_ENABLED
/* /opt/usr/apps/[pkgid] directory's label is "_" */
- if (PC_OPERATION_SUCCESS != app_label_dir("_",
- m_context.locations->getPackageInstallationDir().c_str())) {
+ if (PC_OPERATION_SUCCESS != app_setup_path(m_pkgId,
+ m_context.locations->getPackageInstallationDir().c_str(),
+ APP_PATH_ANY_LABEL, "_")) {
LogWarning("Add label to " <<
m_context.locations->getPackageInstallationDir());
}
/* res directory */
std::string resDir = m_context.locations->getPackageInstallationDir() +
"/res";
- if (PC_OPERATION_SUCCESS != app_label_dir(m_pkgId,
- resDir.c_str())) {
+
+ if (PC_OPERATION_SUCCESS != app_setup_path(m_pkgId, resDir.c_str(),
+ APP_PATH_PRIVATE)) {
LogWarning("Add label to " << resDir);
}
+ /* data directory */
+ if (PC_OPERATION_SUCCESS != app_setup_path(m_pkgId,
+ m_context.locations->getPrivateStorageDir().c_str(),
+ APP_PATH_PRIVATE)) {
+ LogWarning("Add label to " << m_context.locations->getPrivateStorageDir());
+ }
+
/* for prealod */
if (m_context.mode.installTime == InstallMode::InstallTime::PRELOAD &&
m_context.mode.extension != InstallMode::ExtensionType::DIR)
{
- if (PC_OPERATION_SUCCESS != app_label_dir("_",
- m_context.locations->getUserDataRootDir().c_str())) {
- LogWarning("Add label to " << m_context.locations->getUserDataRootDir());
+ if (PC_OPERATION_SUCCESS != app_setup_path(m_pkgId,
+ m_context.locations->getUserDataRootDir().c_str(),
+ APP_PATH_GROUP_RW, "_")) {
}
}
- /* data directory */
- if (PC_OPERATION_SUCCESS !=
- app_label_dir(m_pkgId,
- m_context.locations->getPrivateStorageDir().c_str()))
- {
- LogWarning("Add label to " << m_context.locations->getPrivateStorageDir());
- }
-
/* tmp directory */
- if (PC_OPERATION_SUCCESS !=
- app_label_dir(m_pkgId,
- m_context.locations->getPrivateTempStorageDir().c_str()))
+ if (PC_OPERATION_SUCCESS != app_setup_path(m_pkgId,
+ m_context.locations->getPrivateTempStorageDir().c_str(),
+ APP_PATH_PRIVATE))
{
LogWarning("Add label to " << m_context.locations->getPrivateTempStorageDir());
}
/* bin directory */
- if (PC_OPERATION_SUCCESS != app_label_dir(m_pkgId,
- m_context.locations->getBinaryDir().c_str())) {
+ if (PC_OPERATION_SUCCESS != app_setup_path(m_pkgId,
+ m_context.locations->getBinaryDir().c_str(),
+ APP_PATH_PRIVATE)) {
LogWarning("Add label to " << m_context.locations->getBinaryDir());
}
#ifdef WRT_SMACK_ENABLED
/* TODO :
std::string id = DPL::ToUTF8String(m_context.widgetConfig.tzAppid);
- std::string id = DPL::ToUTF8String(m_context.widgetConfig.tzPkgid);
char* appId = NULL;
appId = (char*)calloc(1, id.length() + 1);
snprintf(appId, id.length() + 1, "%s", id.c_str());
bool TaskSmack::setLabelForSharedDir(const char* pkgId)
{
- /* shared directory */
- if (PC_OPERATION_SUCCESS != app_label_dir("*",
- m_context.locations->getSharedRootDir().c_str())) {
- return false;
- }
-
/* shared/res directory */
- if (PC_OPERATION_SUCCESS != app_label_dir("_",
- m_context.locations->getSharedResourceDir().c_str())) {
- return false;
+ if (PC_OPERATION_SUCCESS != app_setup_path(m_pkgId,
+ m_context.locations->getSharedResourceDir().c_str(),
+ APP_PATH_ANY_LABEL, "_")) {
+ LogWarning("Add label to " << m_context.locations->getSharedResourceDir());
}
/* shared/trusted directory */
LogDebug("sha1 label string : " << sha1String);
- if (PC_OPERATION_SUCCESS != app_label_shared_dir(pkgId,
- sha1String.c_str(),
- m_context.locations->getSharedTrustedDir().c_str())) {
- return false;
+ if (PC_OPERATION_SUCCESS != app_setup_path(m_pkgId,
+ m_context.locations->getSharedTrustedDir().c_str(),
+ APP_PATH_GROUP_RW, sha1String.c_str())) {
+ LogWarning("Add label to " << m_context.locations->getBinaryDir());
}
}
/* shared/data directory */
- std::string dataLabel = std::string(pkgId) + "_shareddata";
- TizenPkgIdList pkgList = WidgetDAOReadOnly::getTizenPkgidList();
- const char** pList = new (std::nothrow) const char*[pkgList.size() + 1];
-
- int index = 0;
- FOREACH(app, pkgList) {
- std::string id = DPL::ToUTF8String(*app);
- char *pId = new char[id.size() + 1];
- snprintf(pId, id.length() + 1, "%s", id.c_str());
- pList[index++] = pId;
+ if (PC_OPERATION_SUCCESS != app_setup_path(m_pkgId,
+ m_context.locations->getSharedDataDir().c_str(),
+ APP_PATH_PUBLIC_RO)) {
+ LogWarning("Add label to " << m_context.locations->getSharedDataDir());
}
- pList[index] = NULL;
- if (PC_OPERATION_SUCCESS != app_label_shared_dir(pkgId,
- dataLabel.c_str(),
- m_context.locations->getSharedDataDir().c_str())) {
- freeList(pList);
- return false;
- }
- if (PC_OPERATION_SUCCESS != app_label_shared_dir(pkgId,
- "*",
- m_context.locations->getSharedDataDir().c_str())) {
- freeList(pList);
- return false;
- }
- freeList(pList);
return true;
}
} //namespace WidgetInstall
void TaskWidgetConfig::ProcessSecurityModel()
{
+ // 0104. If the "required_version" specified in the Web Application's
+ // configuration is 2.2 or higher and if the Web Application's
+ // configuration is "CSP-compatible configuration", then the WRT MUST be
+ // set to "CSP-based security mode". Otherwise, the WRT MUST be set to
+ // "WARP-based security mode".
+ // 0105. A Web Application configuration is "CSP-compatible configuration"
+ // if the configuration includes one or more of
+ // <tizen:content-security-policy> /
+ // <tizen:content-security-policy-report-only> /
+ // <tizen:allow-navigation> elements.
+
bool isSecurityModelV1 = false;
bool isSecurityModelV2 = false;
+ std::string securityModelV2supportedVersion = "2.2";
WrtDB::ConfigParserData &data = m_installContext.widgetConfig.configInfo;
+ // Parse required version
+ long majorWidget = 0, minorWidget = 0, microWidget = 0;
+ if (!parseVersionString(DPL::ToUTF8String(*data.tizenMinVersionRequired),
+ majorWidget,
+ minorWidget,
+ microWidget))
+ {
+ ThrowMsg(Exceptions::NotAllowed, "Wrong version string");
+ }
+
+ // Parse since version (CSP & allow-navigation start to support since 2.2)
+ long majorSupported = 0, minorSupported = 0, microSupported = 0;
+ if (!parseVersionString(securityModelV2supportedVersion,
+ majorSupported,
+ minorSupported,
+ microSupported))
+ {
+ ThrowMsg(Exceptions::NotAllowed, "Wrong version string");
+ }
+
+ if (majorWidget < majorSupported ||
+ (majorWidget == majorSupported && minorWidget < minorSupported) ||
+ (majorWidget == majorSupported && minorWidget == minorSupported
+ && microWidget < microSupported))
+ {
+ // Under 2.2, clear v2 data
+ data.cspPolicy = DPL::OptionalString::Null;
+ data.cspPolicyReportOnly = DPL::OptionalString::Null;
+ data.allowNavigationInfoList.clear();
+ } else {
+ // More than 2.2, if v2 is defined, clear v1 data
+ if (!data.cspPolicy.IsNull() ||
+ !data.cspPolicyReportOnly.IsNull() ||
+ !data.allowNavigationInfoList.empty())
+ {
+ data.accessInfoSet.clear();
+ }
+ }
+
// WARP is V1
if (!data.accessInfoSet.empty()) {
isSecurityModelV1 = true;
}
- // CSP is V2
- if (!data.cspPolicy.IsNull() || !data.cspPolicyReportOnly.IsNull()) {
- isSecurityModelV2 = true;
- }
-
- // allow-navigation is V2
- if (!data.allowNavigationInfoList.empty()) {
+ // CSP & allow-navigation is V2
+ if (!data.cspPolicy.IsNull() ||
+ !data.cspPolicyReportOnly.IsNull() ||
+ !data.allowNavigationInfoList.empty())
+ {
isSecurityModelV2 = true;
}
boxType.c_str(), boxSize, boxSizeCnt);
for(int i = 0; i < boxSizeCnt; i++) {
- delete[] boxSize[i];
+ free(boxSize[i]);
}
+ free(boxSize);
if(!chkSize) {
LogError("Invalid boxSize");
INSTALL_RDS_DELTA_CHECK,
INSTALL_RDS_PREPARE,
- INSTALL_UNZIP_FILES,
INSTALL_WIDGET_CONFIG1,
INSTALL_WIDGET_CONFIG2,
INSTALL_DIGSIG_CHECK,
INSTALL_CERT_CHECK,
INSTALL_ECRYPTION_FILES,
+ INSTALL_CREATE_BACKUP_DIR, /* For Update */
INSTALL_DIR_CREATE,
INSTALL_RENAME_PATH,
-
- INSTALL_CREATE_BACKUP_DIR, /* For Update */
- INSTALL_BACKUP_RES_FILES, /* For Update */
- INSTALL_BACKUP_EXEC, /* For Update */
-
INSTALL_BACKUP_ICONFILE, /* For Update */
INSTALL_COPY_ICONFILE,
INSTALL_COPY_LIVEBOX_FILES,
INSTALL_CREATE_EXECFILE,
INSTALL_CREATE_MANIFEST,
- INSTALL_CREATE_SHORTCUT,
- INSTALL_SET_CERTINFO,
INSTALL_INSTALL_OSPSVC,
- INSTALL_REMOVE_BACKUP_FILE,
- INSTALL_PLUGINS_COPY,
+ INSTALL_SET_CERTINFO,
INSTALL_NEW_DB_INSERT,
INSTALL_ACE_PREPARE,
INSTALL_ACE_CHECK,
DECLARE_JOB_EXCEPTION(Base, EmptyPluginsDirectory, ErrorPackageInvalid)
DECLARE_JOB_EXCEPTION(Base, PluginsSubdirectory, ErrorPackageInvalid)
DECLARE_JOB_EXCEPTION(Base, RDSDeltaFailure, ErrorPackageInvalid)
+DECLARE_JOB_EXCEPTION(Base, MissingConfig, ErrorPackageInvalid)
DECLARE_JOB_EXCEPTION(Base, PackageLowerVersion, ErrorPackageLowerVersion)