Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix postfix.set_main's assumption of prefix-free key names #47966

Merged
merged 1 commit into from Jun 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion salt/modules/postfix.py
Expand Up @@ -288,9 +288,10 @@ def set_main(key, value, path=MAIN_CF):
pairs, conf_list = _parse_main(path)

new_conf = []
key_line_match = re.compile("^{0}([\\s=]|$)".format(re.escape(key)))
if key in pairs:
for line in conf_list:
if line.startswith(key):
if re.match(key_line_match, line):
new_conf.append('{0} = {1}'.format(key, value))
else:
new_conf.append(line)
Expand Down