X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hook.c;h=a8c836f846179befb407845519ead1312d34d2dd;hb=85bca06fe0ee2923421f013da3e9f53abbfff673;hp=14076281c8ad1aa706b0ca0f425a624b69c9a070;hpb=91c12808e08fb30e58a3d2e008569933f409d6db;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hook.c b/src/afb-hook.c index 14076281..a8c836f8 100644 --- a/src/afb-hook.c +++ b/src/afb-hook.c @@ -317,6 +317,11 @@ static void hook_xreq_subcall_req_result_default_cb(void *closure, const struct _hook_xreq_(xreq, " ...subcall_req... -> %d: %s", status, json_object_to_json_string(result)); } +static void hook_xreq_has_permission_default_cb(void *closure, const struct afb_hookid *hookid, const struct afb_xreq *xreq, const char *permission, int result) +{ + _hook_xreq_(xreq, "has_permission(%s) -> %d", permission, result); +} + static struct afb_hook_xreq_itf hook_xreq_default_itf = { .hook_xreq_begin = hook_xreq_begin_default_cb, .hook_xreq_end = hook_xreq_end_default_cb, @@ -340,7 +345,8 @@ static struct afb_hook_xreq_itf hook_xreq_default_itf = { .hook_xreq_store = hook_xreq_store_default_cb, .hook_xreq_unstore = hook_xreq_unstore_default_cb, .hook_xreq_subcall_req = hook_xreq_subcall_req_default_cb, - .hook_xreq_subcall_req_result = hook_xreq_subcall_req_result_default_cb + .hook_xreq_subcall_req_result = hook_xreq_subcall_req_result_default_cb, + .hook_xreq_has_permission = hook_xreq_has_permission_default_cb }; /****************************************************************************** @@ -488,6 +494,12 @@ void afb_hook_xreq_subcall_req_result(const struct afb_xreq *xreq, int status, s _HOOK_XREQ_(subcall_req_result, xreq, status, result); } +int afb_hook_xreq_has_permission(const struct afb_xreq *xreq, const char *permission, int result) +{ + _HOOK_XREQ_(has_permission, xreq, permission, result); + return result; +} + /****************************************************************************** * section: hooking xreqs *****************************************************************************/