If I am correct, the environment of a process is an array of strings. The strings usually have the form "name=value", but not necessarily. I was wondering for what purposes the strings don't have the "name=value" form? Thanks.
I'm not aware of anything actually using or expecting environment strings that don't contain
=. Those would typically be pathological cases.
printenv will faithfully print them.
For some languages, those strings will be out of reach. For instance, if you call
perl with a
foo env string, it won't show in
perl would still pass it along to the commands it executes (unless you reset the whole
So one could possibly use that to bypass some environment sanitizing (though proper environment sanitizing should start with an empty environment).
Some tools (like some shells) strip them from the environment they receive and don't pass them along to commands they execute, so in general it's not a good idea to rely on that.
=-less env strings, other pathological cases include env strings with duplicate variable name (like both
foo=bad passed in
envp) which has already been seen as causing vulnerabilities (like CVE-2016-2381), and env strings like
=foo (empty variable name; note that POSIX
getenv() can set/get that variable, but not