Change-Id: If9a7d2a183aa8b0c0ed531b4d915443e199b488b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
static const char permission_required[] = "required";
static const char permission_optional[] = "optional";
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"
static const char* exec_type_strings[] = {
"application/x-executable",
"application/vnd.agl.native"
perm = first_usable_permission();
while(perm) {
rc = secmgr_permit(perm);
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();
if (rc)
goto error2;
perm = next_usable_permission();
/* request the permission, returns 1 if granted or 0 otherwise */
int request_permission(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);
struct permission *p = get_permission(name);
+
+#if defined(HACK_ALLOWING_REQUESTED_PERMISSIONS) && HACK_ALLOWING_REQUESTED_PERMISSIONS
+ if (!p)
+ p = add_permission(name);
+#endif
+#if defined(HACK_ALLOWING_REQUESTED_PERMISSIONS) && HACK_ALLOWING_REQUESTED_PERMISSIONS
+ p->granted = 1;
+#endif
p->requested = 1;
if (p->granted)
return 1;
}
return 0;
p->requested = 1;
if (p->granted)
return 1;
}
return 0;
+
+#undef HACK_ALLOWING_REQUESTED_PERMISSIONS
}
/* iteration over granted and requested permissions */
}
/* iteration over granted and requested permissions */