Skip to content

Conversation

@favincen
Copy link
Contributor

@favincen favincen commented Oct 30, 2025

Base information

Question Answer
Related to a SourceForge thead / Another PR / Combodo ticket? bug #8838
Type of change? Bug fix

Symptom (bug)

Regression: testing of a correct custom path to mysqldump fails with error 'mysqldump not found in ...'.
image

Reproduction procedure (bug)

  1. On iTop 3.2.2-1
  2. With PHP 8.1.33 or 8.3.12
  3. Set a valid custom path to mysqldump command in parameter 'mysql_bindir' of 'itop-backup' module configuration
'itop-backup' => array (
		'mysql_bindir' => '/opt/local/bin/',
  1. access backup status page (${ITOP-app_root_url}/pages/exec.php?exec_module=itop-backup&exec_page=status.php)
  2. iTop fails to find mysqldump command even if it is present and with appropriate rx rights on path and file.

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

  • I have performed a self-review of my code
  • I have tested all changes I made on an iTop instance (linux and MacOS darwin)
  • I have added a unit test, otherwise I have explained why I couldn't
  • Is the PR clear and detailed enough so anyone can understand digging in the code?

Checklist of things to do before PR is ready to merge

  • test on a iTop instance running on Windows
  • consider rebase to support/3.2
  • consider adding unit tests

@favincen
Copy link
Contributor Author

My first PR ever ! 😅🤞

@favincen favincen changed the title 🐛 fix testing MySQLBinDir 🐛 N°8838 - fix testing MySQLBinDir Oct 30, 2025
@favincen favincen changed the title 🐛 N°8838 - fix testing MySQLBinDir 🐛 N°8838 - fix testing mysqldump custom path Oct 30, 2025
@jf-cbd
Copy link
Member

jf-cbd commented Oct 30, 2025

Youhou, right in time for Hacktoberfest 😄
The functional review occurred the previous week, but since a ticket and a bug already exist, I'll check if it can be validated "functionally" before the next technical review on Friday 7

@jf-cbd jf-cbd moved this from Hacktoberfest to Pending technical review in Combodo PRs dashboard Nov 3, 2025
@jf-cbd
Copy link
Member

jf-cbd commented Nov 10, 2025

Hey @favincen, could you please rebase your branch on support/3.2 ? Since it's related to a security fix, we'll probably publish your fix on 3.2.3

@favincen favincen force-pushed the issue/8838-fix_backup_status_mysqldir_not_usable branch from af84362 to fbee01f Compare November 11, 2025 22:48
@jf-cbd jf-cbd changed the base branch from develop to support/3.2 November 12, 2025 07:58
@jf-cbd jf-cbd changed the base branch from support/3.2 to develop November 12, 2025 08:32
@jf-cbd jf-cbd force-pushed the issue/8838-fix_backup_status_mysqldir_not_usable branch from fbee01f to 8527eec Compare November 12, 2025 08:38
@jf-cbd jf-cbd changed the base branch from develop to support/3.2 November 12, 2025 08:38
@favincen
Copy link
Contributor Author

Sorry I messed up while trying to rebase ! 🫢
I leave to you to clean up, because I'm afraid of doing more damage...

@jf-cbd jf-cbd force-pushed the issue/8838-fix_backup_status_mysqldir_not_usable branch from fd27693 to 8527eec Compare November 12, 2025 13:06
@jf-cbd
Copy link
Member

jf-cbd commented Nov 12, 2025

Sorry I messed up while trying to rebase ! 🫢 I leave to you to clean up, because I'm afraid of doing more damage...

No problem, thanks for trying :) I just fixed it

@jf-cbd jf-cbd merged commit 066b27c into Combodo:support/3.2 Nov 13, 2025
@github-project-automation github-project-automation bot moved this from Pending technical review to Finished in Combodo PRs dashboard Nov 13, 2025
@jf-cbd
Copy link
Member

jf-cbd commented Nov 13, 2025

Thank you for your PR @favincen ! I merged it, and the fix will be in 3.2.3 (and 3.3)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants