X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-permissions.c;h=83794463e40bd5522ad6d285912cee146e8e6f57;hb=c6b2074e18ce7a37a59bc1c3831407b42b18c889;hp=362b1c11e7e34ab30ff755f31ec2787992a9cb3e;hpb=fd61febe4d3275e02d15440d6632327aa69ce636;p=src%2Fapp-framework-main.git 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 */