From 700585ad610a190347279f067c32f8820d471dd5 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Fri, 9 Dec 2011 12:08:35 -0500 Subject: [PATCH] Force ReadOnly to TRUE for optical drives At least do this until the kernel sets the 'ro' property properly. Signed-off-by: David Zeuthen --- src/udiskslinuxblock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c index eeb4a4d..8d16a27 100644 --- a/src/udiskslinuxblock.c +++ b/src/udiskslinuxblock.c @@ -638,6 +638,8 @@ udisks_linux_block_update (UDisksLinuxBlock *block, udisks_block_set_size (iface, size); read_only = g_udev_device_get_sysfs_attr_as_boolean (device, "ro"); + if (!read_only && g_str_has_prefix (g_udev_device_get_name (device), "sr")) + read_only = TRUE; udisks_block_set_read_only (iface, read_only); /* dm-crypt -- 2.7.4