aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/wgtpkg-install.c3
-rw-r--r--src/wgtpkg-permissions.c12
2 files changed, 14 insertions, 1 deletions
diff --git a/src/wgtpkg-install.c b/src/wgtpkg-install.c
index 71a0ff6..9881e9c 100644
--- a/src/wgtpkg-install.c
+++ b/src/wgtpkg-install.c
@@ -41,7 +41,7 @@
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 feature_required_permissions[] = FWK_PREFIX "required-permission";
static const char* exec_type_strings[] = {
"application/x-executable",
"application/vnd.agl.native"
@@ -252,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();
diff --git a/src/wgtpkg-permissions.c b/src/wgtpkg-permissions.c
index 362b1c1..8379446 100644
--- a/src/wgtpkg-permissions.c
+++ b/src/wgtpkg-permissions.c
@@ -129,13 +129,25 @@ int permission_exists(const char *name)
/* request the permission, returns 1 if granted or 0 otherwise */
int request_permission(const char *name)
{
+#define HACK_ALLOWING_REQUESTED_PERMISSIONS 1
+
struct permission *p = get_permission(name);
+
+#if defined(HACK_ALLOWING_REQUESTED_PERMISSIONS) && HACK_ALLOWING_REQUESTED_PERMISSIONS
+ if (!p)
+ p = add_permission(name);
+#endif
if (p) {
+#if defined(HACK_ALLOWING_REQUESTED_PERMISSIONS) && HACK_ALLOWING_REQUESTED_PERMISSIONS
+ p->granted = 1;
+#endif
p->requested = 1;
if (p->granted)
return 1;
}
return 0;
+
+#undef HACK_ALLOWING_REQUESTED_PERMISSIONS
}
/* iteration over granted and requested permissions */