Use NUL to separate environment variables in environment generators.
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 16.7k
- Forks
- 4.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 140
Description
Submission type
- Bug report
- Request for enhancement (RFE)
systemd version the issue has been seen with
233
Currently, environment generators must separate environment variables with newlines. Unfortunately, some environment variables contain interior newlines. The only byte guaranteed to not appear with in an environment variable is the NUL byte so this should be used as the separator (this is also what Linux itself uses).
If you're going to try arguing that "you shouldn't put newlines in environment variables", legacy code doesn't care about "should". For environment generators to be fully useful, it needs to be possible to write a /etc/profile.d/ generator and environment variables set in profile scripts can include arbitrary bytes (except NUL).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no implementation files or tests. Start by locating the environment-generator parsing code and its tests, then trace how variables are currently separated. Done means generators can use NUL separators so environment values may contain interior newlines, while preserving the existing generator behavior otherwise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100