X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hook.c;h=d2ea0b6667757f5546d7362af2473b4893ee19a8;hb=65353dce81a629e042800bb7b86fcd869a76727e;hp=1379caf8b003e3f8c0b8974cffed2f0af0d76a1f;hpb=7c67e966b8292961ca748e47d18ff437214cec1c;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hook.c b/src/afb-hook.c index 1379caf8..d2ea0b66 100644 --- a/src/afb-hook.c +++ b/src/afb-hook.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2019 "IoT.bzh" + * Copyright (C) 2015-2020 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -217,16 +217,18 @@ static void _hook_xreq_(const struct afb_xreq *xreq, const char *format, ...) static void hook_xreq_begin_cb(void *closure, const struct afb_hookid *hookid, const struct afb_xreq *xreq) { - if (!xreq->cred) + struct afb_cred *cred = xreq->context.credentials; + + if (!cred) _hook_xreq_(xreq, "BEGIN"); else _hook_xreq_(xreq, "BEGIN uid=%d=%s gid=%d pid=%d label=%s id=%s", - (int)xreq->cred->uid, - xreq->cred->user, - (int)xreq->cred->gid, - (int)xreq->cred->pid, - xreq->cred->label?:"(null)", - xreq->cred->id?:"(null)" + (int)cred->uid, + cred->user, + (int)cred->gid, + (int)cred->pid, + cred->label?:"(null)", + cred->id?:"(null)" ); }