diff --git a/vfs/ChangeLog b/vfs/ChangeLog index bd8e9baf3..635f4d88d 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,5 +1,8 @@ 2002-12-24 Pavel Roskin + * direntry.c (vfs_s_open): If the filesystem is read-only, + disable file creation. + * vfs.c (mc_chdir): Don't change current directory until the low-level chdir succeeds. diff --git a/vfs/direntry.c b/vfs/direntry.c index 127b2b213..d9d68faf7 100644 --- a/vfs/direntry.c +++ b/vfs/direntry.c @@ -753,7 +753,9 @@ vfs_s_open (vfs *me, char *file, int flags, int mode) vfs_s_entry *ent; vfs_s_inode *dir; int tmp_handle; - if (!(flags & O_CREAT)) + + /* If the filesystem is read-only, disable file creation */ + if (!(flags & O_CREAT) || !(me->write)) return NULL; split_dir_name (me, q, &dirname, &name, &save);