summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2017-08-14 10:37:37 +0100
committerWill Thompson <will@willthompson.co.uk>2018-06-15 08:58:44 +0100
commit31896f2d939556050bc03f12763e4329d03e6345 (patch)
treeb6ebd913bd3fe3699e5004f82cd9bee32c9ac3f1 /data
parent1cfacebb5fe6f4a5cf0fe4af591b99c20e6bd07c (diff)
Use dbus-monitor --pcap to capture traffic
Modern versions of D-Bus have a BecomeMonitor method which allows a sufficiently-privileged user (ie root) to capture all messages on the system bus. Modern versions of dbus-monitor use this method, and support pcap output natively. This allows us to use pkexec to escalate just the dbus-monitor process, and so add a way to monitor the system bus from within the UI. We can also use Flatpak's HostCommand method (via `flatpak-spawn --host`) to do the same from within the Flatpak sandbox. It's not much extra effort to support monitoring an arbitrary bus by address, so that's wired up too. Bustle itself still connects to the bus you're monitoring to dump all current names, so will still require full session and system bus access. If this fails, it's not considered fatal. We assume that dbus-monitor is present on the host, and recent enough to support --pcap. We'll see if this assumption is true in practice!
Diffstat (limited to 'data')
-rw-r--r--data/RecordAddressDialog.ui111
-rw-r--r--data/bustle.ui87
2 files changed, 189 insertions, 9 deletions
diff --git a/data/RecordAddressDialog.ui b/data/RecordAddressDialog.ui
new file mode 100644
index 0000000..90fd688
--- /dev/null
+++ b/data/RecordAddressDialog.ui
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface>
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkDialog" id="recordAddressDialog">
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Record Address</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="vbox">
+ <object class="GtkBox">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="recordAddressCancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="recordAddressRecord">
+ <property name="label" translatable="yes">_Record</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="margin_right">6</property>
+ <property name="margin_top">6</property>
+ <property name="margin_bottom">6</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Address:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="recordAddressEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_focus">True</property>
+ <property name="activates_default">True</property>
+ <property name="width_chars">60</property>
+ <property name="placeholder_text" translatable="yes" comments="Just translate the &quot;e.g.&quot;; leave the rest untouched.">e.g. unix:abstract=/tmp/dbus-E5RlEB5Tzu,guid= b1c1921b62283b7b612b57305b20cc28</property>
+ <property name="input_hints">GTK_INPUT_HINT_NO_SPELLCHECK | GTK_INPUT_HINT_NO_EMOJI | GTK_INPUT_HINT_NONE</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">recordAddressCancel</action-widget>
+ <action-widget response="-3">recordAddressRecord</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/data/bustle.ui b/data/bustle.ui
index 970876f..40fac97 100644
--- a/data/bustle.ui
+++ b/data/bustle.ui
@@ -65,6 +65,37 @@
</object>
</child>
</object>
+ <object class="GtkMenu" id="recordMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="recordSession">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Record S_ession Bus</property>
+ <property name="use_underline">True</property>
+ <accelerator key="e" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="recordSystem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Record S_ystem Bus</property>
+ <property name="use_underline">True</property>
+ <accelerator key="y" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="recordAddress">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Record _Address…</property>
+ <property name="use_underline">True</property>
+ <accelerator key="a" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ </object>
<object class="GtkWindow" id="diagramWindow">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Bustle</property>
@@ -98,6 +129,53 @@
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<child>
+ <object class="GtkMenuButton" id="headerRecord">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Record a new log</property>
+ <property name="popup">recordMenu</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">baseline</property>
+ <property name="label" translatable="yes">_Record</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">baseline</property>
+ <property name="icon_name">pan-down-symbolic</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <style>
+ <class name="text-button"/>
+ <class name="image-button"/>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ </child>
+ <child>
<object class="GtkMenuButton" id="headerOpen">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -116,15 +194,6 @@
<class name="image-button"/>
</style>
</object>
- </child>
- <child>
- <object class="GtkButton" id="headerNew">
- <property name="label" translatable="yes">Record</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Record a new log</property>
- </object>
<packing>
<property name="position">1</property>
</packing>