Commit Graph
15 Commits
Author SHA1 Message Date
salman 5a8bd70957 Harden singleTrimSP.cgi: traversal fix, watchdog, pruner, archive lock, caps
- P0 path-traversal fix: run-name class is dot-free with \z anchors, so
  '.', '..', and %0A-trailing values can never escape TRIMSP_TMPROOT. The
  deployed path allowlist is derived from the configured root instead of the
  old hardcoded /tmp prefix.
- Replacing external  with an alarm() watchdog that kills the
  engine's whole process group (setpgrp + kill KILL -pid), matching
  muSRFlow; describe_result maps -2/-1/signal to 124/127/128+sig.
- prune_stale_jobs() ages out dirs (TrimSP.cfg marker only), orphaned .tgz,
  and leaked per-request logs; safe in shared /tmp (symlinks skipped,
  remove_tree safe mode, never touches non-trimsp dirs).
- Archive is serialized per run with flock (.trimsp-lock); per-point engine
  runs stay concurrent.
- Symlink/non-dir run dirs refused; mode 0700 so results are not
  world-readable. read/download also reject symlinked targets.
- Request caps: MAX_REQUEST_LINES 20000, MAX_REQUEST_BYTES 4 MiB -> 413.
- action=health deployment self-check; env overrides TRIMSP_BIN, TMPROOT,
  CMD_TIMEOUT, JOB_MAXAGE (sed anchor for the binary path kept intact).
- Wire contract preserved: ok/phase/message/exitCode/archiveUrl/log JSON,
  text read, gzip download, real HTTP statuses. No TrimSPweb.js change.
- New tests/cgi-tests.sh drives the real CGI offline (18 cases: traversal,
  %0A, escaping round-trip, success/fail/hang engine, 124 watchdog, archive+-
  download, pruner, symlink refusal, 413). deploy-web.sh now verifies the
  sed substitution embedded the selected engine path.
2026-09-26 16:32:38 +02:00
salman 8700fd3a85 Add README for tests 2026-08-27 15:07:36 +02:00
salman d4cdb1dd65 Expose RNG selcetion from GUI 2026-06-25 09:42:41 +02:00
salman a19dd6b96b Tests from pcg32, twice as fast and almost the same as the original ranlux. 2026-06-19 18:20:56 +02:00
salman d2d9f786e9 Run tests with modified fortran code 2026-06-18 09:59:14 +02:00
salman 82b530e9ca Enable running or loading multiple .cfg file from the command line. 2026-06-14 18:12:28 +02:00
salman a1e9a9f298 Make work path relative in test cfg files. 2026-06-13 16:38:06 +02:00
Zaher Salman b39054348f Passed regression tests. Bump up version to 1.3.0 2026-06-12 19:23:54 +02:00
Zaher Salman a11871ba1c Increased number of allowed elements in the composition to 12 and tested 2026-06-12 19:14:40 +02:00
Zaher Salman 07917e1ae9 Updated Li8 tests with bugfix binary 2026-06-12 18:21:36 +02:00
Zaher Salman b86d26a259 Merge branch 'feature/bugfix' of bitbucket.org:zaher-salman/trimsp into feature/bugfix 2026-06-12 18:18:55 +02:00
Zaher Salman ef009aaddc Updated tests with the bugfixed binary. 2026-06-12 18:15:12 +02:00
Zaher Salman a838168b8a Add 8Li tests for the bugs. 2026-06-12 17:41:55 +02:00
Zaher Salman efa71b24e9 Add tests for ultra thin targets to check bug fix. 2026-06-12 17:16:10 +02:00
Zaher Salman 21976f7ccf Add baseline tests before major changes to fortran code. 2026-06-12 16:26:42 +02:00