#40635·dolibarr

Documents backup: Gzip is preselected but refused by the command whitelist on upgraded installations

Author: Steph501Created Sep 21, 2026Updated Sep 21, 2026

Bug

Since 24.0.1, Utils::executeCLI() refuses any OS command that is not listed in $dolibarr_main_restrict_os_commands. The list written in conf.php by the installer of previous versions, so the one present on every upgraded installation, does not contain tar, gzip, bzip2 or zstd. On the backup screen (Home > Admin tools > Backup), step 2 "Backup of documents" still preselects Gzip, and "Generate backup" fails with "Error tar generation return Command ... is not in the whitelist of allowed commands". Choosing Zip works, but nothing tells the user why the default choice fails or how to allow the commands.

Commit 2dac80642de adds tar, gzip, bz2, zstd to the default list, but only for new installations, and it says "bz2" while the command launched by export_files.php is "bzip2".

Dolibarr Version

24.0.1, 24.0 branch

Environment PHP

any

Environment Database

any

Steps to reproduce the behavior and expected behavior

  1. An installation created with a version before 24.0.2 and upgraded to 24.0.1: conf.php contains $dolibarr_main_restrict_os_commands='mariadb-dump, mariadb, mysqldump, mysql, pg_dump, pg_restore, clamdscan, clamdscan.exe'.
  2. Home > Admin tools > Backup, step 2 "Backup of documents", keep Gzip (preselected), click "Generate backup".
  3. Error: "Error tar generation return Command ... is not in the whitelist of allowed commands".
  4. Choose Zip instead: the archive is generated.

Expected: the screen should not offer nor preselect a compression format whose commands are not allowed, and should tell the administrator which commands to add to the list. The default list should name bzip2, the command actually launched.

Attached files

No response