#include "afb-context.h"
#include "afb-hook.h"
#include "afb-session.h"
+#include "afb-cred.h"
#include "afb-xreq.h"
#include "afb-ditf.h"
#include "verbose.h"
static void hook_xreq_begin_default_cb(void * closure, const struct afb_xreq *xreq)
{
- _hook_xreq_(xreq, "BEGIN");
+ if (!xreq->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)"
+ );
}
static void hook_xreq_end_default_cb(void * closure, const struct afb_xreq *xreq)
}
}
+static void hook_ditf_queue_job(void *closure, const struct afb_ditf *ditf, void (*callback)(int signum, void *arg), void *argument, void *group, int timeout, int result)
+{
+ _hook_ditf_(ditf, "queue_job(%p, %p, %p, %d) -> %d", callback, argument, group, timeout, result);
+}
static struct afb_hook_ditf_itf hook_ditf_default_itf = {
.hook_ditf_event_broadcast_before = hook_ditf_event_broadcast_before_cb,
.hook_ditf_event_make = hook_ditf_event_make_cb,
.hook_ditf_rootdir_get_fd = hook_ditf_rootdir_get_fd_cb,
.hook_ditf_rootdir_open_locale = hook_ditf_rootdir_open_locale_cb,
+ .hook_ditf_queue_job = hook_ditf_queue_job
};
/******************************************************************************
return result;
}
-
+int afb_hook_ditf_queue_job(const struct afb_ditf *ditf, void (*callback)(int signum, void *arg), void *argument, void *group, int timeout, int result)
+{
+ _HOOK_DITF_(queue_job, ditf, callback, argument, group, timeout, result);
+ return result;
+}
/******************************************************************************
* section: