🐛 N°8838 - fix testing mysqldump custom path #770
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.
Base information
Symptom (bug)
Regression: testing of a correct custom path to mysqldump fails with error 'mysqldump not found in ...'.

Reproduction procedure (bug)
Cause (bug)
commit "N°8379 - fix backup issue" introduced a security test on content of parameter 'mysql_bindir' of 'itop-backup' module configuration, but with incorrect quoting : double quote are added to the command before testing it exist, but file_exists() doesn't need and doesn't interpret these quotes and fails to find the file.
Still, quoting is needed before returing the command for system call to properly handle cases where the path contains spaces or other characters shell would interpret as separators.
Proposed solution (bug and enhancement)
postpone quoting the command so that file_exist() can have a unquotted command to test
Checklist before requesting a review
Checklist of things to do before PR is ready to merge