* direntry.c (vfs_s_open): If the filesystem is read-only,

disable file creation.
This commit is contained in:
Pavel Roskin 2002-12-25 04:57:26 +00:00
parent 423849f74d
commit ddf2ad1612
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2002-12-24 Pavel Roskin <proski@gnu.org>
* 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.

View File

@ -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);