summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-12-14 10:27:13 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2016-12-14 10:27:13 +0100
commit6f6d04fef9f08d756a37d17333f5b9b9a6b72dd2 (patch)
treec2446e4f434c8e50fbdcff51f9d2c88849d7bcb5
parent80c482f0c8974139c023388897f77195fb8fe01f (diff)
wgtpkg-install: set exec flag for application/vnd.agl.native
This is needed for executable having a binder. Also conforming to RFC 2045, mime types are made case insensitive. Change-Id: I065c8eada5ec044daca73b3bf994b0d6f3587414 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--TODO1
-rw-r--r--src/afm-launch.c2
-rw-r--r--src/wgtpkg-install.c17
3 files changed, 16 insertions, 4 deletions
diff --git a/TODO b/TODO
index 268feac..c1bcdc2 100644
--- a/TODO
+++ b/TODO
@@ -6,3 +6,4 @@ List of things to do
- use key facilities of kernel
- remove the link to the icon on failure or create it lately
- improves safety on power failure
+- make application ids (idaver) NOT CASE SENSITIVE
diff --git a/src/afm-launch.c b/src/afm-launch.c
index d31e24b..8391943 100644
--- a/src/afm-launch.c
+++ b/src/afm-launch.c
@@ -856,7 +856,7 @@ static struct desc_launcher *search_launcher(const char *type,
for (dl = launchers ; dl ; dl = dl->next)
if (dl->mode == mode)
for (tl = dl->types ; tl != NULL ; tl = tl->next)
- if (!strcmp(tl->type, type))
+ if (!strcasecmp(tl->type, type))
return dl;
return NULL;
}
diff --git a/src/wgtpkg-install.c b/src/wgtpkg-install.c
index 8035a30..71a0ff6 100644
--- a/src/wgtpkg-install.c
+++ b/src/wgtpkg-install.c
@@ -42,7 +42,10 @@
static const char permission_required[] = "required";
static const char permission_optional[] = "optional";
static const char feature_required_permissions[] = FWK_PREFIX "required-permissions";
-static const char exec_type_string[] = "application/x-executable";
+static const char* exec_type_strings[] = {
+ "application/x-executable",
+ "application/vnd.agl.native"
+};
static int check_defined(const void *data, const char *name)
{
@@ -185,8 +188,16 @@ static int install_icon(const struct wgt_desc *desc)
static int install_exec_flag(const struct wgt_desc *desc)
{
- return desc->content_type != NULL && !strcmp(desc->content_type, exec_type_string)
- ? fchmodat(workdirfd, desc->content_src, 0755, 0) : 0;
+ int i;
+
+ if (desc->content_type) {
+ i = sizeof exec_type_strings / sizeof *exec_type_strings;
+ while (i) {
+ if (!strcasecmp(desc->content_type, exec_type_strings[--i]))
+ return fchmodat(workdirfd, desc->content_src, 0755, 0);
+ }
+ }
+ return 0;
}
static int install_security(const struct wgt_desc *desc)