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

Conversation

Projects
None yet
2 participants
@mbunkus
Contributor

mbunkus commented Jun 5, 2018

Salt's "postfix.set_main" module function used "line.startswith()"
for determining which entries from "main.cf" to keep and which to
overwrite. This matched more lines that intended, though, as the names
of Postfix' configuration options aren't prefix-free.

For example, both "virtual_transport" and
"virtual_transport_rate_delay" are valid and known keys. Therefore
trying to set "virtual_transport" would lead to
"virtual_transport_rate_delay" being replaced, too, by another
instance of "virtual_transport".

The new method matches the line based on the key name being terminated
by whitespace, an equal sign or the end of the line.

Fixes #47888.

Tests written?

No

Commits signed with GPG?

Yes

Fix postfix.set_main's assumption of prefix-free key names
Salt's "postfix.set_main" module function used "line.startswith()"
for determining which entries from "main.cf" to keep and which to
overwrite. This matched more lines that intended, though, as the names
of Postfix' configuration options aren't prefix-free.

For example, both "virtual_transport" and
"virtual_transport_rate_delay" are valid and known keys. Therefore
trying to set "virtual_transport" would lead to
"virtual_transport_rate_delay" being replaced, too, by another
instance of "virtual_transport".

The new method matches the line based on the key name being terminated
by whitespace, an equal sign or the end of the line.

Fixes #47888.
@rallytime

Thanks @mbunkus!

@rallytime rallytime merged commit 998a1c1 into saltstack:2017.7 Jun 6, 2018

6 of 9 checks passed

default Build finished.
Details
jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #5496 — FAILURE
Details
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #19552 — FAILURE
Details
WIP ready for review
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #25694 — SUCCESS
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #17762 — SUCCESS
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #23429 — SUCCESS
Details
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #10468 — SUCCESS
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #22393 — SUCCESS
Details

@mbunkus mbunkus deleted the mbunkus:fix-postfix-prefix-free-key-names-assumption branch Jun 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment