kdbus: check policy after opening, before Hello 78/201478/1
authorAdrian Szyndela <adrian.s@samsung.com>
Thu, 14 Mar 2019 11:55:47 +0000 (12:55 +0100)
committerAdrian Szyndela <adrian.s@samsung.com>
Thu, 14 Mar 2019 13:30:17 +0000 (14:30 +0100)
commit668dd86ce65ce4477cb694b4d2ad2612e38fe3c0
tree6c65cf5536230bdced11911dee32be97780a6fd4
parent639993312f5f26f998687b6ca623e1b246ebc935
kdbus: check policy after opening, before Hello

This moves checking access policy to the point after
the kdbus file descriptor is open, just before "Hello" is performed.
Now, it reflects standard process a bit more.

The standard process is:
- open fd (e.g. socket);
- check authentication, if needed and possible;
- connect to the bus (say hello).

In kdbus, we have only:
- open kdbus fd;
- connect to the bus (ioctl KDBUS_CMD_HELLO).
Calling libdbuspolicy for authentication fits between the two.

Additionally, and most importantly, this is required to share
the connection between gio and libdbuspolicy in the future.

Change-Id: Iee49b36e482a099d061dff4a8ba1826c2a53bb9a
gio/gdbusconnection.c
gio/gkdbus.c
gio/gkdbus.h