From: David Zeuthen Date: Mon, 17 Aug 2009 17:02:29 +0000 (-0400) Subject: Bug 23235 – Cannot mount disc with / (slash) in label X-Git-Tag: upstream/2.1.2~807 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62f883c7d38e75d0669c162529062a1e81d00da2;p=platform%2Fupstream%2Fudisks2.git Bug 23235 – Cannot mount disc with / (slash) in label --- diff --git a/src/devkit-disks-device.c b/src/devkit-disks-device.c index 407305a..06898c0 100644 --- a/src/devkit-disks-device.c +++ b/src/devkit-disks-device.c @@ -4671,7 +4671,18 @@ devkit_disks_device_filesystem_mount_authorized_cb (DevkitDisksDaemon *daemo * to get better names (/media/disk is kinda lame). */ if (device->priv->id_label != NULL && strlen (device->priv->id_label) > 0 ) { - mount_point = g_build_filename ("/media", device->priv->id_label, NULL); + GString *s; + + s = g_string_new ("/media/"); + for (n = 0; device->priv->id_label[n] != '\0'; n++) { + gint c = device->priv->id_label[n]; + if (c == '/') + g_string_append_c (s, '_'); + else + g_string_append_c (s, c); + } + + 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); } else {