Compare commits
11 Commits
3e5599e75c
...
00d625a697
Author | SHA1 | Date | |
---|---|---|---|
00d625a697 | |||
cf897ebb78 | |||
0d3aa2de07 | |||
9ac7082659 | |||
7bdaac6e0a | |||
40d2efd7ad | |||
3d2f73a33b | |||
733c778339 | |||
52f48a3187 | |||
3b6f5b28fc | |||
fdf2bb2501 |
@ -10,3 +10,8 @@
|
|||||||
|
|
||||||
# Example: Adding a compiler flag. This will optimize the kernel aggressively (warning: untested, use at your own discretion).
|
# Example: Adding a compiler flag. This will optimize the kernel aggressively (warning: untested, use at your own discretion).
|
||||||
# target_compile_options(moon PRIVATE -O3)
|
# target_compile_options(moon PRIVATE -O3)
|
||||||
|
|
||||||
|
# Uncomment the line below to allow any filename on file/directory creation (by default, the kernel prohibits filenames with
|
||||||
|
# control characters, leading/trailing spaces, problematic characters and invalid UTF-8). Keep in mind that this restriction
|
||||||
|
# is only enforced when creating files; existing files with such illegal filenames are parsed correctly and fully usable.
|
||||||
|
# target_compile_definitions(moon PRIVATE MOON_DISABLE_FILENAME_RESTRICTIONS)
|
||||||
|
@ -101,6 +101,11 @@ namespace VFS
|
|||||||
|
|
||||||
Result<void> validate_filename(StringView name)
|
Result<void> validate_filename(StringView name)
|
||||||
{
|
{
|
||||||
|
#ifdef MOON_DISABLE_FILENAME_RESTRICTIONS
|
||||||
|
(void)name;
|
||||||
|
return {};
|
||||||
|
#endif
|
||||||
|
|
||||||
// Forbid problematic characters that could cause trouble in shell scripts and the like.
|
// Forbid problematic characters that could cause trouble in shell scripts and the like.
|
||||||
if (strpbrk(name.chars(), "*?:[]\"<>\\")) return err(EINVAL);
|
if (strpbrk(name.chars(), "*?:[]\"<>\\")) return err(EINVAL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user