Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was reported against swatch here: https://bugzilla.redhat.com/show_bug.cgi?id=1646480
The swatchdog man page for the mail command shows the syntax as:
mail [addresses=address:address:...][,subject=your_text_here]
However, if the email address contains an '@' sign, then swatchdog fails to start and gives an error. (A similar error will also occur if the 'subject' contains an '@' sign.)
Steps to Reproduce:
watchfor /error/
mail addresses=[email protected]
So the line is now 'mail [email protected]'
This is despite not following the man page 'mail' command syntax. However,
further down the man page shows a use of 'mail' which itself does not include
'addresses='. (mail=[email protected],when=1-6:8-17)
Actual results:
Swatchdog stops, showing the following error message:
Global symbol "@example" requires explicit package name at /root/.swatchdog_script.30106 line 97.
Execution of /root/.swatchdog_script.30106 aborted due to compilation errors.
Expected results:
No error should show when starting swatchdog.
Additional info:
The problem is that the 'addresses=' and 'subject=' parts do not cater for '@' signs in them. When 'addresses=' is left out, then swatchdog does handle them because it goes through a different bit of code.
This PR corrects this. It is only a few lines long.
It has been tested with one and multiple addresses, and the subject line, with an '@' in it has been tested too.