Skip to content
Snippets Groups Projects
Commit ef6f9645 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Forbid minus-prefixed option names in systemd::unit.

In systemd::unit_options, you can prefix an option name with a minus
sign (Unicode 002D "hyphen-minus") to "reset" a list option to the
empty list, so the new values don't just append to the existing list
of values.  That makes sense when overriding/supplementing options in
earlier unit files, but systemd::unit installs the "main" unit file,
the one that is read first, so list options *always* have the empty
list as their value when the file is read.

We here modify the unitfile.erb template file to see if it is called
from systemd::unit or systemd::unit_options, and if the former, it
raises an error if it encounters an option name starting with a minus
sign.  And of course also remove the paragraph describing that beha-
viour in the 'options' parameter documentation.
parent a6807aed
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment