diff options
author | Rickard Green <[email protected]> | 2017-09-06 17:00:14 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2017-10-11 16:59:40 +0200 |
commit | bb0b43eae854125688f3143e53c8974cafed4ad2 (patch) | |
tree | 648c103b0777d951b0e4a44b6615753d2748a2ea /lib/kernel/test/file_name_SUITE.erl | |
parent | 02fd746c40e829adbe77cc526c7df904698e2534 (diff) | |
download | otp-bb0b43eae854125688f3143e53c8974cafed4ad2.tar.gz otp-bb0b43eae854125688f3143e53c8974cafed4ad2.tar.bz2 otp-bb0b43eae854125688f3143e53c8974cafed4ad2.zip |
Don't allow null chars in various strings
Various places that now reject null chars inside strings
- Primitive file operations reject it in filenames.
- Primitive environment variable operations reject it in
names and values.
- os:cmd() reject it in its input.
Also '=' characters are rejected by primitive environment
variable operations in environment variable names.
Documentation has been updated to document null characters
in these types of data as invalid. Currently these operations
accept null chars at the end of strings, but that will change
in the future.
Diffstat (limited to 'lib/kernel/test/file_name_SUITE.erl')
-rw-r--r-- | lib/kernel/test/file_name_SUITE.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl index 899102c908..f23529fec9 100644 --- a/lib/kernel/test/file_name_SUITE.erl +++ b/lib/kernel/test/file_name_SUITE.erl @@ -302,7 +302,9 @@ check_normal(Mod) -> {ok, BC} = Mod:read(FD,1024), ok = file:close(FD) end || {regular,Name,Content} <- NormalDir ], + {error, badarg} = Mod:rename("fil1\0tmp_fil2","tmp_fil1"), Mod:rename("fil1","tmp_fil1"), + {error, badarg} = Mod:read_file("tmp_fil1\0.txt"), {ok, <<"fil1">>} = Mod:read_file("tmp_fil1"), {error,enoent} = Mod:read_file("fil1"), Mod:rename("tmp_fil1","fil1"), |