- /* we can't represent > 32-bit pids; if your system needs them, please
- * add ProcessID64 to the spec or something */
- if (dbus_connection_get_unix_process_id (conn, &ulong_val) &&
- ulong_val <= _DBUS_UINT32_MAX)
- {
- if (!_dbus_asv_add_uint32 (&array_iter, "ProcessID", ulong_val))
- goto oom;
- }
-
- /* we can't represent > 32-bit uids; if your system needs them, please
- * add UnixUserID64 to the spec or something */
- if (dbus_connection_get_unix_user (conn, &ulong_val) &&
- ulong_val <= _DBUS_UINT32_MAX)
- {
- if (!_dbus_asv_add_uint32 (&array_iter, "UnixUserID", ulong_val))
- goto oom;
- }
+ if(!bus_context_is_kdbus(bus_transaction_get_context (transaction))) //todo kdbus incl
+ {
+ conn = bus_driver_get_conn_helper (connection, message, "credentials",
+ &service, error);
+
+ if (conn == NULL)
+ goto failed;
+
+ /* we can't represent > 32-bit pids; if your system needs them, please
+ * add ProcessID64 to the spec or something */
+ if (dbus_connection_get_unix_process_id (conn, &ulong_val) &&
+ ulong_val <= _DBUS_UINT32_MAX)
+ {
+ if (!_dbus_asv_add_uint32 (&array_iter, "ProcessID", ulong_val))
+ goto oom;
+ }
+
+ /* we can't represent > 32-bit uids; if your system needs them, please
+ * add UnixUserID64 to the spec or something */
+ if (dbus_connection_get_unix_user (conn, &ulong_val) &&
+ ulong_val <= _DBUS_UINT32_MAX)
+ {
+ if (!_dbus_asv_add_uint32 (&array_iter, "UnixUserID", ulong_val))
+ goto oom;
+ }
+ }
+ else
+ {
+ if(kdbus_get_connection_unix_process_id(connection, message, &ulong_val, error))
+ {
+ if (!_dbus_asv_add_uint32 (&array_iter, "ProcessID", ulong_val))
+ goto oom;
+ }
+ else
+ goto failed;
+
+ if(kdbus_get_connection_unix_user(connection, message, &ulong_val, error))
+ {
+ if (!_dbus_asv_add_uint32 (&array_iter, "UnixUserID", ulong_val))
+ goto oom;
+ }
+ else
+ goto failed;
+ }