summaryrefslogtreecommitdiff
path: root/introspection
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-05-16 14:11:07 +0200
committerThomas Haller <thaller@redhat.com>2017-05-19 09:46:08 +0200
commit0870906540506d0157f305df32b6b1f65b10ee85 (patch)
treecdbfc5a044fdb52caf2fd8ca569d017f4462361b /introspection
parentdf6d27b33a86e2ecdc5a8e1deff275d19b2cbde1 (diff)
device: sanitze UTF-8 values for D-Bus
ip link add name $'d\xccf\\c' type dummy Use nm_utils_str_utf8safe_escape() to sanitize non UTF-8 sequences before exposing them on D-Bus. The operation can be reverted client side via nm_utils_str_utf8safe_unescape() or simply g_strcompress(). Note that this preserves all valid UTF-8 sequences as-is, with exception of the backslash escape character and ASCII control characters. Thus, this is a change in behavior for strings that contain such characters. Note that nmcli is not changed to somehow unescape the string before printing. As the string is not valid UTF-8 (or contains ASCII characters that need escaping), they are not printable as-is, so unescaping before printing makes little sense.
Diffstat (limited to 'introspection')
-rw-r--r--introspection/org.freedesktop.NetworkManager.Device.xml15
1 files changed, 15 insertions, 0 deletions
diff --git a/introspection/org.freedesktop.NetworkManager.Device.xml b/introspection/org.freedesktop.NetworkManager.Device.xml
index ee424101e..be0a612cc 100644
--- a/introspection/org.freedesktop.NetworkManager.Device.xml
+++ b/introspection/org.freedesktop.NetworkManager.Device.xml
@@ -21,6 +21,9 @@
each device in your application, use the object path. If you're looking
for a way to track a specific piece of hardware across reboot or hotplug,
use a MAC address or USB serial number.
+
+ Note that non-UTF-8 characters are backslash escaped. Use g_strcompress()
+ to obtain the true (non-UTF-8) string.
-->
<property name="Udi" type="s" access="read"/>
@@ -28,6 +31,9 @@
Interface:
The name of the device's control (and often data) interface.
+ Note that non UTF-8 characters are backslash escaped, so the
+ resulting name may be longer then 15 characters. Use g_strcompress()
+ to revert the escaping.
-->
<property name="Interface" type="s" access="read"/>
@@ -38,6 +44,9 @@
not refer to the actual data interface until the device has successfully
established a data connection, indicated by the device's State becoming
ACTIVATED.
+ Note that non UTF-8 characters are backslash escaped, so the
+ resulting name may be longer then 15 characters. Use g_strcompress()
+ to revert the escaping.
-->
<property name="IpInterface" type="s" access="read"/>
@@ -45,6 +54,8 @@
Driver:
The driver handling the device.
+ Non-UTF-8 sequences are backslash escaped. Use g_strcompress()
+ to revert.
-->
<property name="Driver" type="s" access="read"/>
@@ -52,6 +63,8 @@
DriverVersion:
The version of the driver handling the device.
+ Non-UTF-8 sequences are backslash escaped. Use g_strcompress()
+ to revert.
-->
<property name="DriverVersion" type="s" access="read"/>
@@ -59,6 +72,8 @@
FirmwareVersion:
The firmware version for the device.
+ Non-UTF-8 sequences are backslash escaped. Use g_strcompress()
+ to revert.
-->
<property name="FirmwareVersion" type="s" access="read"/>