briacp / plugin-omt-package

OmegaT plugin - Manage OMT packages
GNU General Public License v3.0
5 stars 3 forks source link

Only __DEFAULT__ project folders are packed correctly #8

Open msoutopico opened 1 year ago

msoutopico commented 1 year ago

Background

Project folder paths are editable (replacing the __DEFAULT__ value with the actual path to the folder). For example, it's possible to load source files from a custom source folder.

Precondition

  1. Given a project folder at: /home/USER/foo/PROJECT/
  2. The default source folder would be /home/USER/foo/PROJECT/source/

Steps to reproduce

  1. Modify the path of the source folder to, say, /home/USER/bar/source_files/
  2. Pack the project

Expected results

The source folder in the project package contains the files found in /home/USER/bar/source_files/

Actual results

The source folder in the project package contains the files found in /home/USER/foo/PROJECT/source/

Comments

This behaviour could be made optional with a pack-custom-folders=true|false option in the properties file.

msoutopico commented 1 year ago

Thomas Cordonnier is working on integrating the OMT plugin in OmegaT, so perhaps it would be good to wait until that's done and apply the patch directly in the OmegaT code base rather than in the plugin.

briacp commented 1 year ago

I would be a bit cautious reading and writing outside the project folder. It could be really easy to accidentally replace files on the recipient computer (either maliciously or not), or fail because lack of sufficient access rights, or use a different directory scheme (omt created on linux and imported on windows, etc)