X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-permissions.c;h=362b1c11e7e34ab30ff755f31ec2787992a9cb3e;hb=2bf2954ba45aca2615a95eee698881f2c93e81b4;hp=6aed31f3aab2e111449aaad621c5d65c91a08cc9;hpb=8afd46f28a677c40a482ccd18ca5568cf6c0f6aa;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-permissions.c b/src/wgtpkg-permissions.c index 6aed31f..362b1c1 100644 --- a/src/wgtpkg-permissions.c +++ b/src/wgtpkg-permissions.c @@ -1,5 +1,5 @@ /* - Copyright 2015 IoT.bzh + Copyright 2015, 2016 IoT.bzh author: José Bollo @@ -32,18 +32,10 @@ struct permission { unsigned level: 3; }; -static const char prefix_of_permissions[] = FWK_PREFIX_PERMISSION; - static unsigned int nrpermissions = 0; static struct permission *permissions = NULL; static unsigned int indexiter = 0; -/* check is the name has the correct prefix for permissions */ -int is_standard_permission(const char *name) -{ - return 0 == memcmp(name, prefix_of_permissions, sizeof(prefix_of_permissions) - 1); -} - /* retrieves the permission of name */ static struct permission *get_permission(const char *name) { @@ -81,7 +73,15 @@ void reset_permissions() { unsigned int i; for (i = 0 ; i < nrpermissions ; i++) - permissions[i].granted = 0; + permissions[i].granted = permissions[i].requested = 0; +} + +/* remove any requested permission */ +void reset_requested_permissions() +{ + unsigned int i; + for (i = 0 ; i < nrpermissions ; i++) + permissions[i].requested = 0; } /* remove any granting */