X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fwgtpkg-install.c;h=3dbd6ac2d5f6133975557cfc211643635a0c8924;hb=86be207174efcb84f6eb22946724a25a3cd9b56c;hp=8035a309df1567d826b33f94363a2fab72bd9444;hpb=f8ac4a3d0132968d06855177da630e8e788baee6;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-install.c b/src/wgtpkg-install.c index 8035a30..3dbd6ac 100644 --- a/src/wgtpkg-install.c +++ b/src/wgtpkg-install.c @@ -1,5 +1,5 @@ /* - Copyright 2015, 2016 IoT.bzh + Copyright 2015, 2016, 2017 IoT.bzh author: José Bollo @@ -41,8 +41,11 @@ 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 feature_required_permissions[] = FWK_PREFIX "required-permission"; +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) @@ -241,6 +252,7 @@ static int install_security(const struct wgt_desc *desc) perm = first_usable_permission(); while(perm) { rc = secmgr_permit(perm); + INFO("permitting %s %s", perm, rc ? "FAILED!" : "success"); if (rc) goto error2; perm = next_usable_permission();