Change some D-Bus types from bytestring ('ay') to UTF8 ('s')
authorDavid Zeuthen <davidz@redhat.com>
Tue, 13 Mar 2012 21:29:55 +0000 (17:29 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Tue, 13 Mar 2012 21:29:55 +0000 (17:29 -0400)
We are 100% sure that the changed items are always UTF-8 especially
because udisks_device_udev_string() guarantees this and this function
is used before setting the affected properties.

This breaks the D-Bus API but there is no change in the libudisks2.so
ABI since byte-strings and UTF-8 strings are mapped the same way when
GDBus is being used. It may require restarting the system, but apart
from that there is minimal interference from this change.

The remaining byte-strings in the API are things that either comes
from configuration files (such as /etc/fstab and /etc/crypttab), the
kernel (e.g. sysfs paths) or udev rules (e.g. device symlinks). We
could require UTF-8 here and just reject items that are not valid
UTF-8 but there's really no point in that.

Signed-off-by: David Zeuthen <davidz@redhat.com>
data/org.freedesktop.UDisks2.xml

index 672be10..995105f 100644 (file)
   -->
   <interface name="org.freedesktop.UDisks2.Drive">
     <!-- Vendor: A name for the vendor of the drive or blank if unknown. -->
-    <property name="Vendor" type="ay" access="read"/>
+    <property name="Vendor" type="s" access="read"/>
     <!-- Model: A name for the model of the drive or blank if unknown. -->
-    <property name="Model" type="ay" access="read"/>
+    <property name="Model" type="s" access="read"/>
     <!-- Revision: Firmware Revision or blank if unknown. -->
-    <property name="Revision" type="ay" access="read"/>
+    <property name="Revision" type="s" access="read"/>
     <!-- Serial: Serial number of the drive or blank if unknown. -->
-    <property name="Serial" type="ay" access="read"/>
+    <property name="Serial" type="s" access="read"/>
     <!-- WWN:
 
          The <ulink
 
          This property is blank if there is no label or the label is unknown.
     -->
-    <property name="IdLabel" type="ay" access="read"/>
+    <property name="IdLabel" type="s" access="read"/>
     <!-- IdUUID:
          The <ulink url="http://en.wikipedia.org/wiki/UUID">UUID</ulink> of the
          filesystem or other structured data on the block device. Do not make
 
          This property is blank if there is no UUID or the UUID is unknown.
     -->
-    <property name="IdUUID" type="ay" access="read"/>
+    <property name="IdUUID" type="s" access="read"/>
 
     <!-- Configuration:
          The configuration for the device.
     <property name="Size" type="t" access="read"/>
 
     <!-- Name: Label of partition or blank if not supported or unknown. -->
-    <property name="Name" type="ay" access="read"/>
+    <property name="Name" type="s" access="read"/>
 
     <!-- UUID: The UUID of the partition or blank if not supported or unknown. -->
-    <property name="UUID" type="ay" access="read"/>
+    <property name="UUID" type="s" access="read"/>
 
     <!-- Table:
          The object path of the #org.freedesktop.UDisks2.PartitionTable
         Sets the filesystem label.
     -->
     <method name="SetLabel">
-      <arg name="label" direction="in" type="ay"/>
+      <arg name="label" direction="in" type="s"/>
       <arg name="options" direction="in" type="a{sv}"/>
     </method>
 
     -->
     <method name="Mount">
       <arg name="options" direction="in" type="a{sv}"/>
-      <arg name="mount_path" direction="out" type="ay"/>
+      <arg name="mount_path" direction="out" type="s"/>
     </method>
 
     <!--
         device will be cleaned up.
     -->
     <method name="Unlock">
-      <arg name="passphrase" direction="in" type="ay"/>
+      <arg name="passphrase" direction="in" type="s"/>
       <arg name="options" direction="in" type="a{sv}"/>
       <arg name="cleartext_device" direction="out" type="o"/>
     </method>
         automatically updated.
     -->
     <method name="ChangePassphrase">
-      <arg name="passphrase" direction="in" type="ay"/>
-      <arg name="new_passphrase" direction="in" type="ay"/>
+      <arg name="passphrase" direction="in" type="s"/>
+      <arg name="new_passphrase" direction="in" type="s"/>
       <arg name="options" direction="in" type="a{sv}"/>
     </method>