From: Sebastian Huber <
sebastian.huber@embedded-brains.de>
---
rtems/rtems_yaffs.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/rtems/rtems_yaffs.c b/rtems/rtems_yaffs.c
index d987685..f6869cd 100644
--- a/rtems/rtems_yaffs.c
+++ b/rtems/rtems_yaffs.c
@@ -790,6 +790,11 @@ int rtems_yaffs_mount_handler(rtems_filesystem_mount_table_entry_t *mt_entry, co
const rtems_yaffs_mount_data *mount_data = data;
struct yaffs_dev *dev = mount_data->dev;
+ if (dev->read_only && (mt_entry->options & RTEMS_FILESYSTEM_READ_WRITE) != 0) {
+ errno = EACCES;
+ return -1;
+ }
+
ylock(dev);
if (yaffs_guts_initialise(dev) == YAFFS_FAIL) {
yunlock(dev);
--
1.7.4.1