mirror of
https://github.com/troglobit/finit.git
synced 2026-10-27 12:20:54 +00:00
libink: trace connections, calls, and authorization decisions
The legacy socket logs a line per command under initctl debug; the bus logged nothing, so the transport that now carries most of initctl was the one you could not watch. libink gets a logger hook rather than a dependency on Finit's: it passes the emitting function and a formatted message, and dbus.c hands both to logit() so the two sources read alike. Trace points cover the connection lifecycle, every inbound call, and why a call was refused. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
63aabaa6df
commit
1e508f9168
9 files changed
+94
-1
No files matched your search
+11
@@ -73,6 +73,15 @@ static struct peer *sysbus_peer;
|
||||
static void sysbus_probe(void);
|
||||
static void sender_cache_flush(void);
|
||||
|
||||
/* libink has no logger of its own, so give it ours. The func name it
|
||||
* passes takes the place of dbg()'s __func__, which would otherwise
|
||||
* always read "link_log_cb". */
|
||||
static void link_log_cb(void *userdata, const char *func, const char *msg)
|
||||
{
|
||||
(void)userdata;
|
||||
logit(LOG_DEBUG, "%s():%s", func, msg);
|
||||
}
|
||||
|
||||
static void peer_drop(struct peer *p)
|
||||
{
|
||||
int was_sysbus = p == sysbus_peer;
|
||||
@@ -1526,6 +1535,8 @@ int dbus_init(uev_ctx_t *ctx)
|
||||
/* Same access policy as INIT_SOCKET: the bus reaches every
|
||||
* service operation initctl does, so --with-group has to gate
|
||||
* both or it gates neither. */
|
||||
link_set_logger(link_log_cb, NULL);
|
||||
|
||||
if (link_server_new(&server, FINIT_BUS_SOCKET, 0660) < 0) {
|
||||
err(1, "Failed binding D-Bus socket %s", FINIT_BUS_SOCKET);
|
||||
return 1;
|
||||
|
||||
Reference in new issue
Block a user