diff options
| author | Jeff Epler <jepler@gmail.com> | 2025-07-19 06:38:18 -0500 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-07-24 10:39:41 +1000 |
| commit | 59ee59901b9223697cf96f5859fcbf49fe9d21f4 (patch) | |
| tree | 4a37a1a23101b02985974667375e8d2f23958d4f /py | |
| parent | 3c603f7baf25b089a30f41d3cd57d13ba50b194c (diff) | |
extmod/vfs_posix: Add MICROPY_VFS_POSIX_WRITABLE option.
When this configuration flag is set, VfsPosix instances can be written.
Otherwise, they will always be created "read only".
This flag is useful when fuzzing micropython: Without VfsPosix, the fuzzing
input script cannot be read; but with writable VfsPosix, fuzzing scripts
can potentially perform undesired operations on the host filesystem.
Signed-off-by: Jeff Epler <jepler@gmail.com>
Diffstat (limited to 'py')
| -rw-r--r-- | py/mpconfig.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index a1025fe5e..b812cf032 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1084,6 +1084,11 @@ typedef time_t mp_timestamp_t; #define MICROPY_VFS_POSIX (0) #endif +// Whether to include support for writable POSIX filesystems. +#ifndef MICROPY_VFS_POSIX_WRITABLE +#define MICROPY_VFS_POSIX_WRITABLE (1) +#endif + // Support for VFS FAT component, to mount a FAT filesystem within VFS #ifndef MICROPY_VFS_FAT #define MICROPY_VFS_FAT (0) |
