From bb0b43eae854125688f3143e53c8974cafed4ad2 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 6 Sep 2017 17:00:14 +0200 Subject: 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. --- erts/doc/src/erlang.xml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'erts/doc/src/erlang.xml') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 2465f49581..aa24eeedd5 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -3683,6 +3683,12 @@ RealSystem = system + MissedSystem {env, Env} +

+ Types:
+   Name = os:env_var_name()
+   Val = os:env_var_value() | false
+   Env = [{Name, Val}] +

Only valid for {spawn, Command}, and {spawn_executable, FileName}. The environment of the started process is extended using @@ -3697,7 +3703,13 @@ RealSystem = system + MissedSystem exception is Val being the atom false (in analogy with os:getenv/1, - which removes the environment variable.

+ which removes the environment variable. +

+

+ For information about encoding requirements, see documentation + of the types for Name and + Val. +

{args, [ string() | binary() ]} -- cgit v1.2.3