Also be paranoid about the UUID containing '/' characters
authorDavid Zeuthen <davidz@redhat.com>
Tue, 15 Sep 2009 15:27:47 +0000 (11:27 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Tue, 15 Sep 2009 15:27:47 +0000 (11:27 -0400)
This can't really happen (for known filesystems) so this "fix" is
really only for people playing along at home. See

 http://bugs.freedesktop.org/show_bug.cgi?id=23235

for more details.

src/devkit-disks-device.c

index fbbfe18..70f8dd4 100644 (file)
@@ -4571,7 +4571,20 @@ devkit_disks_device_filesystem_mount_authorized_cb (DevkitDisksDaemon     *daemo
 
                 mount_point = g_string_free (s, FALSE);
         } else if (device->priv->id_uuid != NULL && strlen (device->priv->id_uuid) > 0) {
-                mount_point = g_build_filename ("/media", device->priv->id_uuid, NULL);
+
+                GString *s;
+
+                s = g_string_new ("/media/");
+                for (n = 0; device->priv->id_uuid[n] != '\0'; n++) {
+                        gint c = device->priv->id_uuid[n];
+                        if (c == '/')
+                                g_string_append_c (s, '_');
+                        else
+                                g_string_append_c (s, c);
+                }
+
+                mount_point = g_string_free (s, FALSE);
+
         } else {
                 mount_point = g_strdup ("/media/disk");
         }