kernel: Do not forbid filenames starting with a hyphen
All checks were successful
continuous-integration/drone/push Build is passing

Some programs on Linux seem to use those, better be careful.
This commit is contained in:
apio 2023-04-16 11:33:35 +02:00
parent 3b4214c8be
commit 949321932f
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -73,9 +73,6 @@ namespace VFS
// 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);
// Forbid filenames starting with a hyphen.
if (!name.is_empty() && name[0] == '-') return err(EINVAL);
// Forbid filenames with leading spaces. // Forbid filenames with leading spaces.
if (!name.is_empty() && name[0] == ' ') return err(EINVAL); if (!name.is_empty() && name[0] == ' ') return err(EINVAL);